If airborne help

PS_VITA

Active member
Hi
I'm using a conveyor belt code that pushes the player
to the right if he lands on it. Is there a way to modify it to only push the player to the right if he happens to be airborne or on a jumping status?


Example:
Code:
   changeentityproperty(ventity, "position", ex+5);   

So instead of position I want to modify it to an airborne property.
 
Get difference between entity's base and its Y position. If the difference meets a certain threshold, the entity is airborne. This is the engine's internal air check function to give you an idea:

Code:
int inair(entity *e)
{
    return (diff(e->position.y, e->base) >= 0.1);
}

DC
 
Damon Caskey said:
Get difference between entity's base and its Y position. If the difference meets a certain threshold, the entity is airborne. This is the engine's internal air check function to give you an idea:

Code:
int inair(entity *e)
{
    return (diff(e->position.y, e->base) >= 0.1);
}

DC

Thank you DC,

Since that part of the stage I was creating happen to be in a 2d like platform style I ended up using your idea but with a y value of the stage.

         
Code:
if(Direction == 1 && Ex >= 755 && Ex <= 870 && Ez >= 734 && Ez <= 810 && Ey >= 70 && Ey <= 110){

but some where along the road I would love to learn how to properly implement it with stages that have  wide floor stages.
 
PS VITA : you should post the whole script of this conveyor belt.

For now I assume it's based on conveyor belt I've coded years ago  8)

This part of the script:
if(Direction == 1 && Ex >= 755 && Ex <= 870 && Ez >= 734 && Ez <= 810 && Ey >= 70 && Ey <= 110){

defines the area where belt effect applies. You only need to modify orange text for x limits and green texts for z limits.
As for airborne status, you'd need to modify teal texts. I'm not sure why yours is set like in above but if you want belt to apply on airborne only entities, Ey > 0 should be enough and no need Ey <= 110 part.
 
Bloodbane said:
PS VITA : you should post the whole script of this conveyor belt.

For now I assume it's based on conveyor belt I've coded years ago  8)

This part of the script:
if(Direction == 1 && Ex >= 755 && Ex <= 870 && Ez >= 734 && Ez <= 810 && Ey >= 70 && Ey <= 110){

defines the area where belt effect applies. You only need to modify orange text for x limits and green texts for z limits.
As for airborne status, you'd need to modify teal texts. I'm not sure why yours is set like in above but if you want belt to apply on airborne only entities, Ey > 0 should be enough and no need Ey <= 110 part.

Hi Bloodbane , I found the script in  Double dragon reloaded. And thank you for creating it. I will modify it accordingly since  upon a second glance it makes sense not to include that extra Y value part.

Thanks
 
Back
Top Bottom