Raised This Month: $ Target: $400
 0% 

Questions about preThink and entity thinking


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
KCE
Senior Member
Join Date: Jan 2005
Location: Los Angeles, CA
Old 09-17-2005 , 14:48   Please
Reply With Quote #6

I reallly need to know the answer to these questions please. I know one of you devs know it

Basically I'm trying to detect an entity being created and replacing that entity with another one, when a player fires their weapon (its a grenade launcher). I want the fastest but most efficient method, so their's less delay when they're grenade is switched. I tried to check when entity's are spawned so I hooked FM_CreateEntity, which was able to catch the grenade being created but all the values I got with entity_get_int were 0 so I couldn't find out who fired it.

I'm deciding whether to use player think (not prethink), or prethink. I want to know which one is more efficient to use. Currently I'm using the player think since its called in engine so its less laggy then prethink. Though If I were to hook FM_PlayerPreThink, it would be like PrePlayerPreThink, since the hook is executed before the real thing, which could probably be the fastest check.
  • 1. Are fakemeta hooks to FM_Think and the engine forward pfn_think, called in the engine?

    2. Lynx, are you sure prethink is not called in the engine? Doesn't seem to make sense that the player think (not prethink) is called in engine but the prethink is not, unless the prethink method was made by amxmodx and its not an engine native like normal thinks are. Likewise for postthink also I guess.

    3. BTW, the FL_ALWAYSTHINK flag does not seem to work, I tried everything including setting other flags. I registered a think to the entity and it was never called. Maybe it can only use generic think like FM_Think or pfn_think? Does this have something to do with the ltime being set?

Correct me if I'm wrong.
KCE is offline
 



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 14:24.


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