O Ilusionista
Captain 100K
This code let you force a branch jump if you fall into a specific type hole.
For memory sake, we need to use two files - one is just to import the second, to avoid the code to be compiled again each time you add on a new entity.
1- Save it as checkhole.c in your scripts folder
• checkhole.c
• checkhole_actual.c
2- Call this script in your character header
3- Set the hole TYPE. Works only in build 4287 and beyond.
For example, here is mine
To add more options, just copy this part, change the values and paste before the "default" line:
The number 2 is an integer, so it should not be between quotes, ok?
For memory sake, we need to use two files - one is just to import the second, to avoid the code to be compiled again each time you add on a new entity.
1- Save it as checkhole.c in your scripts folder
• checkhole.c
Code:
#import "data/scripts/checkhole_actual.c"
void main()
{
actual_main();
}
• checkhole_actual.c
Code:
// Jump to a specific branch based on hole type
// Thanks Bloodbane and White Dragon for the help
// Douglas Baldan / O Ilusionista - 2018.07.28
// www.brazilmugenteam.com
void actual_main()
{
int Type = getlocalvar("type"); // Get hole type
void self = getlocalvar("self"); // Get caller
int y = getentityproperty(self,"y"); // Get Y pos
int HP = getentityproperty(self,"health"); // Get caller health
int Vy = getentityproperty(self,"tossv"); // Get Y velocity
if (Vy < 0 && y < -60 && HP > 10)
{
switch(Type)
{ // check the hole Type
case 1 : // Type 1
jumptobranch("branch1", 1); // change "branch1" for the desired branch name, between quotes
break;
case 2 : // Type 2
jumptobranch("branch2", 1); // change "branch2" for the desired branch name, between quotes
break;
//just copy and past the block above and change its value for more options
default : // in case of none of above, continue with the normal behaviour (die)
break;
}
}
}
2- Call this script in your character header
inholescript data/scripts/checkhole.c
3- Set the hole TYPE. Works only in build 4287 and beyond.
hole {xpos} {zpos} {upperleft} {lowerleft} {upperright} {lowerright} {depth} {alt} {type}
For example, here is mine
hole 549 287 -180 -290 276 385 100 200 1
To add more options, just copy this part, change the values and paste before the "default" line:
Code:
case 2 : // Type 2
jumptobranch("branch2", 1); // change "branch2" for the desired branch name, between quotes
break;
The number 2 is an integer, so it should not be between quotes, ok?