Gamestudio Links
Zorro Links
Newest Posts
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
Camera always moves upwards?
by NeoDumont. 11/14/25 16:32
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (AndrewAMD), 8,508 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
tritom, sheliepaley, Blueguy, blobplayintennis, someone2
19178 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Random animation #114781
03/02/07 23:17
03/02/07 23:17
Joined: Jul 2006
Posts: 28
B
burning_devil Offline OP
Newbie
burning_devil  Offline OP
Newbie
B

Joined: Jul 2006
Posts: 28
Does anyone know a way to program a code where i can play certain animations random when i press a key?

Re: Random animation [Re: burning_devil] #114782
03/03/07 00:17
03/03/07 00:17
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
Code:

// Has 3 animation cycles
define ASceneMax, 3;

string AScene[ASceneMax];
...
ACTION RandomAnim
{
AScene[0] = "Walk";
AScene[1] = "Run";
AScene[2] = "Stand";
// ...
while(1)
{
if (!my.skill10 & key_space)
{
my.skill11 = int(random(ASceneMax));
//
my.skill10 = min(my.skill10 + (my.skill1 * time), 100);
ent_animate(my, AScene[my.skill11], my.skill10, 0);
wait(1);
}
wait(1);
}
}



This should work, but I'm not sure if you can use arrays with strings. If not, then I've got another example for you...

Last edited by xXxGuitar511; 03/03/07 00:17.

xXxGuitar511
- Programmer

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1