maxman
Well-known member
I thought using aniECount was going to be easy until I started trying it. What I'm having trouble with is the setup within enemy groups in levels.
For enemy2, I'm trying to make 2 of them to act after defeating one enemy. But I only could have one of them start one by one after one enemy is defeated. Even what's worse after it's defeated, they can't act to fight at all, leaving them only to idle. That depends on the number of enemies aniECount is used, I guess.
Here's a couple of examples from SOR2X which I'm trying to get one stage to work:
How does this setup of aniECount work, knowing that BasicX1 is a none type that spawns a pair of 2 enemies using (random?) script?
Code:
group 100 100
at 900
#1ST PHASE: ONE ENEMY SHOULD GO FIRST BEFORE THE TWO FOLLOWING ENEMIES AND THE BOSS
spawn enemy1
coords 756 190
at 900
# 2ND PHASE: TWO FOLLOWING ENEMIES ACT BEFORE THE BOSS
spawn enemy2
@script
void main(){
changeentityproperty(getlocalvar("self"), "animation", openborconstant("ANI_FOLLOW10"));
}
@end_script
flip 1
coords 160 171
at 900
spawn enemy2 #same enemy as enemy2
@script
void main(){
changeentityproperty(getlocalvar("self"), "animation", openborconstant("ANI_FOLLOW10"));
}
@end_script
coords 210 171
at 900
#3RD PHASE: BOSS STARTS TO ACT AFTER ALL THREE ENEMIES ARE DEFEATED BUT REMAINING ENEMIES FIGHT ALONG WITH BOSS
spawn boss
coords 185 171
at 900
# SPAWN REMAINING ENEMIES IN THIS LIST RIGHT AFTER BOSS STARTS TO FIGHT
spawn enemy3
coords 500 200
at 900
spawn enemy3
coords -10 210
at 900
spawn enemy4
coords -15 187
at 900
For enemy2, I'm trying to make 2 of them to act after defeating one enemy. But I only could have one of them start one by one after one enemy is defeated. Even what's worse after it's defeated, they can't act to fight at all, leaving them only to idle. That depends on the number of enemies aniECount is used, I guess.
Code:
anim follow10 #First entry
offset 80 144
delay 20
@cmd frozen 1
@cmd aniChange 0 "ANI_FOLLOW11"
frame ...
anim follow11 #Wait
loop 1
offset 80 144
delay 20
@cmd aniEcount 0 "ANI_FOLLOW12" 1
frame ...
frame ...
frame ...
anim follow12 #Get ready!
offset 80 144
delay 20
@cmd frozen 0
frame ...
frame ...
frame ...
C:
void aniEcount(int type, void ani, int count)
{//Animation changer with ENEMY count (ELEVATORS)
//Type 0: Less than "count"
//Type 1: More than "count"
void self = getlocalvar("self");
int eCount = openborvariant("count_enemies");
if(type == 0){
if(eCount <= count){
changeentityproperty(self, "animation", openborconstant(ani));
}
}
if(type == 1){
if(eCount >= count){
changeentityproperty(self, "animation", openborconstant(ani));
}
}
}
Here's a couple of examples from SOR2X which I'm trying to get one stage to work:
Code:
spawn Fog_Wait2 1
map 1
flip 1
coords 120 215 0
at 0
spawn Fog_Wait2 1
map 1
flip 1
coords 200 215 0
at 0
spawn Fog_Sit 1
map 1
flip 1
coords 300 215 0
at 0
spawn Fog_Wait3 1
map 2
weapon Pipe 1
flip 0
coords 400 215 0
at 0
spawn Hakuyo_Wait 1
map 0
flip 0
coords 350 240 0
at 0
group 5 5
at 0
spawn HakuyoB 1
map 1
flip 0
coords 400 240 300
at 0
spawn HakuyoX 1
map 1
flip 0
coords 400 240 300
at 0
Code:
group 2 2
at 2
spawn AbadedeB 1
map 1
flip 1
coords 240 250 400
at 2
#########################################################################################
group 1000 1000
at 3
spawn Shiva_Wait 1
map 0
flip 0
coords 1 1000 0
at 3
spawn Mrx_Wait 1
map 0
flip 0
boss 1
coords 1 1000 0
at 3
wait
at 3
#########################################################################################
group 1000 1000
at 4
spawn HarakiriB 1
map 1
flip 0
coords -100 240 0
at 4
spawn BasicX1 1
map 4
flip 0
coords 600 240 0
at 4
spawn BasicX1 1
map 4
flip 1
coords 650 240 0
at 4
spawn BasicX1 1
map 4
flip 0
coords 700 270 0
at 4
spawn BasicX1 1
map 4
flip 1
coords 750 270 0
at 4
wait
at 4
#########################################################################################
group 5 5
at 5
spawn BasicX1 1
map 4
flip 0
coords 600 240 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -100 240 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 700 270 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -200 270 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 600 240 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -100 240 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 700 270 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -200 270 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 600 240 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -100 240 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 700 270 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -200 270 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 600 240 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -100 240 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 700 270 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -200 270 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 600 240 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -100 240 0
at 5
spawn BasicX1 1
map 4
flip 0
coords 700 270 0
at 5
spawn BasicX1 1
map 4
flip 1
coords -200 270 0
at 5
How does this setup of aniECount work, knowing that BasicX1 is a none type that spawns a pair of 2 enemies using (random?) script?
Last edited: