Page 1 of 1

random animation

PostPosted: Sat Sep 08, 2007 9:33 pm
by jagheera nex
in my stickman game thing im making it so when you kill an enimy, the enimy drops a random amount of money, like 3-7, and im using diffrent aniations and i need to know how to make a random animation when the actor is created and the game also needs reconize the aimation and add that much when the main player picks it up =)

Re: random animation

PostPosted: Sun Sep 09, 2007 7:43 pm
by Rux
Pretty Easy. 1st on the create actor event of the coins, in script editor,
Code: Select all
int n;
n = rand(//Here you put how many animations for the coins there are say there are 3 so this part would be 3\\)
if(n==0)//Change the animation event to one of your coin animations\\
if(n==1)//Change the animation event to one of your coin animations\\
if(n==2)//Change the animation event to one of your coin animations\\
ect.

Dont type anything in the // \\ Good Luck, I made a random tutorial if this isn't explaining much.
http://game-editor.com/forum/viewtopic.php?f=6&t=3815

Re: random animation

PostPosted: Mon Sep 10, 2007 2:05 pm
by jagheera nex
wow thanks means alot, lol im reaplying with my wii :D

Re: random animation

PostPosted: Tue Sep 11, 2007 1:16 am
by jagheera nex
now that i know how to make a random animation how do i make it so hen he picks up the coins it adds that many coins? 8)

Re: random animation

PostPosted: Tue Sep 11, 2007 2:14 am
by Rux
Make a Var called coinamount10(you'll have to make multiple vars for each amount)

Then on a coin actor (they all can't be clones so you'll have to make several different actors for the different coin amounts only one actor per coin amount)Player collision with a coin actor, (you'll have to do repete these steps for each coin actor)
Code: Select all
coinamount10 = coinamount10 + 10;
Keep on doing the different amounts until finished.

Then add a textNumber to count the coins with (Go to text in the actor control panel of your goldcount and type a random amount of zeros or just one)and on the draw actor event script editor,
Code: Select all
textNumber = coinamount10 + coinamount20 //or whatever the rest of your amounts are\\//(NOTE: It's easier to do this in one script instead of several scripts)\\


Hope this helps! :D :D :D :P

Re: random animation

PostPosted: Tue Sep 11, 2007 2:48 am
by jagheera nex
DUDE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ur a frecken genuis!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
man it works and its simpole omg thank you so much!!!!!!!!!!!!!!!!!!!!!!! :D :D :D :D :D :D :D :D :D :D :D :D :D :D

Re: random animation

PostPosted: Wed Sep 12, 2007 1:02 am
by Rux
I haven't even been working with GE for a year yet! About 9 months! This January it will be a year.
I can learn things pretty easily. (Not Bragging just an opinion)

Re: random animation

PostPosted: Wed Sep 12, 2007 3:00 am
by jagheera nex
lol wow