HOME | DD

legioKat — Flash Sim Dating Tutorial (HP, Days, etc)

Published: 2012-08-02 22:37:20 +0000 UTC; Views: 41887; Favourites: 690; Downloads: 642
Redirect to original
Description 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!
Make a health bar/love meter/etc!!
legiokat.deviantart.com/art/He…

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


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

Here is my tutorial involving Inventory, Gift-giving, and a little bit on shops!
legiokat.deviantart.com/art/In…
Related content
Comments: 331

SteelNightHeaven In reply to ??? [2012-08-19 04:18:02 +0000 UTC]

OHMYGAWD IT WORKS!!!!!!!!! I LOVE YOU!

👍: 0 ⏩: 1

legioKat In reply to SteelNightHeaven [2012-08-19 19:10:49 +0000 UTC]

Cool! What was wrong?

👍: 0 ⏩: 1

SteelNightHeaven In reply to legioKat [2012-09-21 01:12:30 +0000 UTC]

my variables were named differently and I didnt remember dat :l lol

👍: 0 ⏩: 0

Lyniex3 In reply to ??? [2012-08-15 04:45:29 +0000 UTC]

on(release){

if (Ray == 0) {
hp -= 10;
gotoAndPlay("talk1");

}else if(hp < 9) {
_root.gotoAndPlay("hpbro");
}
}

how do i keep the hp from going into negative numbers?

👍: 0 ⏩: 1

legioKat In reply to Lyniex3 [2012-08-15 14:06:31 +0000 UTC]

what goes wrong? how does it go into negative numbers? make it hp<10, not that it might make a difference, but try it and tell me what happens.

👍: 0 ⏩: 2

Lyniex3 In reply to legioKat [2012-08-15 16:30:39 +0000 UTC]

Okay,i fixed it a bit my actionscript

on(release){

if (Ray == 0) {
hp -= 10;
gotoAndPlay("talk1");

}if(hp<10) {
gotoAndPlay("no hp");
}
}

Now it will go to the frame no hp if you don't have enough, but it -10 hp still :I

👍: 0 ⏩: 1

legioKat In reply to Lyniex3 [2012-08-15 16:50:01 +0000 UTC]

you left out the }else

👍: 0 ⏩: 1

legioKat In reply to legioKat [2012-08-15 16:55:04 +0000 UTC]

but other than that, i don't know what to tell you. Because my actionscript on one of my sims has the exact coding (different names) and it works.

👍: 0 ⏩: 1

Lyniex3 In reply to legioKat [2012-08-15 17:23:07 +0000 UTC]

I solved it

👍: 0 ⏩: 1

legioKat In reply to Lyniex3 [2012-08-15 20:10:19 +0000 UTC]

YAY! what was the problem?

👍: 0 ⏩: 1

Lyniex3 In reply to legioKat [2012-08-15 20:47:54 +0000 UTC]

all i did was try puttinghp on top and exp down and it worked

👍: 0 ⏩: 0

Lyniex3 In reply to legioKat [2012-08-15 15:12:54 +0000 UTC]

okay so it does go to talk1, but when it gets to 0 Hp or 5 hp it should go to hbro, but instead it just subtracts 10 hp (negative -5, -10) and goes to talk1 again

👍: 0 ⏩: 1

legioKat In reply to Lyniex3 [2012-08-30 22:42:01 +0000 UTC]

make sure your code has this in it

if (hp < 10){
_root.gotoAndPlay("blablablabla");
}

👍: 0 ⏩: 0

SpecialStars [2012-08-13 17:30:41 +0000 UTC]

I have a question, For the give button i put this on one of the items to give

on (release) {
_root.gotoAndPlay("br1")
yum -= 1;
hp -= 10;
exp += 0;
}

how do i keep it from going to negative numbers (hp) & (candy)

👍: 0 ⏩: 1

legioKat In reply to SpecialStars [2012-08-13 18:50:26 +0000 UTC]

on(release){ \\when i click this button
if (hp >= ??){ \\ if hp is greater than or equal to ?pick a number?
_root.gotoAndPlay("thankyou"); \\ go to this frame
yum -=1; \\ minus 1 yum
hp -= 10; \\minus 10 hp
exp += 0; \\you don't need to say +0 if you don't add anything
}else if(hp < ??) { \\ but if hp is less than ?pick a number?
_root.gotoAndPlay("not enough hp") \\ then play this frame
}
}

OR if you don't want to make a not enough hp frame... take away the last line that says _root.goto.... and replace it with this.enabled = false

👍: 0 ⏩: 1

SpecialStars In reply to legioKat [2012-08-14 18:31:33 +0000 UTC]

ic...
what about talk button, how do i make it not play the same dialog over and over again, instead i want it to do 1st dialog if u get good response, move onto the next diaglog, but if bad response stay on the same dialog?

seems kinda confusing sorry xD

👍: 0 ⏩: 1

legioKat In reply to SpecialStars [2012-08-14 19:04:53 +0000 UTC]

