help needed for random image !!

Non-platform specific questions.

help needed for random image !!

Postby naddie » Fri Dec 28, 2007 8:21 pm

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 !!!
Attachments
ea.zip
test draw !!
(5.72 KiB) Downloaded 93 times
User avatar
naddie
 
Posts: 6
Joined: Fri Dec 28, 2007 5:07 pm
Score: 0 Give a positive score

Re: help needed for random image !!

Postby MrScience101 » Fri Dec 28, 2007 9:05 pm

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?
User avatar
MrScience101
 
Posts: 115
Joined: Tue Mar 20, 2007 9:52 pm
Score: 13 Give a positive score

Re: help needed for random image !!

Postby naddie » Fri Dec 28, 2007 9:34 pm

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 :(
User avatar
naddie
 
Posts: 6
Joined: Fri Dec 28, 2007 5:07 pm
Score: 0 Give a positive score

Re: help needed for random image !!

Postby Bee-Ant » Sat Dec 29, 2007 2:29 am

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
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: help needed for random image !!

Postby naddie » Sat Dec 29, 2007 12:10 pm

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 :(
User avatar
naddie
 
Posts: 6
Joined: Fri Dec 28, 2007 5:07 pm
Score: 0 Give a positive score

Re: help needed for random image !!

Postby Kalladdolf » Sat Dec 29, 2007 8:29 pm

you forgot those { } !
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: help needed for random image !!

Postby naddie » Sat Dec 29, 2007 9:36 pm

yep i tried with the brackets but still dont work :( i think i'm missing something !
User avatar
naddie
 
Posts: 6
Joined: Fri Dec 28, 2007 5:07 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron