Solved endlevel question.

Question that is answered or resolved.

DD Tokki

Well-known member
Is there a way for the desired endlevel to work when the player clears the boss without going to the endlevel?
 
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.
 
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.
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.

I used a method to make the chase type entity that tracks the player approach the player by calling the endlevel.

Of course, since it is temporary, if there is a cleaner way, that would be better.
 
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.
 
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.
C:
spawn        Ryu-L1
map            1
item        L1_S01c
itemalias     branch
coords        823 237
at            0
C:
branch    L1_S01c
file    data/level/stage01/L1/stage01c.txt
scene    data/scenes/next.txt
C:
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

With this setting, I can move to the next stage, but I am not able to move to the stage I want. Please let me know if I did something wrong or missed something.
 
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.
Success.
Rather than writing "Branch" in "itemalias", you are writing the name of the Branch you created on the stage.
The move to the stage went well.
 
Back
Top Bottom