Page 1 of 1

help needed for random image !!

PostPosted: Fri Dec 28, 2007 8:21 pm
by naddie
Hi everybody!
I'm new to this forum and trying to learn through some scripts posted here ! very useful to progress :D
I get blocked on how to change the draw cursor of the 'rand demo' ! I added the key x to random the icon but it's keeping the first icons on draw :x
Can someone help me? which modification should i do so it can swap the icons and keep it on draw?
thanks !!!

Re: help needed for random image !!

PostPosted: Fri Dec 28, 2007 9:05 pm
by MrScience101
Finally, somebody who actually posts their code. Nice little program, I like it. I am trying to understand what you want to do with it. What are you trying to do?

Re: help needed for random image !!

PostPosted: Fri Dec 28, 2007 9:34 pm
by naddie
Hi, well it's not my code actually :) It's from Hedfone
http://game-editor.com/forum/viewtopic. ... rds#p14352

:wink:

If you push the 'x' key you should see another form (pink one) appearing ! my problem is that the pink icon didn't stay on the pointer and bring me back to the round/square/triangle ones :x and i'd like the pointer change through the 'x' key !
I tried to edit it with some scripts i found around but didn't seem to work well :(

Re: help needed for random image !!

PostPosted: Sat Dec 29, 2007 2:29 am
by Bee-Ant
To make random animation, you could use this code in draw actor of that actor.
Code: Select all
ChangeAnimationDirection("EventActor",STOPPED);
animpos=rand(10);

That 10 means if you have 10 animation frames (0,1,2,3,4,5,6,7,8,9)
if you just have 3 animation frame (0,1,2) just change that 10 to 3

Re: help needed for random image !!

PostPosted: Sat Dec 29, 2007 12:10 pm
by naddie
in the 'key down event' i pushed this script
int i;
i = round (rand(1));
if (i==0) ChangeAnimation("Event Actor", "zigzag", FORWARD);
if (i==1) ChangeAnimation("Event Actor", "zigzag", FORWARD);
if (i==2) ChangeAnimation("Event Actor", "zigzag", FORWARD);
fact is it changes the actors but not the draw actor ! why does it no keep the new actor?

Bee-Ant, I tried to push your script in the drawactor 'Bird' but it doesnt affect anything :(

Re: help needed for random image !!

PostPosted: Sat Dec 29, 2007 8:29 pm
by Kalladdolf
you forgot those { } !

Re: help needed for random image !!

PostPosted: Sat Dec 29, 2007 9:36 pm
by naddie
yep i tried with the brackets but still dont work :( i think i'm missing something !