Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,449 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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