The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.36 / 5.00 33,851 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 12,195 Viewshello everyone, I was wondering about buttons and AS... I want to make my flash a bit more interactive, so I want people to choose what the character does.
to be more precise, I want them to choose if the character will cast a fireball, a lightning bolt or other spells of the kind.
My question is not how to make buttons, or how to make the animation, but how do I make it so that, by clicking on the "Fireball" button, the character would cast that one, and not any other, but still have them as a possible choice and animation?
what I think is that it has to do with actionscript (obviously) as well as the timeline. Like, I make up the stage and buttons, and add a "stop();" command on that frame. then after that I make the spells' animations, one right after the other, and make the buttons go to the 1st frame of the spell's animation.
Then, since I want the enemy, say a wolf, attack the character, I would make all animations end with something like a "gotoandplay" to the 1st frame of the wolf's attack. And then, since the wolf is not dead, I would have to copy/paste the stage with buttons and animations right after the wolf's attack animation, right?
I'm just asking 'cuz I'm not too sure, and I'm wonderring if there isn't an easier way using AS.
Note: I am a TOTAL noob with ActionScript, I only know 2 commands: "stop();" and "on(release){gotoAndPlay("Scene #", ##)}" Other than that, I'm totally lost and confused. I really need to learn how to use AS properly...
Thanks in advance for whatever help you can offer.
You are less than an AS noob.
Surely you could make a system to make it easier to handle these animations, but the way you described is the most basic and isn't nearly that complicated.
after what I can understand.. you know what you need to know..
I don't get what your asking..
Yes, that's right.
Why didn't you try it in the first place?
Welll... I have a questions plox. Are you making an interactive MOVIE, or and interactive GAME?
There... don't seem to be MANY ways to do this, but, you could hold all things for one thing in a movieclip, or, many movieclips, and use less frames, to 1 frame in the timeline, and only use AS to change the frame in the movieclip whenever you need to.
You can organize it... to where... you only get one decision, and that effects the overall integrity, and direction of the movie... like...
Set-up: At the beginning of the movie, set some variables like, a0,a1,a2,a3,a4,a5. All false
Waypoint: When you come to a part in the movie, you have 5 options. Attack 1-5. When you select 1, that variable becomes true. On the frame after the decision frame, check which of the 5 are true, and then go to the corressponding frame, and start playing. If they didn't choose the option closest to the end, then, at the last needed frame of that section, make it go to the frame you need to.
That's another way.
Otherwise, set it up so that you have one complete way on one scene, and the other ways on different scenes, and if they choose a different direction then the current scene plays out, send them to that scene, on the right frame.
Variables: a0 = False
//Sets up a0 to be false.
if (a0 == False){
actions
}
//Checks if a0 is False, and if it is, perform actions
I don't see many better ways of doing it. :D
There's bound to be an error somewhere. lemme know. if. there. like. is.
Coulden't be bothered explainin and I was bord so I made you a small example =)download (right click save as)
lol dude, I said I'm an AS noob, not internet noob, I know how to download stuff...
anyways...
that poster talking about the variables, that totally confused me as I HAVE NO IDEA HOW TO USE THEM!
also, in the beginning it's just a movie with interraction (only text boxes and buttons to go to the next one) but at some point, where my character learns more than 1 spell, I want people to choose which spell the character will use, so in the end, I'll want some kind of menu to choose the spells, and an HP/MP bar as well (and I'll need help with this too, so if any of you cares to give some tips, gimme gimme gimme! lol)
At 1/22/07 04:30 PM, noob-toast wrote: Welll... I have a questions plox. Are you making an interactive MOVIE, or and interactive GAME?
I bet his making a non interactive GAME!
;)
'twould be nice to know what the AS means instead of just copy/pasting it... that way I could learn about it and eventually stop asking help and figure things out myself (which I would prefer)
I checked your example, and that's pretty much what I was describing, no?
the reason why I was asking that is because I didn't only want to know if it would work, but
also wanted to know if there was a better/easier/simpler way to do this.
on(press){
// when you press the button
_root.fireball.gotoAndPlay(2);
//the fireball MC goes to frame 2 and plays from there!
}
//ends code
ok?
was just makin sure cos freewebs sucks. :)
on(press){
// when you press the button
yea, I understand that one...
_root.fireball.gotoAndPlay(2);
//the fireball MC goes to frame 2 and plays from there!
if I get it right... the MC is a MC of the fireball being thrown at the enemy, which plays on frame 2. Since I have a MC of the fireball just burning like a flame, I would need to put THAT MC in a NEW MC which would make the fireball move on the stage, in only 1 frame instead of, say, 15.
then in the "new" MC, I would put a "stop();" at the end of it so it doesn't loop over and over. On frame 3 I would have a "gotoAndPlay" the frame on which the wolf would start its attack.
but I would still need the button, by saying "it has to be a MC" do you just mean I should make a MC and then put it into a button symbol? I already did that with the text boxes' buttons, and they seemed to be doing fine...
}
//ends code
now this, I understand too, but the thing I don't understand is why do you put it on different lines? If it's just a "on(release/press){gotoAndPlay/Stop("label name")} then you don't need to put it on different lines. It's just to make things clearer and easier to read, right?
At 1/22/07 05:52 PM, AMOE1st wrote: _root.fireball.gotoAndPlay(2);
//the fireball MC goes to frame 2 and plays from there!
but I would still need the button, by saying "it has to be a MC" do you just mean I should make a MC and then put it into a button symbol? I already did that with the text boxes' buttons, and they seemed to be doing fine...
you can put that code on a MC to and it should work.. you don't need a button.. buttons are just easier to work with when it comes to button effects.. rollover effects and so on.. as far as I know
}
//ends code
now this, I understand too, but the thing I don't understand is why do you put it on different lines? If it's just a "on(release/press){gotoAndPlay/Stop("label name")} then you don't need to put it on different lines. It's just to make things clearer and easier to read, right?
yeah.. but when you make games you can end up with 20 to 200 lines.. or more.. try putting that in line and change something in there!
;)
Alright let's see...
what if I want to have a menu of 6 different choices, the "player/viewer" chooses choice 1, and it leads to a few events, but then he returns to the 6 choices. What do I have to use to make it so he can still choose that choice, but it would lead to a different event instead?
Like, he would end up facing a 6-way hall in a dungeon, and have the choice to go any direction, but going to the east (choice 1) would lead him to a dead end, so he comes back, and has to choose again, but would want him to say "I went there, it's a dead end" when he attempts to go east (to select choice 1) again. How would I do it?
I suppose it would have something to do with variables, but that confuses me even more than simple coding. Any help is greatl appreciated.
you see, I would want 4 of the branches to lead to a dead end, 1 be the path you come out of and the last 1 be the path to take to continue. Thing is, I want my events to KNOW that the person went in the wrong corridors and instead of replaying the events that leads to the dead-end, I just want a text to appear saying that you already went there.
maybe a little confusing, but there's GOT to be a way of doing this with variables, I just don't know how to work them...