Shop Mobile More Submit  Join Login
This tutorial deals with exactly what it is titled as...

HP, Days, Money, and all of those other stats. Also it goes into stuff about a sequenced dialogue path. 
It is assumed that you have general knowledge on flash (I USE MACROMEDIA FLASH PROFESSIONAL 8). If this looks like a foreign language to you, go to Pacthesis  's page and she has a very neat tutorial on the basics. Then, come back and see if any of this makes sense. 

If you are confused, feel free to comment below so that I (In the rare event that I ever come on here) , or another Deviant can maybe help you. 
If you think that this tutorial is a waste of megabytes go check out Youtube, kirupa, and Macromedia flash forums for better ones. Also, other Deviants here are way better at this stuff than I am, so take a tour around Deviantart also. 

If you do happen to comment on the tutorial, do not be offended if I answer +/- 4 months later. Also, do not be offended if I never answer at all. 
If I don't answer your question, and you see that  I have answered others (aka it looks like I've deliberately avoided your question), it is only because of one (or more) of the following circumstances:
    a. I don't know the answer
    b. the answer is in one of my other tutorials
    c. you aren't using MACROMEDIA FLASH PROFESSIONAL 8 (All of my tutorials are based off of MACROMEDIA FLASH PROFESSIONAL 8; if you do not have MACROMEDIA FLASH        PROFESSIONAL 8, and run into problems, I most likely can't help you because I don't use  other forms)
    d. I'm not sure what you're asking
    e. There's a similar question already figured out in the comment section

If all else fails, send me a  note. I will answer those before heading to the comment section.

Happy Flashing
________
Check out my other tutorials on this stuff down below!
:new: Make a health bar/love meter/etc!!
legiokat.deviantart.com/art/He…

:new: Here is a tutorial on making cheat codes and passwords!
legiokat.deviantart.com/art/Pa…


:new: here is a tutorial on how to let the player choose their own name for the character!
legiokat.deviantart.com/art/Na…

:new: Here is my tutorial involving Inventory, Gift-giving, and a little bit on shops!
legiokat.deviantart.com/art/In…
Add a Comment:
 
