PDA

View Full Version : Entity triggers- Question



Cypher
30 Jul 2010, 01:27pm
I would like to know how to make it so specific entities trigger something, for exampl in ttt_thething, you need specific props to activate the button for the ufo, how would i make it so that, say, 6 gas canisters, and 6 propane tanls, were thrown into a fire for an auto-win event, but so that other props wouldnt trigger it, only the gas and propane.

Svendy
30 Jul 2010, 04:53pm
havent tested and havent done this in a while, but try something like this:

12 prop_physics_multiplayer with
name -> can_##

--------------------

trigger_multiple with
name -> trigger

OnTrigger | filter | TestActivator

--------------------

filter_activator_name with
name -> filter
filter name -> can_*

OnPass | counter | Subtract | 1

--------------------

math_counter with
name -> counter
max -> 12
init -> 12
min -> 0

OnHitMin | trigger | Kill
more outputs here...

Bob Loblaw
31 Jul 2010, 06:03am
Yeah I'd probably do it the way Svendy said or something very close.

Like he said:
12 props
Name: Winprops

Filter_activator_name
Name: Filter
Filter Mode: Allow
Filter Name: Winprops

Trigger_multiple
Filter Name: Filter
Outputs: Onstarttouch math Add 1

Math_counter
Name: math
Maximum legal value: 12
Outputs: Onhitmax Killtrigger Enable

The only thing you have to be careful with (for either of ours), is if the prop doesn't break when it goes into the fire, they may be able to take it out, and put it back in (essentially if they can just hold it, move it inside, then bring it out, then move it in, then bring it out, then move it in etc,- if they did it 12 times it would register it as if all 12 items had been brought together). So you may want to make sure they are broken if they get brought into the area.
You could get it so that it registers each object only once, but it would become a fairly convoluted process that I don't really recommend, especially since usually when things go into fire they get destroyed anyways, so it won't look very out of place to begin with.

**Both of our ways should work, just difference in preference really. I don't usually do much with TestActivator, I just set the triggers filter so it can only register the object. But again, preference :)**

Svendy
31 Jul 2010, 06:14am
even if the fire does not destroy the props, you could have another output like this

OnTrigger | !Activator | Kill

Bob Loblaw
31 Jul 2010, 06:19am
even if the fire does not destroy the props, you could have another output like this

OnTrigger | !Activator | Kill

Yeah that's what I was thinking.
Or if it was something like a pit that it had to get dropped into, that nobody could reach once it was dropped then there'd be nothing to worry about.

Cypher
3 Aug 2010, 03:18pm
well if you did something like in "thething, where the props snap into a position, it would work, but idk how to do that either

Bob Loblaw
4 Aug 2010, 02:35pm
well if you did something like in "thething, where the props snap into a position, it would work, but idk how to do that either

I don't know thething, so................................................ ................

Cypher
4 Aug 2010, 02:57pm
thething is the one with teh ufo, is the default map for our ttt server

Bob Loblaw
4 Aug 2010, 03:48pm
If you want help, you are going to have to stop talking about a map that I don't know.

It's very hard to know what you need, and tell you how to do it when you just keep referencing a map I've never played, assuming I'll know it, when in reality, I do not.

Svendy
4 Aug 2010, 11:34pm
i gotta agree with bob on this, we cant be sure what you want to achieve here. if you want it to disable motion, you call DisableMotion on the activator

Cypher
5 Aug 2010, 09:28am
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/eP9FndfalSg&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/eP9FndfalSg&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>

Could someone also tell me why my floor lags liek that? it only happens in singleplayer.

Bob Loblaw
5 Aug 2010, 12:26pm
I have no idea why the floor lags for you like that.

And tbh that looks like an entity specific to Gmod. An entity I've never seen before anyways.

I've never done anything with Gmod mapping so I'd have to look into what new entities they have.

Svendy might know though.

Cypher
5 Aug 2010, 02:05pm
Thats a motor from half life 2, also, if you notice in teh ufo cavern part, when you look at teh ghosted props, on the right there is an arctic player guy, you put a body there and it snaps there, same withthe melon to the melon, propane tank to propane tank, etc etc. so i don think it s specific to gmod, but i'll wait and see what svendy has to say about it.

Svendy
5 Aug 2010, 02:56pm
This might get a little long... Again not tested, so there might be some miner flaws, but it should give a rough indication of whats going on

Get X number of prop_physics_multiplayer.
Settings - Class Info:
- Name = _individual_name_pr_prop_
- World Model = _individual_model_pr_prop_
Settings - Outputs:
NONE

Get X number of prop_dynamic.
Settings - Class Info:
- World Model = _corresponding_to_the_physics_prop_
- Disable Shadows = Yes
- Name = _individual_name_pr_prop_
- Performance Mode = No Gibs
- FX Amount = 100
- Disable Receiving Shadows = Yes
- Collisions = Not Solid
Settings - Flags:
- Start with collision disabled
Settings - Outputs:
NONE

Get X number of trigger_multiple.
Settings - Class Info:
- Name = _individual_name_pr_trigger_
Settings - Outputs:
OnTrigger | _name_of_corresponding_filter_ | TestActivator

Get X number of filter_activator_name.
Settings - Class Info:
- Name = _individual_name_pr_filter_
- Filter Name = _corresponding_to_the_physics_prop_
Settings - Outputs:
OnPass | _name_of_corresponding_physics_prop_ | Kill
OnPass | _name_of_corresponding_dynamic_prop_ | EnableCollision
OnPass | _name_of_corresponding_dynamic_prop_ | EnableShadow
OnPass | _name_of_corresponding_dynamic_prop_ | Alpha | 255
OnPass | _name_of_math_counter_ | Add | 1
OnPass | _name_of_corresponding_trigger_ | Disable

Get 1 math_counter.
Settings - Class Info:
- Name = _name_
- Maximum Legal Value = _number_of_physics_props_
Settings - Outputs:
OnHitMax | <what_ever_the_hell_you_want_to_happen> <...>


ALSO
if i was you, i would go ingame on the map and enable the following console commands:
sv_cheats 1 -- Needed for the next command
ent_messages_draw 1 -- This will show all inputs/outputs as drawn lines and the command thats called, VERY useful!

Cypher
5 Aug 2010, 05:07pm
en_message_draw 1, is that so, if something goes wrong, i know what? or what...

Svendy
5 Aug 2010, 05:36pm
it shows what is being called from where and to what,i use it a lot to check my i/o calls

Bob Loblaw
7 Aug 2010, 08:18am
That's pretty much the route I would have taken Svendy, although that doesn't look like it'll snap the prop into place(?) I read it briefly.
I just thought maybe there was a specific way to do it with some logic entity or something I was unaware of lol.

Svendy
7 Aug 2010, 03:01pm
i think this would be the easiest way, though you might be able to add a world translation to the model using a logic_lineto. but i'm not too sure, i've never had any use of this entity yet

also it could look like it 'snaps' with the trigger is small enough :P