Shop Mobile More Submit  Join Login
×




Details

Submitted on
October 27, 2007
Image Size
74.0 KB
Resolution
600×600
Thumb

Stats

Views
14,219
Favourites
133 (who?)
Comments
90
Downloads
651
×
[Edit] This tutorial is outdated! It can still be used for learning some basics for Flash but it is advised you find newer tutorials! I have a new video tutorial series on youtube ( [link] ) for making a Flash game using AS3. [/Edit]

Due to the massive success of the last RPG tut I made. I made a new, better, more up to date version.

Well what are you waiting for? Get going! Start building your own RPG.
Add a Comment:
 
:iconhypersonic53:
Hypersonic53 Featured By Owner Sep 12, 2011  Hobbyist Traditional Artist
Finally, a VEERY helpful tutorial. Thanks!
Reply
:iconrisa884:
Risa884 Featured By Owner May 24, 2011
helpful
Reply
:iconhikara-chan:
Hikara-chan Featured By Owner May 2, 2011  Hobbyist General Artist
I suck balls
Reply
:icondumpaling:
dumpaling Featured By Owner Feb 18, 2011
This was so helpful!
Reply
:iconkawaiisairen:
KawaiiSairen Featured By Owner Jan 5, 2011
do you know how to make a button go to a random frame?
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Jan 5, 2011  Student Artist
Simply tell it to generate a random number in the range you want using random() [AS1/AS2] or Math.random() [AS1/AS2/AS3].
For example:

gotoAndStop(int(Math.random()*5));
Would generate a random number between 0 and 4 (not 5) and go to and stop on that frame. It is enclosed in int() to type cast it as an integer.

Math.random() generates a number in the range[0,1) (ie: 0.55674353 or whatever) then it is multiplied by 5 (change to whatever upper limit you want+1) to give 2.78371765, then the int() removes all the decimals resulting in just 2. So it then goes to frame 2!

More examples:

