Local Branching help!

dantedevil

Well-known member
First to all, I read this tutorial:
http://www.chronocrash.com/forum/index.php?topic=31.msg86#msg86

This is the first time I'm work with Branches and can't undestand how really works.

I have a level with two branchs in the end:
Code:
group   1 1
at      2020

spawn  GO_4-2
@script
void main()
{
    void self = getlocalvar("self");

    changeentityproperty(self, "position", 2330);
}
@end_script
coords  325 215
at      2020

spawn  GO_4-2b
@script
void main()
{
    void self = getlocalvar("self");

    changeentityproperty(self, "position", 2475);
}
@end_script
coords  460 270
at      2020
This branches appears when all enemies are dead.

The branches are:
GO_4-2  to the stage4-2 and GO_4-2b  to the stage 4-2b

When touch the branches, both lead me to the level stage4-2.

Here the file of the two brances:
Code:
name	 GO_4-2
type	 endlevel
shadow	 0
branch	 Stage4-2


anim idle
	loop	0
	delay	10
	offset	76 150
	bbox	65 106 21 44
	frame	data/bgs/branches/arrow_up.png

Code:
name	 GO_4-2b
type	 endlevel
shadow	 0
branch	 Stage4-2b

anim idle
	loop	0
	delay	10
	offset	61 64
	bbox	65 106 21 44
	frame	data/bgs/branches/arrow_right.png


And here the set in levels.txt:

Code:
z 215 270 215 #4-1
file	data/levels/stage4-1.txt
next
branch	GO_4-2
z 233 270 233 #4-2
file	data/levels/stage4-2.txt

branch	GO_4-2B
z 200 270 200
file	data/levels/stage4-2b.txt
next

z 215 270 215 #4-2 
file	data/levels/stage4-3.txt
next

What am I doing wrong?
I watched as they did in the mod Crime Buster and Golden Axe and Legend, but frankly do not understand.
 
Why does position have only x value? Since you script that, you're not specifically using z and y there. So, that means x is located according to the x position value you input, but not z and y. It cannot tell where y and z are called. Look at this here for example:

Code:
spawn roper
@script
void main()
{
    void self = getlocalvar("self");
    changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
    changeentityproperty(self, "position", 955, 246, 111);
}
@end_script
map 2
coords 214 246 111
at 750

Otherwise, why not use NULL() for both z and y position?

EDIT: I think z and y don't have to be NULL(). Those can have 0 values for both.
 
About the script,  I use the script of  Bloodbane give me in this topic:
http://www.chronocrash.com/forum/index.php?topic=2449.msg33824#msg33824

But I think that's not the problem in my case.
Like you see in my post, my problem is:
I have two branches in the end of the stage 4-1, with different destinations.
One goes to the stage 4-2 and the other goes to the stage4-2b. But for some reason both goes to the stage4-2 only.
Thats my problem.
 
Finally find the error!

Here when says : Stage4-2
Code:
name	 GO_4-2
type	 endlevel
shadow	 0
branch	 Stage4-2

anim idle
	loop	0
	delay	10
	offset	76 150
	bbox	65 106 21 44
	frame	data/bgs/branches/arrow_up.png
Must say the same of the this line:
branch GO_4-2
Code:
branch	GO_4-2
z 233 270 233 #4-2
file	data/levels/stage4-2.txt
 
Back
Top Bottom