hey bud, mind sharing the script that opens that door? on atov i have a level that a door is implied that thats the next level through it.. i wanted to after all enemies are defeated, to have the door open and have the level end after walking into it. i looked through the files but cant figure out which is the script.. if you can thank you
Hey
@AlexDC22 @hbdhl what I do is done by script.
In the Avegers project, I used a single entity for multiple effects in multiple levels, thinking that this would be more optimized, but later I realized that this is not a good idea, so when I need an animation or effect in a certain level, I create a specific entity for that level, which can be unloaded when the level ends.
In this case, the entity is "military_hq_gates", type panel one.
The important things here is the animationscript and the entities I load with it (since they aren't loaded on the stage anymore). And that I use multiple animations on the same entity
name militar_hq_gates
type panel
shadow 0
facing 1
subject_to_minz 0
subject_to_maxz 0
palette none
offscreenkill 2000
animationscript data/scripts/grabscript.c
load Living_Laser
load Vega
The main code is on the idle animation, which is the closed gate
I use a longer delay on the first frame to make sure that the normal enemies have already appeared on the level (in this case, the Sentinels).
@cmd reinforcementCheck 2 "ANI_FOLLOW3"
This code uses a function to detect if there are less than 2 enemies on the screen (the M.Bison that is standing still on the screen is an enemy) and, if true, tells the gate to switch to the FOLLOW3 animation.
This is my FOLLOW3 animation, but nothing here will be useful for your case, other than that you would need to spawn an "endlevel" type entity to finish the level. In my case, I spawn the "Living Laser" enemy and turn it into a boss using a script.
anim follow3
loop 0
delay 60
offset 1 151
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
delay 4
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
offset 1 152
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
offset 1 151
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
offset 1 152
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
offset 1 151
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
offset 1 152
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
offset 1 151
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
offset 1 152
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
delay 300
@cmd spawnAni "Living_Laser" 174 0 -2 "ANI_FOLLOW10" 0 0 0
@cmd dasher 0 0.5 0
@cmd makeBoss "Living_Laser" 1
@cmd playmusic "data/music/boss_batman_joker_21.ogg" 1
sound data/sounds/door_open.wav
frame data/levels/2-militarhq/MilitarHq_Boss_gate.gif
@cmd suicide
frame data/chars/misc/empty.gif
In your case, you will need to either have an invisible enemy (or one that cannot be hit) for this to work. Or turn the gate into an enemy. Or even change the level type so that it does not end when you kill all the enemies.
This is the function I use:
C-like:
void reinforcementCheck (int Enemies, int Ani)
{
// Check how much enemies are on the screen and if it less than the desired, change caller animation
// Bloodbane/Douglas Baldan - 28/09/2016
void self = getlocalvar("self");
int Enemy = openborvariant("count_enemies");
if(Enemy < Enemies){
if (self!=NULL()){
performattack(self, openborconstant(Ani));
}
}
}