gotoAndStop(int(Math.random()*11)+5);
It will go to a random frame between 5 and 15. (Generates a number up to 10 and adds 5. If it generates 0 then it goes to frame 5 (lower limit), if it generates 10 then it goes to frame 15 (upper limit).
Reply
:iconkawaiisairen:
KawaiiSairen Featured By Owner Jan 5, 2011
okay thanks
Reply
:iconkaboom-wabit:
kaboom-wabit Featured By Owner Nov 29, 2010  Hobbyist Traditional Artist
um.. i am making this game, all i dont know is the save and load part >.< can you um.. tell me the codes
i dont know, it looks @.@ <-- mixed up or something XD
Reply
:iconkawaiisairen:
KawaiiSairen Featured By Owner Nov 27, 2010
hi, i was wondering, if you make a day feature, so that you sleep and it becomes day 2 and then next it becomes day three etc.
do you know how you make things happen on certain days?
i really need help
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Nov 27, 2010  Student Artist
Well you could have a variable keep track of what day it is and increase it when the character sleeps. If you wanted certain events to happen on certain days just use an if statement to check if the day is correct if(day==2){ //have the event occur } or whatever.
Reply
:iconkawaiisairen:
KawaiiSairen Featured By Owner Nov 27, 2010
ok thanks but how should i make the event?
i tried adding a code to go to another frame if it was day 2 but it didn't work.
here is the code just incase there is something wrong with it
--> if(day==2){ //have the event occur }
on (release) {
_root.gotoAndPlay("yaay");
}

oh and i was supposed to add it to a button right?
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Nov 27, 2010  Student Artist
if you were to do it that way you'd have to do
on(release){
if(day==2){
//insert something to do, goto another frame?
}
}

I think you need to learn how to use if statements and understand the code you are writing rather than blindly copy and paste.
Reply
:iconkawaiisairen:
KawaiiSairen Featured By Owner Nov 28, 2010
thank you!

yea i know but i can't really learn unless i ask someone to help me.
i have no other place to learn from

but thank you really much!
Reply
:iconmenestria:
Menestria Featured By Owner Nov 24, 2010
Which code did you use ? Actionscript 2 or 3 ? Thank you ! :D
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Nov 24, 2010  Student Artist
Now? AS3. In the tutorial? AS1/2.
Reply
:iconmenestria:
Menestria Featured By Owner Nov 25, 2010
OK, thank you :D
Reply
:iconkawaiisairen:
KawaiiSairen Featured By Owner Nov 16, 2010
thanks for making this ^^
but on my energy stats it says: Energy:undefined/200
? how do i remove the "undefined" part?
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Nov 16, 2010  Student Artist
It means that you have a variable name wrong somewhere most likely. It's saying "undefined" because the variable isn't defined >_<.
Reply
:iconkawaiisairen:
KawaiiSairen Featured By Owner Nov 17, 2010
but i checket it it seemes to be rigth names but it won't work i used this code

your_button.onRelease=function(){
//"your_button" is the buttons instance name
if(show_cash>=10){//check if you have 10 or more cash
//"your_cash" is your variable for money in the game
show_energy+=1//train you to be stronger or if you are buying an item
//or something you can put whatever code to activate the item there instead
show_cash-=10
//you bought something, you give them the cash for it
}
//close our brackets

(i am just exploring with codes XD)

and the dynamic text boxes that says undefined has the vars show_energy and
show_cash

please help
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Nov 17, 2010  Student Artist
Did you set any default values for the vars?
Reply
:iconkawaiisairen:
KawaiiSairen Featured By Owner Nov 18, 2010
i don't think so, where is it?
Reply
:iconsonyscreens:
sonyscreens Featured By Owner Aug 16, 2010  Hobbyist General Artist
Nice tutorial!

Do you think you could help me with something? No one seems to have a tutorial for talking with NPCs. :/
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Aug 16, 2010  Student Artist
There are a lot of ways you can do that.

Just a matter of how you want to do this:
?hero is close to an NPC?
//could be done using hittest or checking if x,y coords are in a certain range of the NPC's x,y coords

?button to talk to an NPC is pressed?
//pretty straight forward

<display what the NPC has to say and/or some sort of conversation system>
//if they just say one thing and you don't talk back just have a pop up with what the npc has to say?
//if you want to have different options to reply back with or just yes/no answers or simply have to press a button to continue then it get's a little harder but then it's just displaying different things based on the choice the player makes.

Really there are dozens of ways to go about it, not sure what kind of conversation engine you want.
Reply
:iconsonyscreens:
sonyscreens Featured By Owner Aug 16, 2010  Hobbyist General Artist
I will have the player press a key when touching the npc to start the talking. I can do that.

The conversation part will be straighforward, just pressing a button to continue through the conversation. Like an RPG style box.

However, I can't figure out how I would get the text box into position and also keep the player from moving during the conversation.

Thank you. :)
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Aug 16, 2010  Student Artist
Well have your movement code wrapped in a check if(!talking){//movement code } and so when you start a conversation talking=true and when the conversation ends have talking=false. That way it'll only let you move if talking is not true (ie: false).
Not sure what you mean by textbox, like a speech bubble or just a box that appears at the bottom of the screen?
Reply
:iconsonyscreens:
sonyscreens Featured By Owner Aug 17, 2010  Hobbyist General Artist
Okay. I can do that.

I want a box at the bottom at the screen.

How can I go about doing that? Should I just leave it there invisible and have it appear when the conversation starts?

My other idea was to have all the conversations off screen and have them track the player like a vcam when activated.
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Aug 17, 2010  Student Artist
Oh I just assumed you'd have a movieclip of the conversation window with a dynamic text box inside of it and just change what the textbox reads when you talk to different people.

conversationMC.conversationText="Matt: Halt criminal scum!";

You could have it visible=false when not in conversation or good practice would have you remove it and reattach it to the stage when you start a conversation. (likewise removing when done conversation).
Reply
:iconsonyscreens:
sonyscreens Featured By Owner Aug 17, 2010  Hobbyist General Artist
Okay! I can try that.


Thank you for all your help!
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Aug 17, 2010  Student Artist
Anytime, if you have any more feel free to ask.
Reply
(1 Reply)
:iconthe-fishy-one:
The-fishy-one Featured By Owner Feb 27, 2010  Student General Artist
Thanks for sharing this tut, man! One of the most detailed I've ever seen.

[ This is TheFishyOne from the XGen Forums, if you remember me. The one that was asking a lot of questions on his failed RPG. :XD: ]
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Feb 27, 2010  Student Artist
It's not perfect nor the best but it's as good a spot to start as any I guess.
I do remember your threads and I'm glad it helps.
Reply
:iconthe-fishy-one:
The-fishy-one Featured By Owner Feb 27, 2010  Student General Artist
Not quite a start for me but I DO have learnt some new techs, which I find really helpful and a simpler way to put them than kilometric code.
Reply
:iconstarcrystaldreams:
StarCrystalDreams Featured By Owner Nov 6, 2009  Student General Artist
Hi~ Thanks for your tutorial, I wanted to make an RPG for my friend. I have one question though. How do you make multiple characters? Like, for example, you choose whether you are a boy or a girl, or different characters, like "Lily" or "Sarah" or "John"?

Thanks in advance :D
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Nov 7, 2009  Student Artist
There are multiple ways to that, much like anything done in Flash. Rather than try to explain I'll just whip up an example quickly.
Example (swf): [link]
Example (fla): [link]
Reply
:iconstarcrystaldreams:
StarCrystalDreams Featured By Owner Nov 7, 2009  Student General Artist
Thank you for the info! :iconthankyouplz:
Reply
:iconprincess-peachie:
Princess-Peachie Featured By Owner Nov 6, 2009
When I get Flash CS3 for Christmas I'm totally going to try this out. :) I've got MX right now it won't work, but soon! :D
Great job on this by the way. Thank you for it!!
Reply
:iconalexw99:
alexw99 Featured By Owner Jul 26, 2009   Filmographer
all your lonks dont work for me. iv got flash mx
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Jul 26, 2009  Student Artist
Ug, I can't save that far back. I'm using CS3 so the farthest back I can save is Flash 8.
Any chance you could "get" a better version. =P
Reply
:iconalexw99:
alexw99 Featured By Owner Jul 28, 2009   Filmographer
they cost a frikkin lot! i dont fink so sorry
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Jul 28, 2009  Student Artist
cough pirate cough
Reply
:iconitty-bitty-stock:
itty-bitty-stock Featured By Owner Jun 23, 2011  Student Traditional Artist
XD you sound just like my best friend and I.
Reply
:iconalexw99:
alexw99 Featured By Owner Jul 26, 2009   Filmographer
dont worry i sorted it out!
but could you be able to add doors?
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Jul 26, 2009  Student Artist
Also, if you wanted to enter and exit buildings at the correct location you could do something like I did in this engine. [link] which involves saving the x,y and placing the hero/player there when you exit the building/go back to the main map.
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Jul 26, 2009  Student Artist
You could easily just have an invisible hittest area in front of a building's door that when the hero/player hits it, it goes to the frame where you can walk around inside. Much like I did here [link] (the red arrow on the left leads to another frame with the fight) only with a door and instead of a fight, another map with different walls, etc.
Source of above: [link]
Reply
:iconalexw99:
alexw99 Featured By Owner Jul 26, 2009   Filmographer
i have a problom i checked all the coads and i can still get through the walls why?
Reply
:iconmitsuray:
Mitsuray Featured By Owner Jul 8, 2009
i hope you can help me with this, i have been searching for some time now and i just can't find a explanation of the battle to game transition... (so your gonna be the "victim" :P)

When you go into a battle, you change frame (ok, normal...) but then when you win and wanna go back to the game, how do you do it so that your character is on the place where you left it before entering this random battle and not always on a certain place you defined him to appear initially...
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Jul 9, 2009  Student Artist
well on the game stage have to initial X and Y variables to place where the hero/main character is.
Say on the menu screen before playing have them set to whereever you want him to start
var intX:Number=300
var intY:Number=320
Then on the game frame, make him go to those x,y values right away first (hero._x=intX and hero._y=intY) and then you can move from there. Then just before you enter a fight or a building, save new intX=heroInstance._x and same for intY=heroInstance._y
So when he comes back to the game frame he'll instantly return to the newly set x,y position.

I can make an example later if you need more help. I'm short on time and have to go!
Reply
:iconmitsuray:
Mitsuray Featured By Owner Jul 9, 2009
Thanks a lot for the response to start off!

And well, i got almost everything, i just don't really get what was heroInstance, is it like somthing invisible just to mark his "spot" so when he ends the fight he goes back to the "spot"?

Also, this is suposed to be a random encounter (dunno if you had that in mind or not, but since i can't really understand the heroInstance i can't really tell).

Also (another also :P), does this work with vCam stuff? I never really tryed the vCam but from what i got somthing you can do with it is like making everything move exept somthing (in this case would be the hero), so if everything else moved and the hero was kept in the middle he would always go back there but how would the stuff around him be?

Dunno if you could understand my doubts lol...

Thanks a lot for your answer in 1st place, even if it doesn't work with the vCam i'm pretty sure i will be able to it with a lot of static screens xD (as long as i can understand what's that heroInstance if you are gonna have the patience to re-answer to me :P or if you don't wanna answer to this stuff here you could make a more elaborate flash tut or somthing with this kind of issue and put on your page [maybe you could help more peopl that way since we are on comment page 2 some people wont even notice your extreme help])
Reply
:iconcomputer-turret:
Computer-Turret Featured By Owner Jul 12, 2009  Student Artist
[link]
There you go, do something like that.
Reply
Add a Comment: