Jump to content
Sign in to follow this  
frederf

Trigger Visual Effects affect only those in trig?

Recommended Posts

I have a trigger that surrounds the respawn in a multiplayer map. It's job is simply to use a visual effect like BLACK OUT or WHITE IN or something to simulate whatever coming back from the dead.

It works great ... too great. Everyone everywhere sees the effect regardless of where they are or even if an AI flys through the trigger.

Is there a way to localize the visual effects to just one unit? I have a feeling that this is so possible and easy that it's funny but I honestly can't find the answer through the Biki or loads of forum searching.

Share this post


Link to post
Share on other sites

Well, if you wanted the trigger to only affect people inside the trigger, you could check it via player in thislist.

So, when the trigger fires it would check on each client, if the player is in the trigger.

For example:

Trigger: (set to WEST->PRESENT)

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Condition: this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">On activation: thislist exec "effect.sqs"

effect.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_list = _this

?(player in _list): blah code blah

Share this post


Link to post
Share on other sites

Or you could just put this in the condition field of the trigger:

this and player in thislist

As long as they're not in a vehicle it will work.

Share this post


Link to post
Share on other sites
Or you could just put this in the condition field of the trigger:

this and player in thislist

As long as they're not in a vehicle it will work.

I didn't think of that...

Share this post


Link to post
Share on other sites

I'm sure your way would have worked but unfortunately I don't know what the "blah blah" code should be.

I found a solution (I think) by changing the condition on the effects page of the trigger to "thisList" instead of "true" so it only affects people with the effects if they are in thisList.

I definitely try to NOT use scripts if I can help it. Thanks for the help though!

My only concern is that if you happen to be flying over when the trigger has gone off then you will be in thisList even though you're flying and will get the visual effects. It's a tiny trigger and I guess the AI doesn't care if it's blinded anyway.

If I could I'd make a subset array of thisList that are "thisList who are getPos select 2 < 10" to weed out anyone flying.

EDIT: Ok it's easy enough to not removeAllWeapons from flyers by having a {} forEach thisList with a condition to check height.

One problem I'm having is that thisList is not being updated when someone new walks into the trigger.

Trigger, condition "this", onAct "{ removeAllWeapons _x; } forEach thisList;

It works as intended when someone walks into an empty trigger but with 2 people inside and a 3rd walking in the code isn't executed. I don't know how I'm going to do this now.

Share this post


Link to post
Share on other sites

Maybe I can createtrigger using a local script so that there's a copy of this trigger per client and thus no problem with multiple players sharing/hogging the trigger's effects.

EDIT: Or I could use our good friend setPos to force units out of the trigger so others are free to activate it.

Is there any way to have a unit activate a trigger that's already active? (not deact yet) I don't want some unit holding the door open so to speak and preventing the trigger from cycling back to inactive because I want the trigger effects to happen when new people enter it regardless of who's already there or what the trigger state is.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×