Raised This Month: $ Target: $400
 0% 

Entity Problems [Collision]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
m4m3ts
Senior Member
Join Date: Jun 2012
Old 02-27-2015 , 02:44   Entity Problems [Collision]
Reply With Quote #1

i want to hit through multiple player with entity, it have beamfollow.
when i set low velocity such as 500.0 its work great, the entity go through and correctly hit player and not blocking

but when i set velocity 9999.0
the entity can go through player but its not hit the player.
maybe because SOLID_TRIGGER checking time is slow.

please help...how to hit the player even i set high velocity ?

(i've set sv_maxvelocity 9999, but no effect)

here is some of my code

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <engine>
 
public plugin_init()
{
    
register_clcmd("create""Throw_entity")
    
register_touch("entity_class""*""fw_touch")
}

public 
Throw_entity(id)
{
    new 
Float:origin[3],Float:velocity[3],Float:angles[3]
    
engfunc(EngFunc_GetAttachmentid0origin,angles)
    
pev(id,pev_angles,angles)
    new 
ent create_entity"info_target" 
    
set_peventpev_classname"entity_classname" )
    
set_peventpev_solidSOLID_TRIGGER )
    
set_peventpev_movetypeMOVETYPE_FLY )
    
set_peventpev_mins, { -0.1, -0.1, -0.1 } )
    
set_peventpev_maxs, { 0.10.10.1 } )
    
entity_set_modelent"some grenade model" )
    
set_peventpev_originorigin )
    
set_peventpev_anglesangles )
    
set_peventpev_ownerid )
    
//velocity_by_aim( id, 500.0, velocity ) // this is works well because of low velocity
    
velocity_by_aimid9999.0velocity // entity wont touched, because of high velocity
    
set_peventpev_velocityvelocity )
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMFOLLOW// Temporary entity ID
    
write_short(ent// Entity
    
write_short("sprite_name"// Sprite index
    
write_byte(10// Life
    
write_byte(3// Line width
    
write_byte(255// Red
    
write_byte(255// Green
    
write_byte(255// Blue
    
write_byte(50// Alpha
    
message_end() 
    return 
PLUGIN_CONTINUE
}

public 
fw_touch(EntId)
{
    if(!
pev_valid(Ent))
        return

    if(
is_user_alive(Id))
    {
        
client_print(0print_chat"entity touched player")
    }
    else 
    {
        
client_print(0print_chat"player not touched")
    }

__________________

Last edited by m4m3ts; 02-27-2015 at 02:50.
m4m3ts is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 02-27-2015 , 09:35   Re: Entity Problems [Collision]
Reply With Quote #2

It's normal, blame the engine think time for this. As I've mentioned before, SOLID_TRIGGER and very fast speed don't go along very well.

EDIT: Use SOLID_BBOX to make sure it hit(tested), then try to teleport your entity behind the player and set its speed.
__________________
Currently offline for study.

Last edited by RateX; 02-27-2015 at 09:37.
RateX is offline
m4m3ts
Senior Member
Join Date: Jun 2012
Old 02-28-2015 , 20:15   Re: Entity Problems [Collision]
Reply With Quote #3

Quote:
Originally Posted by RateX View Post
It's normal, blame the engine think time for this. As I've mentioned before, SOLID_TRIGGER and very fast speed don't go along very well.

EDIT: Use SOLID_BBOX to make sure it hit(tested), then try to teleport your entity behind the player and set its speed.
to teleport to the right origin we have to make sure and detect origin that entity not stucked in player body after hit them, how to do that ?, and how get origin behind player ?
give me some code..
i think it on fw_touch

PHP Code:
public fw_touch(EntId)
{
    if(!
pev_valid(Ent))
        return
    
    if(
is_user_alive(Id))
    {
        
client_print(0print_chat"entity touched player")
    }
    
    
set_pev(Entpev_origin, ??)

__________________

Last edited by m4m3ts; 02-28-2015 at 21:18.
m4m3ts is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 02-28-2015 , 22:48   Re: Entity Problems [Collision]
Reply With Quote #4

You can take a look at Arkshine's code of getting wall thickness. Then, either you plus the thickness with the touch origin or get the origin behind the player directly.
__________________
Currently offline for study.
RateX is offline
m4m3ts
Senior Member
Join Date: Jun 2012
Old 03-01-2015 , 00:08   Re: Entity Problems [Collision]
Reply With Quote #5

Quote:
Originally Posted by RateX View Post
You can take a look at Arkshine's code of getting wall thickness. Then, either you plus the thickness with the touch origin or get the origin behind the player directly.
i think your method is not good, because of spawning solid_bbox directly behind the player.
think if the enemy target is 4 in a row, each player stand very close.
the entity will spawn too fast behind the last player.
__________________
m4m3ts is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 03-01-2015 , 00:57   Re: Entity Problems [Collision]
Reply With Quote #6

I don't understand the problem. Correct me if I'm wrong, but the process with be repeat upon touching the next player.
BTW, since you are using very fast speed(9999.0 in your first post), you might as well consider using traceline instead.
__________________
Currently offline for study.

Last edited by RateX; 03-01-2015 at 01:02.
RateX 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 06:08.


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