disable anim victory for chase stages

oldyz

Well-known member
another recent problem, in the running/chase levels, if you kill the boss the victory animation plays even tho the running models does not even have it, how can i disable it for the running levels without affecting the "boss" flag
 
You'll need to use a branch system to check in which stage you want to disable victory

put this inside the model which has anim victory

Code:
anim victory
@script
    if(frame == 0){
    void self = getlocalvar("self");
    char branch = openborvariant("current_branch");

    if(branch=="friedchicken"){
    void self = getlocalvar("self");
    setidle(self);
    }
  }
@end_script
	offset	90 144
	bbox	0 0 0 0
	delay 5
	frame	data/chars/hong/l.png
	frame	data/chars/hong/sh1.png
	frame	data/chars/hong/sh2.png
	frame	data/chars/hong/sh3.png

This checks levels.txt to see which level you are in so if your character is in

Code:
branch friedchicken
z 157 240 240
file	data/levels/lv3b.txt

 
thank you danno
Bloodbane

the script solution dos not work on running stages, but modelflag 7 did the trick.

The manual does not mention modelflag 7

i only see this :

modelflag {int}

    Determines how weapon model copies animation and weaponlist from original model.
        0 = Animation and weaponlist are copied
        1 = Animation aren't copied but weaponlist are still copied
        3 = Animation and weaponlost aren't copied
    Use this with weapon models of course.

what do 4, 5 & 6 do?
 
It's not been updated in the manual yet but modelflag 4 is scripts are not copied, modelflag values can be combined so

model flag 3 = animation and weaponlost are not copied
model flag 4 = scripts are not copied

3 + 4 = modelflag 7

reason I didn't suggest using modelflag is because elements of script in nightslashers are borrowed from previous models but I can't remember which as the version i'm working on is different to yours, if you do run into any shut downs during running stage you might want to copy scripts over from previous models, strange how the branch script didn't work, I'm guessing our modelflag set ups must be different too.

 
The manual does not mention modelflag 7
Because it uses bitwise logic, as many functions in openbor (like bindentity).
But yes, this should be more obvious on the manual.

About your question, if you are using a different model, why you can't simply copy the idle animation as victory?
 
O_Ilusionista said:
The manual does not mention modelflag 7
Because it uses bitwise logic, as many functions in openbor (like bindentity).
But yes, this should be more obvious on the manual.

About your question, if you are using a different model, why you can't simply copy the idle animation as victory?

I tried using the idle or a walking animation, i even made new animation,
but the biggest problem is that in a Running stage (maybe in the regular ones too), the stage wont end until the last frame of the victory animation is played/shown, so if you keep on moving , jumping , attacking , the stage will never end -
it was also a matter of preference - i like the old way chase stages end,
where most players will jump about in victory, do silly stuff & all & the screen freezes before the transition to the next stage.

I am about to test the anim Victory issue in other stages - because i did notice that stage 1b would take a little too long to end , & it may be the same reason -  for Victory to occur , you have to stop all inputs.

I would like to change this behavior to this:
Boss dies, victory animation if forced - as long as contact with the ground is present, once the animation is over, control is given back to the player for the last few seconds the stage has left - because other player's animation maybe longer.
 
Update

Yup, just tested it, if you don't stop moving the animation wont happen & the stage will not end - this is a bit flawed.

Also if you make the victory animation loop, the stage wont end either.

the best thing is to have an option to set a timer with script in meantime, to set a timer that ends ends the stage to x times whatever seconds after you kill the boss,
in this way even if people keep moving , or if the victory animation is looped - the stage will end 
 
oldyz said:
I would like to change this behavior to this:
Boss dies, victory animation if forced - as long as contact with the ground is present, once the animation is over, control is given back to the player for the last few seconds the stage has left - because other player's animation maybe longer.

Looks like you'd need to use scripted victory animation. With script, special entity tasked for this can force victory animation and also disable control to players. To prevent conflict with default VICTORY animation, you'd need to use custom animation for it, a FOLLOW for example.
 
That works also  :D

Another alternative way is to parse the script in level text on delay entity like this:
Code:
spawn	delay
@script
void main()
{
    int P1 = getplayerproperty(0, "entity");
    int P2 = getplayerproperty(1, "entity");

    if(P1){
      changeentityproperty(P1,"noaicontrol",1);
      performattack(P1, openborconstant("ANI_FOLLOW1"));
    }
    if(P2){
      changeentityproperty(P2,"noaicontrol",1);
      performattack(P2, openborconstant("ANI_FOLLOW1"));
    }
}
@end_script
health	40
coords	160 240
at	0

Using script on delay like this, both players will lose control of their characters and the latter will be forced to perform FOLLOW1. And with delay holding level from ending for 4 seconds, you can have a nice level ending with this combination  8)
 
Bloodbane thanks ,
i find these scripts that go on the level .txt file are rare, question , do they work different from the animation scripts?
because i have been trying to figure out how to do a script that detects the song that is playing & plays a different song if it does not match -
now that i see this script, i think that music-activated animations & vice-versa are a thing....

just to clear something up, there has to be an actual entity tied to theses scripts all the time? or do you think that "light" or Music switches can do the job.

& does delay have to be spawned before or after the boss?
 
do they work different from the animation scripts?

They work the same way.

there has to be an actual entity tied to theses scripts all the time?

I don't know. Never tried declaring that to scrollx or group command.

does delay have to be spawned before or after the boss?

Yes of course. If you're not using boss 1 command, you can have entities spawned after boss is killed. Don't forget to set group 1 1 to ensure delay isn't spawned before boss is killed.
 
Back
Top Bottom