Steven1985
Active member
Hi, I'd like to have anim victory working also for npcs.
Thank you in advance.
Thank you in advance.
Do as you preferVictory 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.
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?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?![]()
To learn to make scripts have I to start from here? Noobs guide to scriptingFirst, don't use chatGPT or other's people's help. Second, practice alot. I had to get past crashes and errors before I know how to code properly.
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
@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.
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
right from the manual:2) Why there is loop 1 2 4 instead of loop 0 ?
I had read it before of asking. Thank you but I have not clear the two points that I wrote to Bloodbane.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.