AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entity touch floor doens't work? (https://forums.alliedmods.net/showthread.php?t=223211)

Randomize 08-11-2013 03:14

Entity touch floor doens't work?
 
I have trouble with entity. I detect it touches the floor using this:
PHP Code:

register_touch("c5_entity""worldspawn""fw_c5Bounce"

Another question:
1. I make an entity to can be shot. I use SOLID_BBOX it works but if when I throw the entity, the entity stuck at my origin and I can't move so I make it SOLID_NOT but can't be shot. How is the solution?

2. I want to make the entity rotate while bouncing when touch the floor and I use MOVETYPE_TOSS, if I use MOVETYPE_BOUNCE it don't want to stop bouncing?

3. How can I set the entity on wall if I throw it touches the wall?

Thank you.

ConnorMcLeod 08-11-2013 03:25

Re: Entity touch floor doens't work?
 
1. SOLID_BBOX is correct, you have to set pev_owner to the player index who is throwing it so player doesn't collide with entity
2. You may have forgotten to set pev_gravity in order to work fine with MOVETYPE_BOUNCE
3. Don't understand, you want to block the entity on the wall when wall is touched ? then you can try to set at touch MOVETYPE_NONE

Randomize 08-11-2013 03:33

Re: Entity touch floor doens't work?
 
I use engine.
How many value must I set in gravity?

PHP Code:

        entity_set_int(c5_entityEV_ENT_ownerid)
        
entity_set_int(c5_entityEV_INT_solidSOLID_BBOX)
        
entity_set_int(c5_entityEV_INT_movetypeMOVETYPE_BOUNCE)
        
entity_set_float(c5_entityEV_FL_gravity1.0

Number 3, I mean I can set the entity on wall when the entity touches the wall. (The entity puts on the wall)

PHP Code:

register_touch("c5_entity""func_wall""fw_c5TouchWall"

PHP Code:

public fw_c5TouchWall(idc5_entity)
{
    if( ~
get_entity_flags(id) & FL_ONGROUND )
    {
        new 
Float:fVel[3]
        
entity_get_vector(c5_entityEV_VEC_velocityfVel)
        
entity_set_vector(c5_entityEV_VEC_anglesFloat:{5.01.00.0})
    }


EDIT: 1. SOLVED with what Connor said. 2. The entity lost. O.O


All times are GMT -4. The time now is 15:52.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.