ending branch

Minor

Member
hi,
i begin with branch, i read all topics on the site and the manual and i don't find my problem. even if i'm sure it's obvious, but i'm a bit lost.

i have a bonus stage by destroying a statue. when bonus stage end  it goes to an elevator level. for now everything works fine.



but when i try to finish normally the level (ja1) with the statue normally, it flies me to the bonus level at the end, not the elevator one. how can i fix that and end normally to continue main path? thank you!

here's the level.txt, "hito" is the bonus level
Code:
z 200 260
file data/levels/ja1/ja1.txt
branch hito
z 260 260 260
file data/levels/hito/hito/hito.txt
z 200 260
file data/levels/elev/elev.txt
scene   data/scenes/jag3.txt
z 256 256 256
file data/levels/jag/jag.txt
scene   data/scenes/jag4.txt
end

sjagi is the statue spawn in level "ja1"
Code:
spawn	sjagi
map 1
item   aladin
itemalias hito
coords	198 200  0
at 0

aladin and aladend are the item lamp to jump branch
Code:
name       aladend
type       endlevel
antigravity     100

anim	idle
	bbox	1 0 68 50
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame == 1){
      jumptobranch("elev", 1);
    }
	@end_script	
	delay	100
	offset	37 27
	frame	data/chars/misc/aladend.png

Code:
name       aladin
type       endlevel
antigravity     100

anim	idle
	bbox	1 0 68 50
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame == 1){
      jumptobranch("hito", 1);
    }
	@end_script	
	delay	100
	offset	37 27
	frame	data/chars/misc/aladin.png

 
I think your missing a branch for elevator while you have that hito as branch for bonus level in levels.txt. Why not put "branch elev" above that elev txt level like your hito branch?
 
Ah this problem is similar to Liu Kang has posted before

when i try to finish normally the level (ja1) with the statue normally, it flies me to the bonus level at the end, not the elevator one. how can i fix that and end normally to continue main path?

By nature, you'll go to next level after completing a level
In order to skip a level or to be exact go to correct level, you'll need some settings.

First set branch before elevator as suggested above:
Code:
z 200 260
file data/levels/ja1/ja1.txt
branch hito
z 260 260 260
file data/levels/hito/hito/hito.txt
branch Elev
z 200 260
file data/levels/elev/elev.txt
scene   data/scenes/jag3.txt
z 256 256 256
file data/levels/jag/jag.txt
scene   data/scenes/jag4.txt
end

Second, add this script in one of spawns in ja1.txt:
Code:
spawn   ...
@script
void main()
{
    jumptobranch("Elev", 0);
}
@end_script
...

With this script, after completing ja1.txt, you'll go straight to elev.txt instead of hito.txt

HTH
 
Sorry i didn't see the  post of liu  :-[

but it works! i already tried to put the "branch elev" and i put this script in the animation of an endlevel entity but didn't work.

Now it works by puting this in the "level spawn", really thank you maxman and bloodbane, you're always on top  ;D
 
Back
Top Bottom