Home   Help Search Login Register  

Author Topic: Getting the player that tripped a trigger and is in a global in condit field  (Read 1389 times)

0 Members and 1 Guest are viewing this topic.

Mr.Pibb

  • Guest
Hello all,

Got what is prolly going to be a real brain teaser here: ::)

I have a trigger setup around a flag pole, the trigger is designed to change the flag to the appropriate one when a player or different side than west crosses thru the prox zone. Each player MAY possibly be referenced within a certain global variable.

 Therefore I need to get the player that tripped the trigger (normally local player) and see if he is in that global variable also, sounds easy? I thought, oh yea, just do this: condit: this && (local player) == player in clantown0, and with no great suprise the editor returned an error(i can provide it if neccessary)

 Now, on the flip side, -- condition:this && player in clantown0, works a treat! Except, there are 9 players, therefore this will refer to ANY player on the whole dang map, regardless of who actually tripped the trigger. :(

 So, anyone know of a way to get that trigger condition to get : if the player that tripped this trigger is also in clantown0 <---- Global Variable  ??

Pibb

:)

« Last Edit: 17 Dec 2004, 03:13:31 by Mr.Pibb »

RedHouse

  • Guest
not to sure what your asking but i think you could try listing an array of all the units in the trigger (list tiggername), then check if the unit is in the array (unit1 in [unit2, unit1]).

Mr.Pibb

  • Guest
RedHouse, can you provide an example please, I am lil confused as to what you are saying to input and how to do it, is that a trigger condition line?

:)

Pibb
« Last Edit: 17 Dec 2004, 03:14:21 by Mr.Pibb »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
on the trigger, put:
this && "_x in clantown0" foreach thislist

RedHouse

  • Guest
is this similiar to what you mean

just change the sqm file's name to just mission, create a folder call it anything you want put the file in the folder then play the mission

RedHouse

  • Guest
if you want the actual names of the units returned and put into one global variable use this script

again it's just the missions sqm file

RedHouse

  • Guest
if you tell me exactly what you need I will send you an example mission that is fully functional and explains everything.

Mr.Pibb

  • Guest
@ RedHouse

Heres the easiest way to describe it:

in a seperate script, a global variable is assigned to a player in a mp game, name clantown0

Then, in a trigger:

Radius:10
Activation:anybody,repeatedly

In the condition, I am seeking to get if the player that tripped this trigger (normally local player) is in clantown0 <---global variable

Therefore, the trigger would only activate if the player that tripped the trigger had that global variable assigned to him.

I can take a look at that stuff tommorow RedHouse, its too late now.

@Triggerhappy

I will give that a try tommorow, thanks  ;)

Thank you very much for the help guys


Pibb

RedHouse

  • Guest
i'd take a look at the trip2 demo but i'm not used to the way ofp works in multiplayer because i mostly script for singleplayer

Mr.Pibb

  • Guest
@Triggerhappy

Tried the new script line in the condition field, caused an error in editor:

this && "_x in clantown0" foreach thislist |#|:Error &&: Type Any, expected Bool

going to mess around with some combos of that script line ya got and see if something works maybe.

@RedHouse

Going to give that test mission a shot soon if I cant get the condition field to work first :) , thank you for the time doin that.

Just so you know so there isnt any confusion, I have all the scripts and whatnot that is neccessary for assigning the global to players, what I am trying to do is just within a trigger condition field (hopefully), which is have a script line in the condit field that will see if the player that tripped the trigger is within a certain global variable, and hence activate the trigger upon that criteria :)

Like I said in the Topic description, a brain teaser lol ::)

Pibb

RedHouse

  • Guest
the trip2 thing might be just what your looking for

Mr.Pibb

  • Guest
Gotcha, Ill have a look at it RedHouse, Thanks :)

Pibb

Mr.Pibb

  • Guest
@RedHouse

Unfortunately the condition Field script does not work in my MP mission as you have it, must be some clash there, cause it brings up an error everytime in the editor, of course, it works fine with single player in yer mission.
Dont know.

Pibb

btw - nice test mission, I do appreciate that work you did, neat how you got the guys running thru the flag so they will be referenced ;)

Mr.Pibb

  • Guest
@RedHouse

Ok, didnt realize that the method you have dosent actually use the condition field for the check but the activation, let me look over things again and I will get back on this :)

Pibb

Mr.Pibb

  • Guest
Guys, looks like I will prolly have to make the neccessary changes in the script for the flag, using RedHouses method is only applicable with the activation field, which in my trigger the activation field executes the flag script.

I will see if I cant gather all this info and get it working in the script, if anyone can come up with a trigger condition field that would work with this let me know please :)

It will be a lil while before I can get the script for the flag changed (rough estimate lol  ::) ) but I think I can do this in the script with the info I now have, unless someone can get the condition feild with the required criteria working, but I think it wont do it there.

I will solve this topic as soon as an ultimatum is found, or if it just seems it cant be done(which could happen quick; quick = a few days = seems cant be done)

Cyas round

Pibb