When the boss is defeated, I wish I could be immediately moved to the desired location like in the endlevel.Do you want to alter player's path if the boss is defeated?
I uploaded a video of the game, but I didn't know how to use a script to move the stage, so I created it in a different way.You could do that by declaring jumptobranch function in boss' DEATH animation or ondeathscript, or in the entity dropped by the boss when the boss dies.
The former is simple but not flexible if you want the same boss to move to different branch in different level. The latter is better solution.
name Goto
type none
anim idle
@script
if(frame==1){
void self = getlocalvar("self");
char Name = getentityproperty(self,"name");
jumptobranch(Name, 1);
}
@end_script
delay 2
offset 1 1
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
spawn Boss
item Goto
itemalias Branch
coords 200 200 1
at 0
This is the second solution I've mentioned above:
Code:name Goto type none anim idle @script if(frame==1){ void self = getlocalvar("self"); char Name = getentityproperty(self,"name"); jumptobranch(Name, 1); } @end_script delay 2 offset 1 1 frame data/chars/misc/empty.png frame data/chars/misc/empty.png frame data/chars/misc/empty.png
To use this, declare it as dropped item with alias like this:
Code:spawn Boss item Goto itemalias Branch coords 200 200 1 at 0
If you don't declare itemalias, Goto would bring player to branch called Goto but if there's no such branch, then it will simply go to next level.
spawn Ryu-L1
map 1
item L1_S01c
itemalias branch
coords 823 237
at 0
branch L1_S01c
file data/level/stage01/L1/stage01c.txt
scene data/scenes/next.txt
name L1_S01c
type none
anim idle
@script
if(frame==1){
void self = getlocalvar("self");
char Name = getentityproperty(self,"name");
jumptobranch(Name, 1);
}
@end_script
delay 1
offset 1 1
frame none
frame none
frame none
Success.This is the second solution I've mentioned above:
Code:name Goto type none anim idle @script if(frame==1){ void self = getlocalvar("self"); char Name = getentityproperty(self,"name"); jumptobranch(Name, 1); } @end_script delay 2 offset 1 1 frame data/chars/misc/empty.png frame data/chars/misc/empty.png frame data/chars/misc/empty.png
To use this, declare it as dropped item with alias like this:
Code:spawn Boss item Goto itemalias Branch coords 200 200 1 at 0
If you don't declare itemalias, Goto would bring player to branch called Goto but if there's no such branch, then it will simply go to next level.