:iconkiddoriddo:
Kiddoriddo Featured By Owner Edited Jun 24, 2015
I still go into negative hp even with the code. What could be the reason for this? Also, the dialogue exp on(release){

if (exp == 0) {  
hp -= 10;
gotoAndPlay("hi");  
}else if(hp<10) {
this.enabled = false;
}else if(exp == 10) {
hp -= 10;
gotoAndPlay("hi 2");
}else if(hp<10) {
this.enabled = false;

code didn't work and I had to rewrite it myself. I use cs4, trial version. 
Reply
:iconkiddoriddo:
Kiddoriddo Featured By Owner Edited Jun 21, 2015
I keep getting this: Symbol=Symbol 3, Layer=Layer 1, Frame=1: Line 7: 'else' encountered without matching 'if'
    } else {

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 11: on handlers may not nest within other on handlers
    on(release)

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 12: '{' expected
    day += 1;

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Statement block must be terminated by '}'
    on(release){

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 14: Syntax error.
    }
Reply
:iconobsesser13:
Obsesser13 Featured By Owner Jun 13, 2015  Student
I have adobe flash cc and there are barely any tutorials for that out so far (as I can tell/find... I'm very new to the program still and can make some basic animations and such if that matters at all too). If not, can this work with adobe flash cc or do u know where  I could find some tutorial that could help? thanks
Reply
:iconminyou:
Minyou Featured By Owner Jun 7, 2015  New Deviant
Haii, which one code should I use to make " buy " button? or maybe is diffrent one? for me hp is energia, money is pieniadze, day is dzien . I know those names are strange but I making polish sim dating :3
Reply
:iconlegiokat:
legioKat Featured By Owner Jun 30, 2015  Hobbyist General Artist
Reply
:iconminyou:
Minyou Featured By Owner Jun 30, 2015  New Deviant
Thank you ! :D You are the best *-*
Reply
:iconminyou:
Minyou Featured By Owner Jul 1, 2015  New Deviant
Hello, I've got one more answer. How to add music button on/off ? You know, when I click "on" music turns on but when I click "off" the music is stopped. Sorry for my English.
Reply
:iconderpinc:
DerpInc Featured By Owner May 28, 2015  Hobbyist Digital Artist
How do I make a menu though, like how to I keep track of the points in a symbol so I can hide it and it won't take up space on the game?
Reply
:iconyui123:
yui123 Featured By Owner May 10, 2015  Student General Artist
When I try to code the "talk" button, I get several errors in flash (I'm using CS3 btw). I want to make a dialogue path for my character, like "saving where you left off" sorta thing, as well as displaying a frame where it tells you that you have too little hp, adding exp and stuff. The code that's given here doesn't seem to work for CS3, I tried using:

on(release){

if (exp == 0) {  
hp -= 10;
gotoAndPlay("talk 1");  
}else if(hp<10) {
gotoAndPlay ("no hp left");
}else if(exp == 10) {
hp -= 10;
gotoAndPlay ("talk 2");
}else if(hp<10){
gotoAndPlay ("no hp left");

and I was wondering if you or anyone else could give me the code that's modified for CS3? I would really appreciate it, I'm working on a school project :)
Reply
:iconsttardust:
Sttardust Featured By Owner May 4, 2015  New Deviant Hobbyist General Artist
Hey!
I have a doubt. I follow your instructions but when i paste the code of the "talk button" in its actionscript i doesnt do anything. I click and nothing happends, it doesn't go to the frame i want it to go. This is what I have: 

on(release){
if (exp == 0) {
hp -= 10;
gotoAndPlay("WIL1");  
}else if(hp<10) {
this.enabled = false;
}
}

How can I fix this?
Reply
:iconlegiokat:
legioKat Featured By Owner May 7, 2015  Hobbyist General Artist
So when nothing happens, no variables are changed, you don't even move to a different frame? Hm, I suppose this could be a ton of things.


-Make sure your vars are named correctly.
-Also, make sure you quoted your frame name "WIL1" exactly as you named it on that frame. Because sometimes if you forget you put it in lowercase or forgot you renamed it,  whatnot, flash will look for a frame that kind of doesn't exist. 
-Make sure you're actually coding on a button; I've accidentally coded on a graphic and wondered why nothing happened when I clicked on it. Make sure its a button and that there's a little clicky hand when you test it indicating that you are interacting with a button.
-Also, does any error message from flash pop up? If it doesn't that might mean you named the gotoAndPlay frame wrong.... 
Reply
:iconsttardust:
Sttardust Featured By Owner May 13, 2015  New Deviant Hobbyist General Artist
I'm so stupid I'm ashamed.
Thank you so much for anwsering. After I've checked all the problems you told me I might have, when I got to the last one I realised that the code was not closed with the "}" things.. That was the problem. 
Any way,
Thank you for answering, again and for the tutorials. 
<3
Reply
:icontheproxylady:
TheProxyLady Featured By Owner Feb 25, 2015  Student Photographer
i dont even i dont even unterstand this
Reply
:iconliossenel:
liossenel Featured By Owner Feb 11, 2015  Student General Artist
Not sure but looks like you wanted to link the picture to pacthesis's page. If so then it does not work ( at least for me)
Reply
:iconlegiokat:
legioKat Featured By Owner Feb 15, 2015  Hobbyist General Artist
Oh sorry for the mixup. It wasn't intended to be a link, just a picture. If you are trying to find her tutorial, just type in the words from the picture "how to make a flash dating sim" into the Deviantart search tab, or search Pacthesis and it should appear.
Reply
:iconliossenel:
liossenel Featured By Owner Feb 16, 2015  Student General Artist
at last, thanks for tutorial. If you want I can give some code to make save/load button?
Reply
:iconlegiokat:
legioKat Featured By Owner Feb 16, 2015  Hobbyist General Artist
That would be much appreciated! Thank you:)
Reply
:iconliossenel:
liossenel Featured By Owner Feb 16, 2015  Student General Artist
Actionscript2 to save and load a party.

in first frame, Actions layer, declare your variables ( i will go with "elf" and "arkelf" for example, AND the saving variable.)

var savefile = SharedObject.getLocal("zantetsuken");// here, zantetsuken stands for the name of the save file, which is a .sol
var elf = 0;
var arkelf = 0;

// here, zantetsuken stands for the name of the save file, which is a .sol. It will be published as zantetsuken.sol in this case.
the directory is: C://users\userName\Application Data\roaming\Macromedia\Flash Player\#SharedObjects\(file with lot of letters)\




then in save-button, add the following:

on (press){
savefile.data.elf=_root.elf;
savefile.data.arkelf=_root.arkelf;
savefile.flush();
}



then in load-button, add the following:

on (press){
savefile.data.elf=_root.elf;
savefile.data.arkelf=_root.arkelf;
savefile.flush();
}


Please take in count that it doesn't saves and loads the frame where the saving was done. currently looking for how to do it. then, enjoy the meal.

here the working file in compressed: erasia.r.e.f.unblog.fr/files/2…
Reply
:iconlegiokat:
legioKat Featured By Owner Feb 16, 2015  Hobbyist General Artist
How helpful, thank you:)
Reply
:iconliossenel:
liossenel Featured By Owner Feb 17, 2015  Student General Artist
at your service, ma'am.
anything else? a coffee maybe?
Reply
:iconguest-1001:
Guest-1001 Featured By Owner Dec 6, 2014
This is so helpful! Thank you! I'm just learning Flash and I'm using ActionScript 3 instead of 2 but I think I could adapt a lot of stuff from this to use. Thanks. :)
Reply
:iconkolkolcat:
KolKolCat Featured By Owner Nov 25, 2014  Hobbyist Traditional Artist
Would it be possible to show stats, hp etc. in a bar format rather than just in numbers? Thank you very much for the tutorial though. It's very helpful!
Reply
:iconlegiokat:
legioKat Featured By Owner Feb 15, 2015  Hobbyist General Artist
Reply
:iconkolkolcat:
KolKolCat Featured By Owner Feb 25, 2015  Hobbyist Traditional Artist
I'm sorry for the late reply! But thank you so, so much. :3 This is fantastic. Thank you again!
Reply
:iconlazu1e:
Lazu1e Featured By Owner Nov 5, 2014
There is one and just one problem... You and Pathesis make. In her simdates you can stack HP/Energy/Time like crazy if you sleep all day and erry day. Thats not immersive since you can do everything in one day if you are good at min-maxing. Real human beings don't stack that much energy sleeping all-day actually they waste their lives this way.

A max HP cap value is needed... most people cap the max HP to 100 in SimDates.  If you want to be simple cap it at 10 and reduce your other variables accordingly, the extra digit is not that needed.

Anyway thanks a lot for the tutorial it helps a bunch.
Reply
:iconlegiokat:
legioKat Featured By Owner Nov 23, 2014  Hobbyist General Artist
If you are looking for a fairly simple way to kind of do this, instead of putting +50 hp on your sleep button, you can make it say hp = 50.

By doing this, your sleep or HP will be 50 no matter how many times you hit the sleep button. Of course, your button will still have the +1 day part, so even if you hit the sleep button 12 times, your HP will be reset to 50 each time, not compound itself, and you will be on day 12. 

You could also do a"cap" function, by making the button have an "if" statement, saying if the HP is greater than or equal to 50, the button will inactivate. This is similar to the previous solution, but instead of clicking the button 12 times, and ending up on the 12th day with 50 max daily hp, you'd be on day 1 because the button will be inactivated once you have max hp, not allowing you do move on to the next day if you have all your hp. 
Again, this would still have the +1 day function, although it would only work if you hit the sleep button with less than 50 (or whatever your max hp is) hp. 

My honest opinion, is do the first way. It's much simpler. Any questions send me a note, and I'm glad you found the tutorial helpful
Reply
:iconjpgsara:
jpgsara Featured By Owner Edited Sep 12, 2014  Hobbyist Digital Artist
hi! i was wondering,

where do you put the code so that you dont go into negative stats for? which frame/button does it go into the actionscript? i dont know where i should put it. i tried to put it in the actionscript of every button but it doesnt work ;-; please please help
Reply
:iconlegiokat:
legioKat Featured By Owner Sep 19, 2014  Hobbyist General Artist
your sleep buttpn
Reply
:iconjpgsara:
jpgsara Featured By Owner Sep 12, 2014  Hobbyist Digital Artist
oh, also, when i clicked on the sleep button it only gives me 5 hp when i put 50 hp in the sleep button actionscript

here is what i put in the sleep button actionscript

on(release){
day += 1;
hp += 50;
}

also the day resets back to one after i press the sleep button 10 times :///? please help me anyone, please please please
Reply
:iconlegiokat:
legioKat Featured By Owner Jan 4, 2015  Hobbyist General Artist
According to your code, it really should add 1 day and 50 hp. 

Once I had a problem similar to this, but I realized that I didn't make the dynamic text box large enough, so I only saw the first button. I don't know if this is your problem, but it reminded me of mine.

I don't know what to tell you though.  
Reply
:iconjijou01:
jijou01 Featured By Owner Jul 22, 2014
How can i create a love meter that progress when the player hit the right answer ?? 
and thanks
Reply
:iconhoney-apple:
honey-apple Featured By Owner Jun 17, 2014  Hobbyist Digital Artist
I'm going to make one soon, probably. I just released a detective game but omg coding frames and stuff are so tiring i iasjdnsiadn but thanks! This tutorial was super helpful.
Reply
:iconartelleart:
ArtelleArt Featured By Owner May 6, 2014
Thank you very much! I can't wait to start my own project. :D
Reply
:iconsodacat17:
SodaCat17 Featured By Owner May 5, 2014  Student Photographer
Ahh, nevermind, I realized I declared my variables one frame over the one I was supposed to declare them on, aha
Reply
:iconsodacat17:
SodaCat17 Featured By Owner May 4, 2014  Student Photographer
I'm sorry if this is dumb, but I've just about tired myself out thinking about it, aha. I keep getting either 'NaN' or '_leve' errors for the variables? I'm just really confused as to why this is happening. Like, in the stats area, instead of a number, either one of those two shows up, or nothing at all.
Reply
:iconsecretelycharmed:
SecretelyCharmed Featured By Owner Apr 16, 2014  Hobbyist Traditional Artist
Will this work on Flash CS3 and which action script do I use, 2.0 or 3.0
Reply
:iconlegiokat:
legioKat Featured By Owner Apr 19, 2014  Hobbyist General Artist
Idk about the CS3, I don't have CS3. Use 2.0
Reply
:icondindoyne:
Dindoyne Featured By Owner Apr 7, 2014  Hobbyist Artist
i have a question, where should i put the Days dynamic text? should i put it on every frame? or ... no.... im stuck with the frames -_-
Reply
:iconlegiokat:
legioKat Featured By Owner Apr 8, 2014  Hobbyist General Artist
where ever you want the numbers to show up
Reply
:icondindoyne:
Dindoyne Featured By Owner Apr 8, 2014  Hobbyist Artist
but i dont need to change the coding right?
Reply
:iconputrithetropical:
PutriThetropical Featured By Owner Apr 11, 2014
hi, i also have the same question as Dindoyne. i knew that i want the Days appear in every frame. but, what im asking is, do we place days dynamic text in first frame only or do we need to make each frame as keyframe---so we need to write the actionscript in each keyframe? i write my actionscript in each frame of layer "action". thanks
Reply
:iconlegiokat:
legioKat Featured By Owner Apr 11, 2014  Hobbyist General Artist
where ever you want to see the days, you have to have a dynamic text box on that frame. just copy and paste the textbox onto each frame
Reply
:iconputrithetropical:
PutriThetropical Featured By Owner May 24, 2014
okay, thank you :)
Reply
:iconyancalai:
Yancalai Featured By Owner Mar 27, 2014  Hobbyist Digital Artist
oh hey i have a question about the hp days money and stats thing , when ii go to the room and sleep i get 50 hp my staring hp is 100  then when i go to the shop it's still 150 hp but when i go back to my room it becomes 100 hp and goes back to day 1?? pls help
Reply
:iconlegiokat:
legioKat Featured By Owner Mar 27, 2014  Hobbyist General Artist
It sounds like you have declared your variables on that frame. You declare the variables on the very first frame, most likley a place that you will never return to (ex: the title frame). If you declare your variables on the bedroom, everytime you go to the bedroom, your variables will switch back to whatever you declared them as. They are fine at the shop, because you haven't declared them there. So the values carry over form when you were last at the bed room.

long story short, declare your variables somewhere else other than the bedroom
Reply
:iconyancalai:
Yancalai Featured By Owner Mar 27, 2014  Hobbyist Digital Artist
ohhhh thank you so much
Reply
:iconyancalai:
Yancalai Featured By Owner Mar 26, 2014  Hobbyist Digital Artist
lol at the confuse flash hahaha i see what you did there ! Awesome tutorial! thanks!
Reply
:iconxxvocaloidsrule:
XxVocaloidsrule Featured By Owner Mar 19, 2014  Hobbyist Artist
Where and how do you program all of this?? please helllppp
Reply
:iconlegiokat:
legioKat Featured By Owner Mar 21, 2014  Hobbyist General Artist
This is Macromedia Flash Professional 8. I suggest that you use Pacthesis' tutorial for beginners before you attempt any of this.
Reply
:iconxxvocaloidsrule:
XxVocaloidsrule Featured By Owner Mar 21, 2014  Hobbyist Artist
Thank you, for the tutorials, though! Its really helping.
Reply
Add a Comment:
 
×
Download SWF download, 1.0 MB




Details

Submitted on
August 2, 2012
Image Size
1.0 MB
Resolution
550×400
Link
Thumb
Embed

Stats

Views
22,264 (5 today)
Favourites
618 (who?)
Comments
319
Downloads
396
×