Raised This Month: $51 Target: $400
 12% 

EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
artist
Member
Join Date: Nov 2013
Old 09-16-2017 , 05:24   EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #1

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.
artist is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-16-2017 , 07:57   Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #2

Change entity solid to SOLID_NOT and restore it after trace.
__________________

Last edited by PRoSToTeM@; 09-16-2017 at 07:58.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
artist
Member
Join Date: Nov 2013
Old 09-16-2017 , 08:40   Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #3

Я проверял, ставил 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.

Last edited by artist; 09-16-2017 at 08:42.
artist is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-16-2017 , 10:26   Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #4

Quote:
Originally Posted by PRoSToTeM@ View Post
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
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-16-2017 , 12:02   Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
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.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Natsheh
Veteran Member
Join Date: Sep 2012
Old 09-16-2017 , 12:57   Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #6

Quote:
Originally Posted by PRoSToTeM@ View Post
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...
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
artist
Member
Join Date: Nov 2013
Old 09-16-2017 , 13:40   Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #7

Quote:
Originally Posted by PRoSToTeM@ View Post
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.
artist is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-16-2017 , 14:11   Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #8

@artist you should change it to SOLID_NOT before trace and restore after trace.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
artist
Member
Join Date: Nov 2013
Old 09-16-2017 , 14:33   Re: EngFunc_TraceLine(IGNORE_MONSTERS) and custom entity
Reply With Quote #9

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

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


Last edited by artist; 09-16-2017 at 14:36.
artist 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 09:35.


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