branch options

jonsilva

New member
hello

is it possible to use some kind of branch command when a level ends
to go to a specific chossen level...?
i wanted to avoid creating and spawning a branch .txt file...
and maybe use a command "branch lvl**" in the level.txt where the enemies and obstacles are spwaned... to go to another place

i found this command "skiptoset" but i dont know it works
 
Bloodbane, I just want understand something. Will jumptobranch in a level allow me to spawn copies of the same endlevel, and each lead to different branches? For example, something like...

spawn  exit
@script
void main()
{
    jumptobranch("Path1", 0);
}
@end_script
health  20
coords  160 185
at  0

spawn  exit
@script
void main()
{
    jumptobranch("Path2", 0);
}
@end_script
health  20
coords  480 185
at  0

The goal is to have stages like those in Capcom D&D or Dragon's Crown... except, I don't want to create a hundred different endlevel items.
 
I have it like that in he-man but i change their alias and based on their alias they lead to different branch in pain animation

Code:
spawn  day
alias cavride
coords     437  347  0
at  0

spawn  day
alias dayr
coords     214  421
at  0


spawn  day
alias day1
coords     134  497
at  0


spawn  day
alias cave
coords     532  340
at  0



spawn  day
alias fore2
coords     95  312
at  0


spawn  day
alias fore1
coords     262  341
at  0


spawn  day
alias icer
coords     422  73
at  0

spawn  day
alias ice
coords     262  80
at  0


spawn  day
alias nwods
coords     798  347
at  0



spawn  day
alias foride
coords     179  354
at  0

and pain anim in day which serves as location mark on map
Code:
anim	pain
	loop	0
	@script
        void	self = getlocalvar("self"); //Get calling entity
	char	Name = getentityproperty(self,"name");
    if (( Name == "dayr" )&&(frame == 1)){
        jumptobranch("dayr",1);
	}
	if(( Name == "day1" )&&(frame == 1)){
	jumptobranch("day1",1);
	}
	if(( Name == "nwods" )&&(frame == 1)){
	jumptobranch("nwods",1);
	}
	if(( Name == "cavride" )&&(frame == 1)){
	jumptobranch("cavride",1);
	}
	if(( Name == "cave" )&&(frame == 1)){
	jumptobranch("cave",1);
	}
	if(( Name == "fore2" )&&(frame == 1)){
	jumptobranch("fore2",1);
	}
	if(( Name == "foride" )&&(frame == 1)){
	jumptobranch("foride",1);
	}
	if( (Name == "fore1" )&&(frame == 1)){
	jumptobranch("fore1",1);
	}
	if(( Name == "icer" )&&(frame == 1)){
	jumptobranch("icer",1);
	}
	if( (Name == "ice" )&&(frame == 1)){
	jumptobranch("ice",1);
	}
	if(( Name == "gre" )&&(frame == 1)){
	jumptobranch("gre",1);
	}
      	if(( Name == "hall" )&&(frame == 1)){
	jumptobranch("hall",1);
	}
	    	if(( Name == "gskull" )&&(frame == 1)){
	jumptobranch("gskull",1);
	}
	@end_script	
	offset	12 12
	bbox	6 6 13 12
	drawmethod	tintmode 2
	drawmethod	tintcolor 100_0_0
	delay	30
	frame	data/sprites/crypt.gif
	delay	10
	frame	data/sprites/crypt.gif
 
why so many IF's..? is it something to do with clearglobalvar ?

this was already used in other games

levels.txt
branch   blabla1 <---- everything that has the thing "blabla1" on it goes to here
z          225 300 420
file      data/levels/level5.txt

map.txt
background data/bgs/map/back.gif
panel             data/bgs/map/panel.gif
spawn1  75 140 a
spawn2  125 70
spawn3  125 50

spawn  bannanas
alias  blabla1 <---- the alias will make it go to the branch on levels.txt
coords  100 100
at      0

bannanas.txt
name bannanas
type enemy
health 100
nomove 1 1
facing 1
offscreenkill 10000
subject_to_wall 0
subject_to_platform 0
subject_to_hole 0
shadow 0


anim idle
loop 1
delay 5
offset 10 10
bbox 1 1 20 20 300
frame data/bgs/map/bannanas.gif
frame data/bgs/map/bannanas.gif
frame data/bgs/map/bannanas.gif


anim pain <---this will check bannanas name (alias) and goes there
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame==3){
jumptobranch(Name, 1);
    }
@end_script
loop 0
delay 5
offset 10 10
bbox 0 0 0 0
frame data/bgs/map/bannanas.gif
frame data/bgs/map/bannanas.gif
frame data/bgs/map/bannanas.gif
frame data/bgs/map/bannanas.gif
frame data/bgs/map/bannanas.gif
frame data/bgs/map/bannanas.gif



You can use same trick to show name of the marker but that would involve using other entity.

yes but will only require 1 entity has long has all texts have the same pallete
i have spawngun here ive been using a lot that makes the animation change
void spawnGun5(void Name, float dx, float dy, float dz, int Num, void Ani)
{ // Spawn gun with ani animation, store it and bind it
  void self = getlocalvar("self");
  void Spawn;
  Spawn = spawn01(Name, dx, dy, 0);
  setentityvar(self, Num, Spawn); // Stores spawned gun to be killed later
  bindentity(Spawn, self, dx, dz, dy, 0, 0); // Bind spawned gun
  performattack(Spawn, openborconstant(Ani));
}

bannanas.txt
anim attack
            range -20 20
            rangez -10 10
loop 0
delay 5
offset 10 10
bbox 1 1 20 20 300
frame data/bgs/map/bannanas.gif
@cmd spawnGun5 "icontext" 1 1 2 2 "ANI_FOLLOW1"
frame data/bgs/map/bannanas.gif
frame data/bgs/map/bannanas.gif

icontext.txt
anim follow1
loop 1
delay 5
offset 10 10
bbox 0 0 0 0
frame data/chars/misc/text1.gif

anim follow2
loop 1
delay 5
offset 10 10
bbox 0 0 0 0
frame data/chars/misc/text2.gif

anim follow3
loop 1
delay 5
offset 10 10
bbox 0 0 0 0
frame data/chars/misc/text3.gif

anim follow...etc...etc..etc..
 
Will jumptobranch in a level allow me to spawn copies of the same endlevel, and each lead to different branches?

Nope, jumptobranch controls where to go next after CURRENT level ends
If you want flexible endlevel entities, check marker entity in this demo. You can define which branch to go to by defining its alias, ex:

spawn marker
@script
  void main()
  {
    void self = getlocalvar("self"); //Get calling entity
    void Status2 = getglobalvar("For1");

    if(Status2 == 1){
      killentity(self);
    }
  }
@end_script
alias F1
coords 560 410
at 0

if you look at map.txt, you can see I set 3 markers which brings to different locations but all of them use same marker entity.

why so many IF's..? is it something to do with clearglobalvar ?

Do you notice that when you enter map for first time, there's only one active marker? if you clear one location, the next one will appear. After clearing the 3rd one, first one will reappear and the cycle go on

The script in map.txt is to control which marker appears (unlocked) and which marker is gone (locked)

And no, each if is related to global variable but not to clearglobalvar function.
 
Do you notice that when you enter map for first time, there's only one active marker? if you clear one location, the next one will appear. After clearing the 3rd one, first one will reappear and the cycle go on

yes the map ok

i was just commenting the he-man pain animation in icons
the jumptobranch in the 2 script seem to be doing the same thing
anim pain
loop 0
@script
        void self = getlocalvar("self"); //Get calling entity
char Name = getentityproperty(self,"name");
    if (( Name == "dayr" )&&(frame == 1)){
        jumptobranch("dayr",1);
}
if(( Name == "day1" )&&(frame == 1)){
jumptobranch("day1",1);
}
if(( Name == "nwods" )&&(frame == 1)){
jumptobranch("nwods",1);
}
if(( Name == "cavride" )&&(frame == 1)){
jumptobranch("cavride",1);
}
if(( Name == "cave" )&&(frame == 1)){
jumptobranch("cave",1);
}
if(( Name == "fore2" )&&(frame == 1)){
jumptobranch("fore2",1);
}
if(( Name == "foride" )&&(frame == 1)){
jumptobranch("foride",1);
}
if( (Name == "fore1" )&&(frame == 1)){
jumptobranch("fore1",1);
}
if(( Name == "icer" )&&(frame == 1)){
jumptobranch("icer",1);
}
if( (Name == "ice" )&&(frame == 1)){
jumptobranch("ice",1);
}
if(( Name == "gre" )&&(frame == 1)){
jumptobranch("gre",1);
}
      if(( Name == "hall" )&&(frame == 1)){
jumptobranch("hall",1);
}
    if(( Name == "gskull" )&&(frame == 1)){
jumptobranch("gskull",1);
}
@end_script
offset 12 12
bbox 6 6 13 12
drawmethod tintmode 2
drawmethod tintcolor 100_0_0
delay 30
frame data/sprites/crypt.gif
delay 10
frame data/sprites/crypt.gif


anim  pain
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame==1){
  jumptobranch(Name, 1);
    }
@end_script
  loop  0
  delay  5
  offset  10 10
  bbox  0 0 0 0
  frame  data/bgs/map/bannanas.gif
 
Im using one marker for all locations on map, so i need many if's , one for each location.
Dont use clearglobalvar in any of the levels or in characters, it will reset the map, and all markers will be like from beginning.
You can use clearglobalvar only in select animation , this will reset the map when you restart the game after game over screen.
If you want to clear variable then change it to 0 with setglobalvar, dont clear it.I used clearglobalvar ( somethin) and it messed up other variables, so its better to set it to 0 instead of clearing.
 
If you want to clear variable then change it to 0 with setglobalvar, dont clear it.I used clearglobalvar ( somethin) and it messed up other variables, so its better to set it to 0 instead of clearing.
ok...thanks for the info on clearglobalvar

but... about the if's it's really not necessary
i know it work's but...

the icon (alias) is on char Name (Name = day1) or whatever is on icon alias on the map...
so it just checks...
jumptobranch(---Name"day1"----, 1);

ho boy...!!! :o
i know you have a better understanding about scripts than me
but if you whant just try
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame==1){
  jumptobranch(Name, 1);
    }
@end_script

you ll see it will do the exact same thing
you can use this script in marker it works for all locations
 
Yeah thats more compact and works as well
hhhaaa i knew it  :D
its the same thing
but this way is better you dont need to add more lines to script

the previous script you had
you would had to add a new if line for every new level you would made
    if(( Name == "newlevel1" )&&(frame == 1)){
    jumptobranch("newlevel1",1);
    }
  if(( Name == "newlevel2" )&&(frame == 1)){
    jumptobranch("newlevel2",1);
    }

the script could end up with 100 (IF) lines if you had 100 levels.
the other way works faster
 
Mmm. I may have encountered a little bug.

So here's my branch setup.

branch woods1
z 26 1397 160
file data/levels/woods1.txt
z 131 176 160
file data/levels/field0.txt

branch woods1b
z 26 865 160
file data/levels/woods1b.txt
z 26 1397 160
file data/levels/woods1a.txt

In woods1.txt, there are two endlevel items. One that has no script, placed presumably so that the player will go to field0.txt. The other has jonsilva's script, and is supposed to go to branch woods1b.

The problem is, if I go to the endlevel item that is supposed to take me to woods1b, I end up in field0.txt. It works as intended only if I remove field0.txt from the woods1 branch. So... does this mean I need to make a separate branch for field0.txt, and set an endlevel item to go there?
 
it's very hard to understand what you are trying to do...
maybe its because the solution is already writen in this post...

you just need to set the alias (woods1b.txt) on entity that will make the player go to the desire level... when is on woods1.txt...

i can post the jump to branch entity that iam using it works for all levels... it jumps to level when player touchs it

name allgo
type none
facing 1
subject_to_wall 0
subject_to_platform 0
subject_to_hole 0
shadow 0
offscreenkill 10000
hostile player
animationscript data/scripts/escript.c

anim idle
loop 1
delay 4
offset 35 120
bbox 0 70 80 60 30
movea -1
frame data/chars/misc/branch/in01.gif
@cmd attack1 -50 50 30 "ANI_FOLLOW1"
frame data/chars/misc/branch/in01.gif
frame data/chars/misc/branch/in01.gif
@cmd attack1 -50 50 30 "ANI_FOLLOW1"
frame data/chars/misc/branch/in02.gif
frame data/chars/misc/branch/in02.gif
@cmd attack1 -50 50 30 "ANI_FOLLOW1"
frame data/chars/misc/branch/in02.gif
movea 1
frame data/chars/misc/branch/in01.gif
frame data/chars/misc/branch/in01.gif
@cmd attack1 -50 50 30 "ANI_FOLLOW1"
frame data/chars/misc/branch/in01.gif
frame data/chars/misc/branch/in02.gif
@cmd attack1 -50 50 30 "ANI_FOLLOW1"
frame data/chars/misc/branch/in02.gif
frame data/chars/misc/branch/in02.gif



anim follow1
loop 0
delay 5
offset 35 120
bbox 0 70 80 60 30
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame==10){
jumptobranch(Name, 1);
    }
@end_script
frame data/chars/misc/branch/in01.gif
frame data/chars/misc/branch/in02.gif
frame data/chars/misc/branch/in03.gif
frame data/chars/misc/branch/in01.gif
frame data/chars/misc/branch/in02.gif
frame data/chars/misc/branch/in03.gif
frame data/chars/misc/branch/in01.gif
frame data/chars/misc/branch/in02.gif
frame data/chars/misc/branch/in03.gif
frame data/chars/misc/branch/in01.gif
frame data/chars/misc/branch/in02.gif
frame data/chars/misc/branch/in03.gif
frame data/chars/misc/branch/in01.gif
frame data/chars/misc/branch/in02.gif
frame data/chars/misc/branch/in03.gif
frame data/chars/misc/branch/in01.gif

spawn in level
spawn  allgo
alias  woods1b.txt
coords  100 755
at      0

if you want to return to woods1 again while on woods1b just change the alias on the entity...

also another thing i wanted to share
iam playing the game / editing the levels images / and making it go to the next map that has unlocked stuff... this happens whenever a sequence of levels is finished...

for some reason branch only seems to read strings or something...
and it crashs when the values are int's etc... setglobalvar only makes int's values
and i could not find a way to past int's to strings... the c/c++ commands to pass int to string dindnt worked on the engine...

so BBW if's were very usefull in the setglobalvar...

0map.txt
spawn  ghost1
@script
void main()
{
    setglobalvar("map", 01);
}
@end_script
coords  30 240
at      0

levels.txt
branch   01
z 10 545 290  
file data/levels/0map.txt

home exit (works for all maps *1 *2 *3...etc)
name homexit
type    obstacle
score 0
health  15000
nolife  1
noatflash 1
flash    Flash0
facing   1
offscreenkill 15000
subject_to_minz    0
subject_to_maxz    0
subject_to_wall    0
subject_to_platform    0
subject_to_obstacle    0
subject_to_hole    0


anim idle
loop 1
delay 6
offset 115 190
bbox 55 20 110 145 20
counterrange 0 10 1 1
followanim 1
frame data/chars/misc/branch/fplace20.gif
delay 8
frame data/chars/misc/branch/fplace21.gif
offset 115 189
frame data/chars/misc/branch/fplace20.gif
offset 115 188
frame data/chars/misc/branch/fplace20.gif
offset 115 187
frame data/chars/misc/branch/fplace20.gif
offset 115 186
frame data/chars/misc/branch/fplace20.gif
offset 115 185
frame data/chars/misc/branch/fplace20.gif
offset 115 186
frame data/chars/misc/branch/fplace20.gif
offset 115 187
frame data/chars/misc/branch/fplace20.gif
offset 115 188
frame data/chars/misc/branch/fplace20.gif
offset 115 189
frame data/chars/misc/branch/fplace20.gif

    #char Name = getentityproperty(self,"name");

anim follow1
@script
    void self = getlocalvar("self");
    int  exit = getglobalvar("map");
    if (( exit == 01 )&&(frame == 15)){
    jumptobranch("01",1);
    }
    if(( exit == 02 )&&(frame == 15)){
    jumptobranch("02",1);
    }
    if(( exit == 03 )&&(frame == 15)){
    jumptobranch("03",1);
    }
    if(( exit == 04 )&&(frame == 15)){
    jumptobranch("04",1);
    }
    if(( exit == 05 )&&(frame == 15)){
    jumptobranch("05",1);
    }
    if(( exit == 06 )&&(frame == 15)){
    jumptobranch("06",1);
    }
    if(( exit == 07 )&&(frame == 15)){
    jumptobranch("07",1);
    }
    if(( exit == 08 )&&(frame == 15)){
    jumptobranch("08",1);
    }
    if(( exit == 09 )&&(frame == 15)){
    jumptobranch("09",1);
    }
    if(( exit == 10 )&&(frame == 15)){
    jumptobranch("10",1);
    }
    if(( exit == 11 )&&(frame == 15)){
    jumptobranch("11",1);
    }
    if(( exit == 12 )&&(frame == 15)){
    jumptobranch("12",1);
    }
@end_script
loop 0
delay 6
offset 115 190
bbox 0 0 0 0
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
frame data/chars/misc/branch/fplace20.gif
frame data/chars/misc/branch/fplace21.gif
delay 1000
frame data/chars/misc/branch/fplace20.gif

in 2map.txt / 3map.txt /4map.txt etc... that is a new .txt map with new stuff unlocked
i only need to    setglobalvar("map", 01); to 02 , 03 , 04...etc... to make the homeexit go to the desire map number

this also works for the unlocked bonus stages on map* in here ive used bloodbane map tutorial to make the bonus stage* inaccessable once you complete it 1 time while on the map...

bonus1b.txt
spawn  ghost1
@script
  void main()
{
    void self = getlocalvar("self");
    setglobalvar("bn1", 1); #<--- this 1 makes the icon show complete
    int  exit = getglobalvar("map");
    if(exit == 02){
    jumptobranch("02",0);
    }
    if(exit == 03){
    jumptobranch("03",0);
    }
    if(exit == 04){
    jumptobranch("04",0);
    }
    if(exit == 05){
    jumptobranch("05",0);
    }
    if(exit == 06){
    jumptobranch("06",0);
    }
    if(exit == 07){
    jumptobranch("07",0);
    }
    if(exit == 08){
    jumptobranch("08",0);
    }
    if(exit == 09){
    jumptobranch("09",0);
    }
    if(exit == 10){
    jumptobranch("10",0);
    }
    if(exit == 11){
    jumptobranch("11",0);
    }
    if(exit == 12){
    jumptobranch("12",0);
    }
}
@end_script
coords  280 240
at      0

icon on the map that goes to current bonus stage (works for all bonus levels)...
name lvlbns
type enemy
health 100
nomove 1 1
facing 1
offscreenkill 10000
subject_to_wall 0
subject_to_platform 0
subject_to_hole 0
shadow 0
hostile player
setlayer 10
aggression 100

animationscript data/scripts/escript.c

#---------------all-going-start--------------------

anim pain
@script
    void self = getlocalvar("self");
    char Name = getentityproperty(self,"name");

    if(frame==25){
jumptobranch(Name, 1);
    }
@end_script
loop 0
delay 5
offset 11 11
bbox 0 0 0 0
frame data/bgs/0map/icons/2bonus01.gif
frame data/bgs/0map/icons/2bonus02.gif
frame data/bgs/0map/icons/2bonus03.gif
frame data/bgs/0map/icons/2bonus04.gif
frame data/bgs/0map/icons/2bonus05.gif
frame data/bgs/0map/icons/2bonus01.gif
frame data/bgs/0map/icons/2bonus02.gif
frame data/bgs/0map/icons/2bonus03.gif
frame data/bgs/0map/icons/2bonus04.gif
frame data/bgs/0map/icons/2bonus05.gif
frame data/bgs/0map/icons/2bonus01.gif
frame data/bgs/0map/icons/2bonus02.gif
frame data/bgs/0map/icons/2bonus03.gif
frame data/bgs/0map/icons/2bonus04.gif
frame data/bgs/0map/icons/2bonus05.gif
frame data/bgs/0map/icons/2bonus01.gif
frame data/bgs/0map/icons/2bonus02.gif
frame data/bgs/0map/icons/2bonus03.gif
frame data/bgs/0map/icons/2bonus04.gif
frame data/bgs/0map/icons/2bonus05.gif
frame data/bgs/0map/icons/2bonus01.gif
frame data/bgs/0map/icons/2bonus02.gif
frame data/bgs/0map/icons/2bonus03.gif
frame data/bgs/0map/icons/2bonus04.gif
frame data/bgs/0map/icons/2bonus05.gif
delay 20
frame data/bgs/0map/icons/2bonus05.gif #25
frame data/bgs/0map/icons/2bonus05.gif
frame data/bgs/0map/icons/2bonus05.gif
delay 100
frame data/bgs/0map/icons/2bonus05.gif

#---------------all-going-end--------------------


#---------------BONUS-1-SET------------------

anim spawn
@script
    void self = getlocalvar("self");
    int  done = getglobalvar("bn1");
 
    if(done == 1){
    performattack(self, openborconstant("ANI_FOLLOW15"));
    }
@end_script

loop 0
delay 5
offset 11 11
bbox 0 0 0 0
frame data/bgs/0map/icons/2bonus01.gif
frame data/bgs/0map/icons/2bonus01.gif

anim idle
loop 1
delay 180
offset 11 11
bbox 1 1 20 20 300
frame data/bgs/0map/icons/2bonus101.gif
delay 6
frame data/bgs/0map/icons/2bonus102.gif
frame data/bgs/0map/icons/2bonus103.gif
frame data/bgs/0map/icons/2bonus104.gif
frame data/bgs/0map/icons/2bonus105.gif

#---------------BONUS-1-SET-END--------------

#---------------/////------------------

#---------------BONUS-2-SET------------------


anim follow1
@script
    void self = getlocalvar("self");
    int  done = getglobalvar("bn2");
 
    if(done == 1){
    performattack(self, openborconstant("ANI_FOLLOW15"));
    }
@end_script
loop 0
delay 5
offset 11 11
bbox 0 0 0 0
frame data/bgs/0map/icons/2bonus01.gif
@cmd anichange "ANI_FOLLOW2"
frame data/bgs/0map/icons/2bonus01.gif

anim follow2
loop 1
delay 6
offset 11 11
bbox 1 1 20 20 300
frame data/bgs/0map/icons/2bonus203.gif
frame data/bgs/0map/icons/2bonus204.gif
frame data/bgs/0map/icons/2bonus205.gif
delay 180
frame data/bgs/0map/icons/2bonus201.gif
delay 6
frame data/bgs/0map/icons/2bonus202.gif

#---------------BONUS-2-SET-END--------------




#---------------all-X-complete--------------------

anim follow15
loop 1
delay 300
offset 11 11
bbox 0 0 0 0 #<---player map cursor cant hit it (bbox 0 0 0 0)
frame data/bgs/0map/icons/2bonus00.gif #<--- it has an X on it

iam using follows to spawning it in level so the icon image changes to b1/b2/b3 etc...

it's very simple it's just a map with stuff on it once you complete 1 stuff it show complete when you return to map / when you choose to play next level on map - you play next level / once level is complete it goes to a new map with more stuff unlocked...
 
NickyP said:
does this mean I need to make a separate branch for field0.txt, and set an endlevel item to go there?

yea, this was exactly what happened with the iron fist foot bug at my first game, or maybe you should "kill" end level entity with offscreen, then you could go to field0 without a new branch
 
Let me try to explain my problem a little better.

You start out on Field0, and can access Woods1 as a branch. Within Woods1, you should be able to go either back to Field0, or further into Woods1b.

My level branches look like this:
set Adventure_Mode

z 26 1269 160
file data/levels/town0.txt
z 131 176 160
file data/levels/field0.txt

branch woods1
z 26 1397 160
file data/levels/woods1.txt
z 131 176 160
file data/levels/field0.txt

branch woods1b
z 26 865 160
file data/levels/woods1b.txt
z 131 176 160
file data/levels/field0n.txt

Within Woods1.txt, we have:
music data/music/woods.bor

settime 0
notime 1
#setweap 1
cameratype 1

direction both
scrollspeed 100

#bgspeed 0.2

background data/bgs/area1/idalia/1.png
panel data/bgs/area1/idalia/1.png

levelscript data/scripts/reset.c

order a

spawn respawn1
spawnscript data/scripts/noscpos.c
coords 3350 151
at 0
spawn respawn2
spawnscript data/scripts/noscpos.c
coords 3350 151
at 0
spawn respawn3
spawnscript data/scripts/noscpos.c
coords 3350 151
at 0
spawn respawn4
spawnscript data/scripts/noscpos.c
coords 3350 151
at 0

spawn  exit2
coords  222  20
at  0
spawn  dirU
coords  271  966
alias  woods1b
at  0

The respawn entities and reset.c are so that when the player goes back to Field0, they are placed in the coordinates I want them to be in. The entity "exit2" is supposed to achieve this, and normally does. The entity "dirU" has the branch-alias script; and as you can see, it's meant to take the player to Woods1b branch.

But here's the issue: in the Woods1 branch, I have field0.txt after woods1.txt. If I keep it that way, then both "exit2" and "dirU" will take me back to field0; regardless of the fact that "dirU" has the jumptobranch script. If I remove field0.txt in the Woods1 branch, then both "exit2" and "dirU" will take me to Woods1b branch.

That's not what I'm trying to achieve. I want "exit2" to take me to field0, and "dirU" to take me to Woods1b. Help?
 
It sounds like dirU entity is not working well so we might need to see dirU text
However, why don't you make a similar entity like dirU which uses jumptobranch function? something like dir
Then instead of setting level like that why don't you set it like this:

set Adventure_Mode

z  26 1269 160
file  data/levels/town0.txt
branch Field0
z  131 176 160
file  data/levels/field0.txt
branch woods1
z  26 1397 160
file  data/levels/woods1.txt
branch woods1b
z  26 865 160
file  data/levels/woods1b.txt
branch Field0n # might be useful later
z  131 176 160
file  data/levels/field0n.txt

Use that dir to replace exit2 and set its alias to Field0
 
yup you can do it i think it had to do with the select screen and mapping or something like that but i know its possible bloodbane said so a long time ago at lavalit you mean kinda like the snes xmen game where you picked a char and they had specific level for them?
 
Back
Top Bottom