Bloodbane
Well-known member
I had to find decent mod for my experiment, finally found one project I scrapped years ago. Please ignore the character I'm using in the demo 
Back to topic, my experiment worked and here's the result:
I'm using this onmoveascript:
This script finds platform above character when jumping or moving up. If the platform is passable i.e has Slip as its alias, it will disable subject_to_platform to allow passing from below. If the platform is not, nothing is done and hithead happens
Another script in character's JUMP animation reenable subject_to_platform to allow character to land after passing through
The script only reenable when falling down to prevent conflict with previous script
Similar check script is declared in character's SLIDE to allow/disallow dropping off platform.
TBH this one is crude & simple cause I don't change the animation to other animation (like I did to some characters in Castlevania Collab)
Like I posted, this script system is experimental and most likely need more stabilizers
I'd stack some thin solid platforms to create stairs and use some script to allow walking on stairs
I forgot to explain a detail:
100 is from character's height + platform thickness + extra pixels.
Platform thickness is thickness of passable platform, it shouldn't be calculated anymore since it's very small i.e just one pixel. Extra pixels could be any value to ensure checkplatform checks above platform.
You can use smaller value than 100 if your character is shorter
Back to topic, my experiment worked and here's the result:
I'm using this onmoveascript:
Code:
void main()
{
void self = getlocalvar("self");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "y");
int z = getentityproperty(self, "z");
int Vy = getentityproperty(self,"tossv");
void vAniID = getentityproperty(self,"animationID");
void Plat = checkplatformbelow(x, z, y+100);
void Plat2 = checkplatformbelow(x, z, y+1);
if(Plat && Vy > 0 && Plat!=Plat2){
char PName = getentityproperty(Plat, "name");
if(PName=="Slip"){
changeentityproperty(self, "Subject_to_Platform", 0);
}
}
}
This script finds platform above character when jumping or moving up. If the platform is passable i.e has Slip as its alias, it will disable subject_to_platform to allow passing from below. If the platform is not, nothing is done and hithead happens
Another script in character's JUMP animation reenable subject_to_platform to allow character to land after passing through
Code:
anim jump
@script
void self = getlocalvar("self");
int Vy = getentityproperty(self, "tossv");
if(Vy < 0){
changeentityproperty(self, "Subject_to_Platform", 1);
}
@end_script
...
The script only reenable when falling down to prevent conflict with previous script
Similar check script is declared in character's SLIDE to allow/disallow dropping off platform.
Code:
anim slide
@script
void self = getlocalvar("self");
int x = getentityproperty(self, "x");
int y = getentityproperty(self, "a");
int z = getentityproperty(self, "z");
void Plat = checkplatformbelow(x, z, y+2);
if(getentityproperty(Plat,"name")=="Slip"){
if(y > 0 && frame == 0){
changeentityproperty(self, "Subject_to_Platform", 0);
}
}
@end_script
delay 1
offset 46 97
bbox 31 41 32 56
frame data/chars/tunas/walk3.png
delay 10
frame data/chars/tunas/walk3.png
@cmd platform 1
frame data/chars/tunas/walk3.png
TBH this one is crude & simple cause I don't change the animation to other animation (like I did to some characters in Castlevania Collab)
Like I posted, this script system is experimental and most likely need more stabilizers
I would like to know if there is how to create some kind of floating basemap platform, such as this ladder in the air of the image.
I'd stack some thin solid platforms to create stairs and use some script to allow walking on stairs
I forgot to explain a detail:
Code:
void Plat = checkplatformbelow(x, z, y+100);
100 is from character's height + platform thickness + extra pixels.
Platform thickness is thickness of passable platform, it shouldn't be calculated anymore since it's very small i.e just one pixel. Extra pixels could be any value to ensure checkplatform checks above platform.
You can use smaller value than 100 if your character is shorter