AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   How to create a "trigger" entity in running time? (https://forums.alliedmods.net/showthread.php?t=69795)

jopmako 04-11-2008 13:44

How to create a "trigger" entity in running time?
 
I'm planning to create "trigger" entity such as "trigger_proximity", "trigger_multiple"...., in running time.

How to do that or it's impossible?

Thanks.

BAILOPAN 04-11-2008 16:56

Re: How to create a "trigger" entity in running time?
 
If the entity type exists you can spawn it, but if it's not networkable sourcemod can't use it yet.

L. Duke 04-11-2008 17:08

Re: How to create a "trigger" entity in running time?
 
I think that most trigger_ and func_ entities are tied to a brush in the bsp file. Entities tied to a brush can't be spawned dynamically, only built into the map.

Find an entity in the entity list of the type you want and check it's model name. I believe an entity tied to the world will have a number for the model name (something like "*8" or "8*" instead of "models/path/modelname.mdl").

Peoples Army 04-11-2008 17:32

Re: How to create a "trigger" entity in running time?
 
PHP Code:

 
m_nModelIndex        is an integer 
 
m_ModelName          is a string 


L. Duke 04-11-2008 17:49

Re: How to create a "trigger" entity in running time?
 
Right. So you'd be looking to see if m_ModelName is something like *8.

For example, on of the trigger_multiple entities in cs_office has the model name of "*18" which shows that it is a brush based entity and therefore can't be spawned dynamically.

Peoples Army 04-11-2008 18:02

Re: How to create a "trigger" entity in running time?
 
no you got it backwords . m_ModelName is a string "models/player/t_arctic.mdl"

if your looking for the integer index for the model it would be

m_nModelIndex

L. Duke 04-17-2008 12:25

Re: How to create a "trigger" entity in running time?
 
Yes, that's exactly what I said. :)

If the string in m_ModelName is "models/somemodel.mdl" then you have an entity that is not tied to the bsp, but can be spawned dynamically. But, if m_ModelName is a string such as "*8" or "*17" then it is tied to a brush in the bsp. Trigger_multiple is an example of one entity that is tied to a brush like this.

If you want to create a trigger, you'll have to set one up in code. Set a min/max vector to define an area and then check every 0.X seconds if any players origin is in that area.

Fredd 04-18-2008 21:08

Re: How to create a "trigger" entity in running time?
 
Quote:

Originally Posted by Peoples Army (Post 609982)
no you got it backwords . m_ModelName is a string "models/player/t_arctic.mdl"

if your looking for the integer index for the model it would be

m_nModelIndex

no he doesnt have it backwards. its right model index is basically the index id of the entity, " *8 " is not an index, if you make a loop on all entities and return their model names(not model index) you will get numbers like " *1" and such in the returned string which what LDuke said it makes it a brushed entity..

V0gelz 05-01-2008 05:59

Re: How to create a "trigger" entity in running time?
 
Can someone make me an example how to make a brush entity?
Because i have no clue how to set the vecmax/min of the brush box and how to set the modelname is getting me confused lol.
I know this is kinda an old post sorry. But wanna know more about brush entitys

Thanks in advance
V0gelz

Fredd 05-01-2008 09:56

Re: How to create a "trigger" entity in running time?
 
you can't make brushed entities from SourceMod, it just ain't possible.


All times are GMT -4. The time now is 11:14.

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