Raised This Month: $ Target: $400
 0% 

Entity touch floor doens't work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 08-11-2013 , 03:14   Entity touch floor doens't work?
Reply With Quote #1

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.

Last edited by Randomize; 08-11-2013 at 03:14.
Randomize is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-11-2013 , 03:25   Re: Entity touch floor doens't work?
Reply With Quote #2

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
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 08-11-2013 , 03:33   Re: Entity touch floor doens't work?
Reply With Quote #3

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

Last edited by Randomize; 08-12-2013 at 00:25.
Randomize is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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