Raised This Month: $ Target: $400
 0% 

Need to easify an insane Function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-01-2006 , 07:20   Need to easify an insane Function
Reply With Quote #1

The Title of this Thread was "All about Entities...".
The Problem was solved, but I got a new Problem and did not want
to create a new Thread. See Post #42 for the new Problem.
Between below here and Post #42 is the Stuff from the previous Problem...


Okay, I need to know how:
- Execute a public function when an entity is triggered and get the ent-id.
- Then read the entities classname.
- Then read keys with their values from the entity.
- Then find entities by targetname (NOT classname) and trigger them.

Thanks in advance!
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 10-07-2006 at 16:24.
Silencer123 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-01-2006 , 08:04   Re: All about Entities...
Reply With Quote #2

Did you tried http://www.amxmodx.org/funcwiki.php ?
1. FM_Spawn?
2. pev(ent, pev_classname, ...)?
3. key value data or pev (for the last see #2)?
4. engfunc(EngFunc_FindEntityByString, -1, "targetname", "my_targetname")?
VEN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-01-2006 , 08:36   Re: All about Entities...
Reply With Quote #3

FM_Spawn is called when entitiy spawns, not when it is triggered. :/
EDIT: btw I was thinking of a Plugin which allows you to have new entities.
For example amx_trigger_countdown where you have a key value for time
and all those for how and where the hudmessage shall appear and what shall
be triggered if time is up but abort the countdown if the entity is triggered again.
With your words I sadly cannot create more than this:
Code:
/* Entity Addon by Silencer. ** Allows you to do more in game. ** You need to copy the following lines to the end of your *.fgd's: --- To do: Add new entities for *.fgd here --- ** STOP COPYING ONE LINE ABOVE HERE +++ STOP COPYING ONE LINE ABOVE HERE +++ STOP COPYING ONE LINE ABOVE HERE **/ #include <amxmodx> #include <fakemeta> #define VERSION "1.0" new all_entities[65][33] new position new bool:fatal_error public plugin_init() {     register_plugin("Entity Addon",VERSION,"Silencer")     register_forward(FM_Spawn,"EA_Check") } public EA_Check(ent) {     new classname[32]     pev(ent,pev_classname,classname)     if(equali(classname,"amx_trigger_countdown"))     {         if(position>=64)         {             server_print("[ENTITY ADDON] Error: Map is using more than 64 'Entity Addon' Entities!")             fatal_error=true         }         else         {             all_entities[position][32]=classname[31]             position+=1         }     } }
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 10-01-2006 at 09:03.
Silencer123 is offline
Old 10-01-2006, 10:38
VEN
This message has been deleted by VEN. Reason: ill think about it more and then repost maybe
VEN
Veteran Member
Join Date: Jan 2005
Old 10-01-2006 , 10:45   Re: All about Entities...
Reply With Quote #4

Quote:
FM_Spawn is called when entitiy spawns, not when it is triggered. :/
Because you said "an" instead of "and" i missed your point. i though you want to catch the moment when the entity is recieved index, i.e. created. :/
VEN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-01-2006 , 11:00   Re: All about Entities...
Reply With Quote #5

My bad!
But how do I call a Function when an entity is triggered and get the ent-id then?
If there is no way I had to totally rebuild the Maps Entity System which I do not want to do.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-01-2006 , 11:37   Re: All about Entities...
Reply With Quote #6

triggered == used. I can't remember now whether this valid for all triggers or not, but for example: on de_vertigo when you falling you touch invisible trigger that trigger (use) ambient_generic entity that emit sound.
(i'm not mean actual "+use" command but game engine's pfnUse).
But here is the problem: FM_Use is never called. It's not a bug (search for more info in this issue if interested).

EDIT: It may be that i messed the "triggered entity" term. I assumed that it is the trigger entity that is triggered the other entity (not the other entity that is triggered the trigger).

Last edited by VEN; 10-01-2006 at 11:48.
VEN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-01-2006 , 13:16   Re: All about Entities...
Reply With Quote #7

Lets say a Map contains a trigger_auto.
5 Seconds after Map Start it triggers an Entity.
That is the moment in which my Plugin shall find out everything about the triggered/targeted Entity.
And if there seriously is no easy Function included in AMXModX which is called when an Entity
is triggered then I will fall off my chair, because Entites are goddamn important.
EDIT: I also need to know how to read spawnflags!
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 10-01-2006 at 18:29.
Silencer123 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-02-2006 , 03:39   Re: All about Entities...
Reply With Quote #8

variable = pev(ent, pev_spawnflags) ?
VEN is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-02-2006 , 03:54   Re: All about Entities...
Reply With Quote #9

Thanks, but my idea seems to be impossible since it is said Entity Triggering
cannot be hooked to a Function. Makes me sad!

I even started making Sprites for 3D View in VHE.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-02-2006 , 09:30   Re: All about Entities...
Reply With Quote #10

I got an idea, but there is no function to find an entid by target. @_@
I tried http://www.amxmodx.org/funcwiki.php?go=func&id=346 but you
cannot define a target to search for in there (should be fixed/finished maybe)
__________________
EAT YOUR VEGGIES
Silencer123 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 04:47.


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