Shop Mobile More Submit  Join Login
×




Details

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

Stats

Views
18,872 (6 today)
Favourites
562 (who?)
Comments
297
Downloads
319
×
I felt like making a tutorial... And this was the only thing I was semi-alright at. :P Also I had one heck (awful) of a time trying to learn all of this stuff, and I would have loved one of these. So maybe someone might find it useful. I hope you guys do. :) If there are any questions feel free to ask! (some of it can be insanely hard to understand)

Also, before you comment, take a look through the comments already there. You might have a question that is similar to another and is already answered.
________
Check out my other tutorials on this stuff down below!
: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:
 
: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
: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
:iconmishi-harley:
Mishi-Harley Featured By Owner Jan 26, 2014
How do you make it stop after 30 days? Like to end the game and pick someone to end with?:help: 
Reply
:iconlegiokat:
legioKat Featured By Owner Feb 15, 2014  Hobbyist General Artist
On your sleep button, have a function that says something like 
"if (day=30);
_root.gotoAndPlay("pick someone");
}

I don't know if you can copy and paste this function straight into flash,  but it's the right idea of what you should do. 
Reply
:iconinubasket:
inubasket Featured By Owner Feb 26, 2014  Hobbyist General Artist
I had to mess around a bunch with it but the code that eventually worked for me is adding the following code onto the end of your normal "sleep button" code:

if(day>=100)
_root.gotoAndPlay("picksomeone");
}

Then of course just change the "100" to whatever day you want the game to end, and the "picksomeone" to whatever you named your final frame.
Reply
:iconinubasket:
inubasket Featured By Owner Feb 26, 2014  Hobbyist General Artist
And a SUPER HUGE THANK YOU for this tutorial by the way! *hugs you 40 times*
Reply
:iconakumiheichou:
akumiheichou Featured By Owner Jan 11, 2014  Hobbyist
how do you keep the stats the same after you switch scenes??
Reply
:iconlegiokat:
legioKat Featured By Owner Jan 11, 2014  Hobbyist General Artist
They should stay the same. Remember, you only declare the variables on the first frame of the project. Or if you declare them on every slide, you are basically telling flash to reset the variables to that certain amount. 
Reply
:iconakumiheichou:
akumiheichou Featured By Owner Jan 11, 2014  Hobbyist
ok thanks!
Reply
:iconcaitlynisme:
caitlynisme Featured By Owner Jan 2, 2014  Hobbyist Writer
I'm so lost. :iconcryforeverplz: 
Reply
:iconlegiokat:
legioKat Featured By Owner Jan 4, 2014  Hobbyist General Artist
Feel free to ask questions here or check out some other tutorials or even shoot me a note if you like.
Reply
:iconcaitlynisme:
caitlynisme Featured By Owner Jan 4, 2014  Hobbyist Writer
The coding confused me so much I just gave up, :C
Reply
:iconlegiokat:
legioKat Featured By Owner Jan 4, 2014  Hobbyist General Artist
So is kirupa.com
Reply
:iconlegiokat:
legioKat Featured By Owner Jan 4, 2014  Hobbyist General Artist
Oh, well I'm sorry that's the case. YouTube is always pretty helpful and so are other deviants. If you're still interested, browse around and ask for help, the people here are extremely nice and would love to help you.
Reply
:iconcaitlynisme:
caitlynisme Featured By Owner Jan 4, 2014  Hobbyist Writer
Thank you for the resources. C:
Reply
:iconnyu-neon:
Nyu-Neon Featured By Owner Dec 29, 2013  Hobbyist General Artist
thanks for the tutorial. It's actually pretty easy to understand if you already messed around with programming, so variables comes naturally to me I guess. :)
Reply
:iconmfiling:
mfiling Featured By Owner Dec 29, 2013
i just want to say this tutorial is fucking amazing, youve made it so easy to understand, i cant thank you enough
Reply
:iconmfiling:
mfiling Featured By Owner Dec 29, 2013
sorry i made so many comments i couldnt figure out how to delete them
Reply
:iconmfiling:
mfiling Featured By Owner Dec 29, 2013
basically im asking how do i get my money, exp etc. to stay up to date throughout the game?
Reply
:iconmfiling:
mfiling Featured By Owner Dec 29, 2013
nevermind! i fixed it! yayy! the problem was that after the animation i was sending it back to the original screen, you need to create a new menu after the animation in the timeline, and remove that extra script that you put into the first screen that says hp = 50 etc..

thankyou!! your tutorial is really helpful! you have done somehting to help mankind!
Reply
:iconmfiling:
mfiling Featured By Owner Dec 29, 2013
hi ive got a question, your code for the hp, money, day thing is good and i got it working, but i want to put a little animation in when you press sleep/work etc.... so i added a "goto and play" script onto the end of the script for the variables you provided, but the problem is when it goes back to the main screen with the dynamic text boxes on it, they are all reset back to their original values, im assuming that has something to do with this code you put in the main frame
"stop()


var hp = 50;
var money = 0;
var day = 1;"

but without that, it doesnt work, right?
Reply
:iconnamikaze011:
Namikaze011 Featured By Owner Dec 9, 2013
hi sir can u please make a video cuz i cant follow it really hard for me im a beginner plz make a video thank you sir!
Reply
:iconlegiokat:
legioKat Featured By Owner Dec 19, 2013  Hobbyist General Artist
I'm sorry, I don't have a YouTube account or anything of that nature. :(
I got most of this information from other tutorials (some of them being YouTube tutorials) so I would browse YouTube and such for help. Sometimes re-phrasing is also key, so ask around fellow deviants. 
(and I'm a "m'am" ;))
Reply
:iconglubdubfish:
GlubdubFish Featured By Owner Nov 27, 2013
hello ^^ umm.. i wanna ask if you can help me ^^" again xD ^^" (sorry TT^TT) umm can you formulate a code for an ending of a charcter? for example, if ur exp qith boy 1 is only below250, then you'll have the friend ending, something like that ^^" cuz i have problems with it ^^" i tried this:
if(exp <=250){
gotoAndPlay("friendending")

but it has this warning= > Total ActionScript Errors: 1 Reported Errors: 1
 thanks in advance ^^
Reply
Add a Comment: