Setting Branch

It already works smoother than normal branches but alas, it still ends the same way... I'll offer my txt files in case I've slipped up anywhere-

Here's the beginning of my levels.txt. Right now getting to the secret area is no problem but it goes there after defeating the bosses no matter what:
set Kaiju-Royale
typemp 0
nosame  1
lives 5
credits 6
continuescore 1
cansave 2
skipselect
select data/levels/sel4.txt
scene  data/scenes/01.txt
z      185 270 160
file data/levels/st1b.txt
branch PathB
file data/levels/st1b2020.txt
end
next
scene  data/scenes/02.txt
z      200 270 160
file data/levels/st2.txt
next

Here's where the entity is spawned in the level itself, much before the bosses:
#-------2

wait
at      500


group  3 3
at      500


spawn Ufo
coords 226 234
at 500


spawn Kamacuras
coords -130 190
at 500


spawn Kamacuras
2pspawn 1
coords 750 210
at 500


spawn Bemular
3pspawn 1
coords 550 193
at 500


spawn branchb
coords 155 260
at 600

Now the branch entity itself:

name BranchB
nomove 1
nolife 1
score 0 -1
antigravity 100
candamage player
type none
shadow 0


anim idle
loop 1
delay 50
offset 110 102
followanim 1
followcond 1
attack25 82 94 52 10 0 0 1 1
dropv -8 0
frame data/chars/misc/2020goop16.gif
frame data/chars/misc/2020goop16.gif
frame data/chars/misc/2020goop16.gif


anim follow1
delay 50
offset 110 102
frame data/chars/misc/2020goop16.gif
@cmd jumptobranch "PathB" 1
frame data/chars/misc/2020goop16.gif
frame data/chars/misc/2020goop16.gif
 
Hmm.... this is:
Code:
#-------2

wait
at      500


group   3 3
at      500


spawn   Ufo
coords   226 234
at   500


spawn   Kamacuras
coords   -130 190
at   500


spawn   Kamacuras
2pspawn 1
coords   750 210
at   500


spawn   Bemular
3pspawn 1
coords   550 193
at   500


spawn branchb
coords 155 260
at 600

from st1b.txt right?
If that's the case then judging from your level setting:
Code:
z       185 270 160
file   data/levels/st1b.txt
branch PathB
file   data/levels/st1b2020.txt
end
next
scene   data/scenes/02.txt
z       200 270 160
file   data/levels/st2.txt
next

you will go to st1b2020.txt no matter how you end st1b.txt  :)

I believe what you need is script to skip st1b2020.txt if player isn't going there.
What you need is to set branch name before next like this:
Code:
z       185 270 160
file   data/levels/st1b.txt
branch PathB
file   data/levels/st1b2020.txt
end
branch St2
next
scene   data/scenes/02.txt
z       200 270 160
file   data/levels/st2.txt
next

then a script like this :
Code:
wait
at      500


group   3 3
at      500


spawn   Ufo
@script
void main()
{
    jumptobranch("St2", 0);
}
@end_script
coords   226 234
at   500


spawn   Kamacuras
coords   -130 190
at   500


spawn   Kamacuras
2pspawn 1
coords   750 210
at   500
...

That script will force player to go to St2 after clearing st1b.txt.
The script can be declared on other entity spawn but make sure it's declared before boss is spawned to ensure the script is run

I may need to check if it's possible to go right before next like above but if it's not possible, you can use dummy level trick to create a dummy level right before next
 
I'm so sorry for bringing back this old topic but I'm new into this. I just got here a year ago and i don't think it's necessary to open a "new" topic.

I tried to follow the process but it didn't work. This is my branch entity.

name RPD_Branch
type endlevel
shadow 0
facing 1
branch RPD

anim idle
loop 1
delay 1000
offset 17 142
bbox 0 0 34 147
frame data/chars/misc/door.gif

This is my level set.

file    data/levels/operation/raccoon_city_01.txt
branch RPD
file    data/levels/kijuju/kijuju.txt
file data/levels/rpd/rpd.txt
end

The branch is of course spawned in the level, which is "raccoon_city_01" where it will appear.

I've put "kijuju" right after my level just to make sure it will truly lead me to "RPD" as expected but no, it will lead me directly to "kijuju" instead, just like a normal end level.
 
Hey Chris

2 things Put the branch ABOVE the level you want to spawn to, so if you're in racoon city and you want to warp to rpd put the branch ABOVE data/levels/rpd/rpd.txt and also make sure the branch is spelled correctly and the same as the name in your endlevel entity. example

file    data/levels/operation/raccoon_city_01.txt

file    data/levels/kijuju/kijuju.txt

branch RPD_Branch
file  data/levels/rpd/rpd.txt
end
 
Alright, I'll do it but how can I make sure that I will spawn in the desired level? I mean how can i be sure that the branch truly worked and it's not just a common end level if both levels are declared in sequence in the set?
 
As long as the endlevel entity is correctly placed on stage, spelled correctly and put in the desired location in levels.txt it should be fine.
 
Got it. I've declared my levels like this and now it's working. Thank you!!

file    data/levels/operation/raccoon_city_01.txt
branch Raccoon_City_02
file    data/levels/operation/raccoon_city_02.txt
branch Raccoon_City_01
file    data/levels/operation/raccoon_city_01.txt
branch Raccoon_City_03
file    data/levels/operation/raccoon_city_03.txt
branch Raccoon_City_04
file    data/levels/operation/raccoon_city_04.txt
 
Back
Top Bottom