on(release){ \\when i click this button

if (exp == 0) { \\if the exp with this person is at 0
hp -= 10; \\ take away 10 hp
gotoAndPlay("hi"); \\and play this frame
}else if(hp<10) { \\ or if hp is less than 10
this.enabled = false; \\make this button unclickable
}else if(exp == 10) { \\ or if exp is 10
hp -= 10; \\ take away 10 hp
gotoAndPlay("hi 2"); \\and play this frame
}else if(hp<10) { \\but if hp is less than 10
this.enabled = false; \\make this button unclickable

***it's explained in the tutorial under the dialogue section*** If you still don't get it, just keep asking

👍: 0 ⏩: 1

SpecialStars In reply to legioKat [2012-08-14 20:07:04 +0000 UTC]

So this will be all on the same talk button?

if (Devin exp == 0) {
hp -= 10;
Devin exp += 20;
gotoAndPlay("talk1");
}else if(hp<10) {
gotoAndPlay("no hp left");
}else if(Devin exp == 10) {
hp -= 10;
Devin exp += 20;
gotoAndPlay("talk2");
}else if(hp<10) {
gotoAndPlay("no hp left");

and so do i continue the same coding e.g ( exp == 20, exp == 30)?

👍: 0 ⏩: 1

legioKat In reply to SpecialStars [2012-08-14 20:26:09 +0000 UTC]

take away the part that says devin exp +=20. In each dialogue, where it has the choices for you to choose from, you put +20 exp on the good choice. but other than that, yes

👍: 0 ⏩: 1

SpecialStars In reply to legioKat [2012-08-14 22:20:40 +0000 UTC]

I'm sorry to trouble you xC
Just really new to virables

so i did what you told me to do but theres an error. the virable is called Devin, but when i put (Devin == 0) {
it has 3 errors

**Error** Scene=Scene 1, layer=Text, frame=37:Line 9: Statement block must be terminated by '}'
}else if(hp<10) {

**Error** Scene=Scene 1, layer=Text, frame=37:Line 10: Syntax error.
gotoAndPlay("no hp left");

**Error** Scene=Scene 1, layer=Text, frame=37:Line 1: Statement must appear within on handler
if (Ray == 0) {

Total ActionScript Errors: 3 Reported Errors: 3

but if i put ( Devin exp == 0) { it says

**Error** Scene=Scene 1, layer=Text, frame=37:Line 1: ')' expected
if (Ray exp == 0) {

Total ActionScript Errors: 1 Reported Errors: 1

👍: 0 ⏩: 1

legioKat In reply to SpecialStars [2012-08-14 23:06:18 +0000 UTC]

I need to see your actionscripts...

👍: 0 ⏩: 2

legioKat In reply to legioKat [2012-08-15 02:23:26 +0000 UTC]

is ur exp for this character named

"Devin" or
"Devin exp"


ok, make the frames for this actionscript and end it properly, with two
} after the last thing and see what happens.

👍: 0 ⏩: 1

SpecialStars In reply to legioKat [2012-08-15 02:55:56 +0000 UTC]

Exp is called devin, should i change it?

👍: 0 ⏩: 1

legioKat In reply to SpecialStars [2012-08-15 03:04:58 +0000 UTC]

It needs to be the same each time.

👍: 0 ⏩: 0

SpecialStars In reply to legioKat [2012-08-15 01:58:03 +0000 UTC]

This is the actionscript

if (Devin == 0) {
hp -= 10;
gotoAndPlay("talk1");
}else if(hp<10) {
gotoAndPlay("no hp left");
}else if(Devin == 10) {
hp -= 10;
gotoAndPlay("talk2");
}else if(hp<10) {
gotoAndPlay("no hp left");

👍: 0 ⏩: 0

iCerveny In reply to ??? [2012-08-12 19:37:07 +0000 UTC]

argh. it worked alright... at first. When ever I go to talk to the guy and go back to map the day will be 1 again... what to do?

👍: 0 ⏩: 1

legioKat In reply to iCerveny [2012-08-13 00:38:00 +0000 UTC]

make sure you declared you variables not on any actual part of the game that involves interaction. Id say make a title frame and declare all of you variables there. Because where ever you declare them, it's going to reset the variables to whatever you had whenever you go to that frame. If necessary you can make like a blank slide in the beginning without a stop() code.

I hope this is what you meant

👍: 0 ⏩: 0

iCerveny In reply to ??? [2012-08-12 19:12:45 +0000 UTC]

I have no idea what I did... but it worked! Thanks so much! But how do I make "dates" (minium exp 300)? and how to make my day stop at 30? I'd be really happy if you'd answer

👍: 0 ⏩: 1

legioKat In reply to iCerveny [2012-08-13 00:36:11 +0000 UTC]

on(release){ \\ when I click this button
if(exp >= 300){ \\if exp is greater than or equal to 300
_root.gotoAndPlay("whateverthedateframeisnamed"); \\go to this frame
}else if(exp < 300){ \\but if exp is less than 300
_root.gotoAndPlay("notenoughexpframe")\\ go to this frame
}
}


*i just made up frame names. the first one is like what you would see if you had enough exp; the second is like a "sorry, i don't know you well enough" frame.

hope this helps

👍: 0 ⏩: 1

iCerveny In reply to legioKat [2012-08-19 00:54:44 +0000 UTC]

okay thank you I'll try

👍: 0 ⏩: 0

Lyniex3 In reply to ??? [2012-08-12 12:52:53 +0000 UTC]

okay i made a sleep button, how do you make the day stop at 30

👍: 0 ⏩: 1

legioKat In reply to Lyniex3 [2012-08-12 18:10:45 +0000 UTC]

on(release){ \\when you click this button
if(day >= 1){ \\ if the day is greater than or equal to 1
day += 1; \\ then add one day
}else if(day>=30){ \\ but if the day is greater than or equal to 30
this.enabled = false; \\ make this button un-clickable
}
}

👍: 0 ⏩: 2

RaynbowzRule In reply to legioKat [2012-08-25 19:44:40 +0000 UTC]

aw man, I was close, I was trying to make the code by myself, but the 'else' kept messing up~

👍: 0 ⏩: 1

legioKat In reply to RaynbowzRule [2012-08-30 22:42:30 +0000 UTC]

do you still need help?

👍: 0 ⏩: 1

RaynbowzRule In reply to legioKat [2012-09-01 16:15:59 +0000 UTC]

nope, everything is running smoothly (most of the time)

👍: 0 ⏩: 1

legioKat In reply to RaynbowzRule [2012-09-02 14:57:51 +0000 UTC]

yay! When do u think it will be done?

👍: 0 ⏩: 1

RaynbowzRule In reply to legioKat [2012-09-02 15:10:08 +0000 UTC]

hmmmmm, maybe in about 2-4 weeks give or take

👍: 0 ⏩: 1

legioKat In reply to RaynbowzRule [2012-09-02 16:10:32 +0000 UTC]

Super excited XD

👍: 0 ⏩: 1

RaynbowzRule In reply to legioKat [2012-09-02 16:33:51 +0000 UTC]

ok, i ran into another problem ( i tried to figure it by myself, but that wasnt working)
i placed my dynamic boxes inside my menu mc and declared my variables on my main timeline.....
my vars wont appear in the dynamic boxes....
why is this?
I tried _root.exp and var exp = 0;
myMovieClip.myField.text = exp;

👍: 0 ⏩: 1

legioKat In reply to RaynbowzRule [2012-09-02 17:27:01 +0000 UTC]

on the very first frame of your game, you say...

var whateveritis = 0;
var whateveritis = 0;
bla bla bla...

then you go into your menu and make a dynamic text box. the var name has to be whatever you named it in the first frame of your movie.

So...

first frame : var exp = 0;

menu frame: (make a dynamic text box)---> instance name = whatever you want var name: exp

👍: 0 ⏩: 1

RaynbowzRule In reply to legioKat [2012-09-02 18:33:24 +0000 UTC]

OH!! So I would put my var in the instance name?

👍: 0 ⏩: 1

legioKat In reply to RaynbowzRule [2012-09-02 19:16:07 +0000 UTC]

no, the var for your textbox has to be the same as the var you had in the first frame where you declared it. your instance name has to be different i think.

👍: 0 ⏩: 1

RaynbowzRule In reply to legioKat [2012-09-02 19:33:42 +0000 UTC]

So for example I would do this:
On my very first frame ----> var exp = 0;
On my menu movie clip -----> dynamic box ----> var ----> exp
|
V
Instance name ----> love
I would do that?

👍: 0 ⏩: 1

legioKat In reply to RaynbowzRule [2012-09-02 22:33:15 +0000 UTC]

yes!

👍: 0 ⏩: 1

RaynbowzRule In reply to legioKat [2012-09-02 22:45:28 +0000 UTC]

i cant do that
the var appears on the main frame x_X

👍: 0 ⏩: 1

legioKat In reply to RaynbowzRule [2012-09-03 14:02:41 +0000 UTC]

The var exp goes like this:

var exp = 0;

This goes with ur hp one and day one.

Now. Make a dynamic text box and give the instance name "energy" and in the var box, type "exp". Make sure you are using a visible text color and make sure something isn't covering it. If u still are having trouble go to ~fishisfriendz dating som tutorial. It has a good section on variables.

👍: 0 ⏩: 1

RaynbowzRule In reply to legioKat [2012-09-03 15:39:53 +0000 UTC]

thanks

👍: 0 ⏩: 0

Lyniex3 In reply to legioKat [2012-08-12 18:43:45 +0000 UTC]

thx it works ;D

one last question, srry kinda new at virables D: so i made a map, and you can go in and out, i made a house where the sleep button lies. it works perfectly fine, but when you go back to main map, than go back to house it resets days,money,hp?

👍: 0 ⏩: 1

legioKat In reply to Lyniex3 [2012-08-13 00:31:09 +0000 UTC]

make sure that you declare ALL your variables on the VERY first frame. So maybe make a title slide if you want. Because wherever you declare them, it is going to reset them to what you declared them as. And only declare them once on that very first slide.

👍: 0 ⏩: 1

Lyniex3 In reply to legioKat [2012-08-13 01:38:12 +0000 UTC]

Your a life saver, Thanks for the help! i can finally continue on to my game

👍: 0 ⏩: 1


<= Prev | | Next =>