AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity (https://forums.alliedmods.net/showthread.php?t=301311)

artist 09-16-2017 05:24

EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
How to make traces ignore user objects?

Create "info_target" object, i ask him:
PHP Code:

set_pev(entpev_flagsFL_MONSTER

Further I do a trace:
PHP Code:

engfunc(EngFunc_TraceLinestartendIGNORE_MONSTERSent0

She ignores me, and the same objects - no.

PRoSToTeM@ 09-16-2017 07:57

Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
Change entity solid to SOLID_NOT and restore it after trace.

artist 09-16-2017 08:40

Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
Я проверял, ставил 2х ботов, от одного к другому трейс пускал, вставал между ними - и трасса проходила до конца(игнорируя меня).
Искал в SDK, что бы такого объекту установить, чтобы его тоже игнорировало - ничего.
Костыль я придумал уже, это просто продолжать трассу после объекта, но интересно же без него.


I checked, put 2 bots, from one to the other, trace let go, got up between them - and the route passed to the end (ignoring me).
I was looking for the SDK to install such an object so that it would also be ignored - nothing.
I thought up a crutch already, it's just to continue the track after the object, but it's interesting without it.

Natsheh 09-16-2017 10:26

Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
Quote:

Originally Posted by PRoSToTeM@ (Post 2549076)
Change entity solid to SOLID_NOT and restore it after trace.

You know its better to remove the entity flag FL_MONSTER and reset it again after doing the trace

PRoSToTeM@ 09-16-2017 12:02

Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
Quote:

Originally Posted by Natsheh (Post 2549094)
You know its better to remove the entity flag FL_MONSTER and reset it again after doing the trace

First of all FL_MONSTER doesn't work here, because ignoremonsters flag checks for MOVETYPE_PUSHSTEP. But this flag works only on non-SOLID_BSP entities, so this way isn't universal. Secondly there is no difference between changing FL_MONSTER flag, movetype or solid because you need to restore it, so anyway you need to store the old value.

Natsheh 09-16-2017 12:57

Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
Quote:

Originally Posted by PRoSToTeM@ (Post 2549104)
First of all FL_MONSTER doesn't work here, because ignoremonsters flag checks for MOVETYPE_PUSHSTEP. But this flag works only on non-SOLID_BSP entities, so this way isn't universal. Secondly there is no difference between changing FL_MONSTER flag, movetype or solid because you need to restore it, so anyway you need to store the old value.

You are maybe right there is no difference,
But still i am not sure if it doesnt work, so i might give it several tests and see...

artist 09-16-2017 13:40

Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
Quote:

Originally Posted by PRoSToTeM@ (Post 2549104)
First of all FL_MONSTER doesn't work here, because ignoremonsters flag checks for MOVETYPE_PUSHSTEP. But this flag works only on non-SOLID_BSP entities, so this way isn't universal. Secondly there is no difference between changing FL_MONSTER flag, movetype or solid because you need to restore it, so anyway you need to store the old value.

PHP Code:

set_pev(entpev_movetypeMOVETYPE_PUSHSTEP)
set_pev(entpev_solidSOLID_BBOX

Так у меня оно так и есть.
Но трасса прерывается упершись в этот объект.

So at me it indeed is.
But the route is interrupted by leaning against this object.

PRoSToTeM@ 09-16-2017 14:11

Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
@artist you should change it to SOLID_NOT before trace and restore after trace.

artist 09-16-2017 14:33

Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
 
Да это на форуме вопрос задали, чтобы несколько объектов бежали за игроком(заинтересовал игнор в трейсе, никогда им не пользовался)...
Тогда и мой вариант сойдет...
Спасибо за уделённое время. ))

Yes it is on the forum question asked that several objects were running behind the player (interested ignore in the trace, never used it)...
Then my version will come down...
Thank you for your time. ))

PHP Code:

stock bool:is_visible_ignore_players(indexentity)
{
    static 
Float:start[3]; pev(indexpev_originstart)
    static 
Float:end[3]; pev(entitypev_originend)
    
    
engfunc(EngFunc_TraceLinestartendDONT_IGNORE_MONSTERSindex0)

    static 
pHitpHit get_tr2(0TR_pHit)
    
    if(!
is_valid_ent(pHit)) return false
    
    
static bool:retret false
    
    
if(pHit == entity) return true
    
else if(is_user_alive(pHit)) ret is_visible_ignore_players(pHitentity)
    return 
ret




All times are GMT -4. The time now is 17:51.

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