I wanted to add some variations to enemies ingame, i dont like they way they all fall in groups and fly the same path then rise in the same time, i would like to add some randomness, i gave enemies running animation and its working kinda ok, not what i wanted but fine.
Is property "risetime" controlled by script ? I would like to make it random lets say from 10 to 1000 after each fall so every enemy would have random risetime and would rise sooner or later than others.
Also is there some quick way to control enemies walking speed and keep it random at all times so enemies walk faster/slower whenever they want ? Now running is activated only when enemies are far.
Or do i have to give enemies risetime 1000 and then use script in their rise animation to adjust how long they wait until rise from the floor?
---
OK so far i have this in rise animation and it adds a lot IMO to overall feel, game feels more "real" and not so automatic and robotic cause each character gets up a bit sooner/later
Also my risetime is 1000 cause more = faster
Is property "risetime" controlled by script ? I would like to make it random lets say from 10 to 1000 after each fall so every enemy would have random risetime and would rise sooner or later than others.
Also is there some quick way to control enemies walking speed and keep it random at all times so enemies walk faster/slower whenever they want ? Now running is activated only when enemies are far.
Or do i have to give enemies risetime 1000 and then use script in their rise animation to adjust how long they wait until rise from the floor?
---
OK so far i have this in rise animation and it adds a lot IMO to overall feel, game feels more "real" and not so automatic and robotic cause each character gets up a bit sooner/later
Code:
anim rise
loop 0
offset 164 196
bbox 0 0 0 0 0
delay 25
@script
void self = getlocalvar("self");
if( frame == 0){
int r = rand()%30;
if( r > 11){
changeentityproperty(self, "animpos", 1);
} else if( r < -10){
changeentityproperty(self, "animpos", 2);
} else if( r < 0){
changeentityproperty(self, "animpos", 0);
} else if( r > 0){
changeentityproperty(self, "animpos", 3);
}
}
@end_script
frame data/chars/zboj/fall6.gif
frame data/chars/zboj/fall6.gif
frame data/chars/zboj/fall6.gif
frame data/chars/zboj/fall6.gif
offset 164 200
delay 8
frame data/chars/zboj/rise1.gif