Detect ground / land

O Ilusionista

Captain 100K
How do I check if my player is at the ground?
Example:

I spawn a dust fx when the char does a sliding attack, but if he jumps from a platform/wall using this move, the dust fx should appear ONLY while he is over the groud/platform/wall, not while he is on the air.

I know I can check his a position, but when he is over a platform, his "a" position is not 0, but its added the platform position.
 
O Ilusionista said:
I know I can check his a position, but when he is over a platform, his "a" position is not 0, but its added the platform position.

I would like to know about it too.
the fact top of platform is not detected as a real floor position causes simillar problem to my blood drop effect.
The blood drops trough the ring and hit gounds only when it reaches the real ground (0) Y level.
 
well by script if your entity is set to "no_adjust_base" 0 you can detect the base with:

float a = getentityproperty(self,"a");
float base = getentityproperty(self,"base");
if ( a <= base ) { // is on ground
  ... ... ...
}
 
It works:

void self = getlocalvar("self");
float a = getentityproperty(self,"a");
float base = getentityproperty(self,"base");

if(frame >= 1){
if ( a <= base ) { // is on ground
  killentity(self);
}
}

But I archieved the same effect just using landframe (frame 4 is an empty frame):

@script
if(frame == 4){
void self = getlocalvar("self");
killentity(self);
}
@end_script


I haven't tested it over platform, but SHOULD work.
Sometimes we forgot the KISS principle :)
 
Back
Top Bottom