Solved connecting destructible door to branch

Question that is answered or resolved.

DonoVane

New member
Hello. I am modding an existing game and there are several destructible doors in that game, but they never use a specific branch name. Instead they just generally refer to the next level as in levels.txt under the current branch.

An example would be:
spawn hit4
health 50
alias door
item branchall
coords 1190 450
at 0

What I would like to know is if I can connect such destructible door directly to a branch name.
I tried to replace branchall with branch (name). But that doesn't seem to work.

The idea is that you can escape from enemies by destroying the door.
 
@DonoVane,

Before you can use a branch {name}, you have to define the branch name for a given level set. You do this in the levels.txt file as part of the initial level definition.

Rich (BB code):
set    ^_The_Duel_Test_^
cansave 0
#maxplayers 1
lives   1
credits 3
nosame  1
typemp 2
z       184 240
branch theduel
file    data/levels/duel/duel.txt

Now you can use branch theduel in your item to jump into this level set.

The idea is that you can escape from enemies by destroying the door.

Branch items don't work that way. When manual says you touch them, by "touch" it means walking over as in a touch pickup item. If you want to trigger branch by attacking and destroying entities you'll need a script. You can use this code in the entity's on kill script:

C:
void main()
{
     char branch_name = "theduel"; // Branch name.
     int instant = 1; // 0 = Finish level first, 1 = Jump instantly.
     
     jumptobranch(branch_name, instant);
}
HTH,
DC
 
Back
Top Bottom