• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

Solved End level if NPC die

Question that is answered or resolved.

ZVitor

Active member
well.....
npc play death anim when die, but notghing happens.
why this are not working:
Code:
anim	death
	loop	0
	offset	133 153
	bbox	109 77 51 78
	delay	300
	frame	data/chars/misc/x1.gif
	delay	300
	@script
        if(frame==1){
        jumptobranch("port_1a", 1);
        }
        @end_script
	frame	data/chars/misc/x1.gif

port_1a = name of branch before this level





 
ZVitor said:
npc play death anim when die, but notghing happens.
Try this:
Code:
anim	death
	@script
        if(frame==1){
        jumptobranch("port_1a", 1);
        }
        @end_script
	offset	133 153
	delay	300
	frame	data/chars/misc/x1.gif
	frame	data/chars/misc/x1.gif

[couple time later]

I've tested it and the cause of this is simply because NPC disappears before the script is run. You can solve that either by setting shorter delay OR set nodieblink 2 to ensure NPC doesn't disappear before script is run

[quote author=White Dragon]
new script function finishlevel();
[/quote]

Offtopic: what parameters the function accepts? or declaring finishlevel() is sufficient?
 
Solved thanks,
used nodieblink 2,

btw,  finishlevel() will skip to next level instead of return to previous branch, right?
 
Back
Top Bottom