Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by AndrewAMD. 12/05/23 10:56
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (AndrewAMD, alibaba, fairtrader, ozgur, TipmyPip, Quad), 622 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | chip programmers | 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