anim victory also for npcs

@Steven1985 in some other thread it is suggested that it is best to skip anim victory even for main characters - (the thing is a bit broken)

its seems that is a better practice to force an animation instead, and the advantage of such method is that a forced animation method should work the same on main character entities and any other entity....
 
Victory animation for NPC could be done. There are two ways to make it, provided NPCs have VICTORY animation or similar and they have script in their IDLE and WALK to change to VICTORY animation on cue. The cue is stored on global variable accessible to all entities and that variable is cleared when level ends.

1. Player sends the cue when he/she performs VICTORY animation. This is using default victory system.
2. An entity sends the cue when victory should be performed, that is when boss is defeated and all enemies have been removed from the screen and on other events.

I personally prefer #2 cause it could be used on multiple events but #1 is simpler.
 
Victory animation for NPC could be done. There are two ways to make it, provided NPCs have VICTORY animation or similar and they have script in their IDLE and WALK to change to VICTORY animation on cue. The cue is stored on global variable accessible to all entities and that variable is cleared when level ends.

1. Player sends the cue when he/she performs VICTORY animation. This is using default victory system.
2. An entity sends the cue when victory should be performed, that is when boss is defeated and all enemies have been removed from the screen and on other events.

I personally prefer #2 cause it could be used on multiple events but #1 is simpler.
Do as you prefer :).
 
Sorry for late reply, I've chosen #2 and it requires system not just couple lines so I had to prepare a demo to show it. And here's the demo: NPC Victory.

It has two modes : Game and Test in which both use same level but Test has enemies with less HP for easier testing. Otherwise, both have same system.
Try this demo to see how the system works.
 
Sorry for late reply, I've chosen #2 and it requires system not just couple lines so I had to prepare a demo to show it. And here's the demo: NPC Victory.

It has two modes : Game and Test in which both use same level but Test has enemies with less HP for easier testing. Otherwise, both have same system.
Try this demo to see how the system works.
Don’t worry. I know it takes time to create scripts. In the meantime, I was trying with ChatGPT, but it wasn’t working. What do I have to do to become as good as you? :)
 
Last edited:
I did the test. I wanted the NPCs to perform the victory animation only when all the bosses in the level are defeated, just like the player does by default and I did it disabling the lines of the two delay.
 
Last edited:
@Bloodbane Doing experiements, I saw that if there are 2 bosses and one of them dies, the level finishes and the player with npcs perform anim victory.
C:
spawn   Andore
spawnscript data/scripts/RandMZ.c
health  5
item    BossDed
coords  414 188 #-54 182
at      0
   
spawn   Jones #boss
spawnscript data/scripts/RandMZ.c
health  105
#alias   Steve
item    BossDed
coords  414 188
at      0

If one of two bosses is defeated, the other one also dies. I'd like that anim victory is performed when all bosses are defeated.
 
Last edited:
@Steven1985
you can fix this by spawning another group after the "bosses" die, this final group should be 1 1 and consist of an entity that spawns and autokills itself in milliseconds, tell the level.txt that this entity is the boss and it ends the level and triggers the animation
nsx is full of fake bosses like this and the scripts are there
 
@Bloodbane Doing experiements, I saw that if there are 2 bosses and one of them dies, the level finishes and the player with npcs perform anim victory.


If one of two bosses is defeated, the other one also dies. I'd like that anim victory is performed when all bosses are defeated.

Ah yes, BossDed is designed for single boss system. It's not for multiple bosses.
I'll think of something to solve this.
 
@Bloodbane, he can apply the bossdead item drop to the true last entity of the level on the last group and things should work out fine in most cases
 
Thanks for the suggestion. However the problem here is there is enemy spawner which won't stop spawning enemies until Bossded item gives cue to stop spawning. So the only way is to updated Bossded and the system to work with multiple bosses.
Currently, the update has been done but I need to test it with more bosses.
 
@Bloodbane I tried the version 2 of NPC Victory and I found some bug from 3' 45'': when I defeated the boss and I broke the obstacles that have BossDed, the player and npc performed anim victory but they did not come back to anim idle, so I had to go out from the game and restart from stage 4 by "load game". When I arrived to the same boss I repeated the same procedure but this time the anim victory wasn't performed (see 5' 40''). When I arrived to the last two bosses and defeated them, enemies spawned without end (see 6' 50'').
 
Hi @Bloodbane, about npcvictory3 Kassar has this script:
C:
anim     follow1 # victory
@script
  if(frame >= 2){
    void self = getlocalvar("self");
    void Vict = getglobalvar("Victor");
    int Ani1 = openborconstant("ANI_IDLE");

    if(Vict!="V"){
      setidle(self, Ani1);
    }
  }
@end_script
    loop    1 2 4
    delay    14
    offset    33 60
    bbox    0 0 0 0
    frame    data/chars/players/kassar/get.png
    delay    100
    offset    34 86
    frame    data/chars/players/kassar/freespecial1.png
    delay    10
    frame    data/chars/players/kassar/freespecial1.png
    frame    data/chars/players/kassar/freespecial1.png
    frame    data/chars/players/kassar/freespecial1.png
I have two questions:
1) Why Kassar starts the animation from the first frame if there is written " if(frame >= 2)" ?
2) Why there is loop 1 2 4 instead of loop 0 ?
 
2) Why there is loop 1 2 4 instead of loop 0 ?
right from the manual:

loop {bi} {start} {end}

  • Determines how loop effect is applied in current animation
  • {bi} toggles looping on or off.
    • 0 = looping off
    • 1 = looping on
  • {start} determines the number of frame the animation loops to. Defaults to 0 or 1st frame.
  • {end} determines the number of frame which starts the loop. If left blank, the animation will loop at the end of animation.
  • Some animations should NOT be set to loop (loop temporary at least). Examples include most attacks and injured animations.
 
right from the manual:

loop {bi} {start} {end}

  • Determines how loop effect is applied in current animation
  • {bi} toggles looping on or off.
    • 0 = looping off
    • 1 = looping on
  • {start} determines the number of frame the animation loops to. Defaults to 0 or 1st frame.
  • {end} determines the number of frame which starts the loop. If left blank, the animation will loop at the end of animation.
  • Some animations should NOT be set to loop (loop temporary at least). Examples include most attacks and injured animations.
I had read it before of asking. Thank you but I have not clear the two points that I wrote to Bloodbane.
 
Last edited:
Back
Top Bottom