Jump to content
Sign in to follow this  
Op4 BuhBye

Player in thislist

Recommended Posts

Im having an issue with "Player in ThisList". It works fine until you get in a vehicle, then it doesn't work.

Anyone else have this? and or is it a bug, or is there something else I dont know about?

Share this post


Link to post
Share on other sites

Thats how it works yeah. One workaround is to check for vehicle types as well.

I used this in a mission once. Hope it gives you ideas.

trigger

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

cond: ("Car" counttype thislist) > 0

onact: nul=thislist execVM "flagcrew.sqf";

flagcrew.sqf

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

{

_c = crew _x;

_cnt = count _c - 1;

for "_i" from 0 to _cnt do {

_p = _c select _i;

if (_p in SHK_Caps) then {

call compile format["SHK_Ca%1 = true",_p];

};

};

} foreach _this;

Share this post


Link to post
Share on other sites

Use this instead:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">vehicle player in thislist

Share this post


Link to post
Share on other sites
Thats how it works yeah. One workaround is to check for vehicle types as well.

I used this in a mission once. Hope it gives you ideas.

trigger

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

cond: ("Car" counttype thislist) > 0

onact: nul=thislist execVM "flagcrew.sqf";

flagcrew.sqf

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

{

_c = crew _x;

_cnt = count _c - 1;

for "_i" from 0 to _cnt do {

_p = _c select _i;

if (_p in SHK_Caps) then {

call compile format["SHK_Ca%1 = true",_p];

};

};

} foreach _this;

Hmm, why over-complicate things when 'vehicle player in thislist' works wonders?

Share this post


Link to post
Share on other sites

Thanx guyz! I never had to add the vehicle in OFP guess its differant in ArmA.

Share this post


Link to post
Share on other sites

I dont know why BIS changed the trigger activation for vehicles but its a pain. In OFP if you were west and got in any vehicle you would set off a trigger set to west present. In ArmA it 1/2 sets the trigger. The event doesn't happen but the trigger is activated. What is that?

Any way I have a trigger set to anyone that execs a script.

The issue...

If you are on foot everything works. In a vehicle nothing works. And if you get out of the vehicle the trigger is null. It will not work again unless you set it to repeat.

So How do I check for a player in and out of a vehicle in the condition field without using "thislist" and making the result local.

Share this post


Link to post
Share on other sites

Did you actually try the 'vehicle player in thislist' and still have this problem?

I believe that "vehicle player" is equal to "player" when the player is on foot. Therefore 'vehicle player in thislist' should work for trigger activation in both cases (player on foot, or player in vehicle). If that is not true, please post more details of your problem.

Share this post


Link to post
Share on other sites

Yes I did acually try vehicle player in thislist and it did the exact same thing. detected you on foot and not in a vehicle. Ive tried it in 2 different maps and I get the same thing.

The issue with thislist is it only applys to those inside the trigger. So a message you want global will only be seen by those in the trigger. But it didnt work anyway.

Thanx for the reply. I dont know what to do here Im working in 3 maps at the same time and I keep running into this stuff and it knocks the wind out of my sails. sad_o.gifsad_o.gif

Share this post


Link to post
Share on other sites
Yes I did acually try vehicle player in thislist and it did the exact same thing. detected you on foot and not in a vehicle. Ive tried it in 2 different maps and I get the same thing.

maybe you need this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this && (vehicle player) in thislist??

Quote[/b] ]The issue with thislist is it only applys to those inside the trigger. So a message you want global will only be seen by those in the trigger. But it didnt work anyway.

this is what thislist is meant for. What is the problem?

Quote[/b] ]Thanx for the reply. I dont know what to do here Im working in 3 maps at the same time and I keep running into this stuff and it knocks the wind out of my sails. sad_o.gifsad_o.gif

hope I helped

QuietMan

Share this post


Link to post
Share on other sites

Try this:

To get the word out globally to all players you need to do some trickery with publicVariable.

in init.sqs set 2 boolean variables thus:

foo=false;bar=false;

in your existing trigger put

condition: vehicle player in thisList

activation: foo=true; publicVariable "foo";

put a Game Logic on map called 'Server'

put another trigger on the map:

condition: foo&&(local Server)

activation: bar=true;publicVariable "bar";

put another trigger on the map:

condition: bar

activation: hint "hello!";bar=false;foo=false;

All the above generates a trigger event on a client machine if that player

is in the trigger. This sends the message to server, which in turn notifies all clients.

Seems to be only way to communicate reliably to all other clients.

Tried publicVariable from client to client and it was useless. Had to go via server.

the trigger must be set to repeat if you want it to detect more than one event

also I have noticed that if a trigger is single-use, then sometimes it won't fire when you're in a vehicle

but sometimes it will. Depends on the timing when the map is loaded I think.

Weird, but I had to set my detect triggers to multi on a map a while back as sometimes they'd work

and sometimes they wouldn't, never paid much mind to it until you said about it here.

Dunno if that's what you meant, but I think it might be what you're looking for?

Share this post


Link to post
Share on other sites
Yes I did acually try vehicle player in thislist and it did the exact same thing. detected you on foot and not in a vehicle. Ive tried it in 2 different maps and I get the same thing.

The issue with thislist is it only applys to those inside the trigger. So a message you want global will only be seen by those in the trigger. But it didnt work anyway.

Thanx for the reply. I dont know what to do here Im working in 3 maps at the same time and I keep running into this stuff and it knocks the wind out of my sails. sad_o.gifsad_o.gif

There's no way for 'vehicle player in thislist' to not work unless your trigger is incorrectly set up, or if you are using it in MP. If you're in MP (which I suspect you are) you can't use the player variable globally, since it only refers to the local player. In MP use the name of the actual unit instead of player. But other than that, vehicles are included in the trigger's list. So if the player (or whichever unit you targetted) is in one of those vehicles, that condition will not fail. If your trigger is set to a specific side instead of Anybody, then under some circumstances vehicles would be excluded. Unlike infantry, a vehicle's side can change based on its crew, and sometimes it can be different from any one member of its crew. If the side of the unit's vehicle does not meet the trigger requirements then of course it won't be included in the trigger list. In any case, there's always a way to be more specific with the condition. For example, if you have a trigger activated by Anybody, you can use this condition to make sure all units and vehicles with a crew member who is on side BLUFOR will activate it:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{{side _X == west} count (crew _X) > 0} count thislist > 0

If you want to become skilled in creating advanced missions, this is a very useful technique. With the count and forEach commands and the Activated by Anybody feature you can pretty much create any custom trigger condition you want, including one that looks for units of multiple specified sides. Just remember that triggers only serve to aid and simplify mission making, their limitations by no means represent the limitations of mission making (since there really are very few limitations in mission making).

Share this post


Link to post
Share on other sites

This is an obstical Im hitting alot. The triggers are soooo different from OFP.

This situation is....

I have several triggers set to anyone present, 40m Rad, OnActivation:[] exec "artillery.sqs"

The script....

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

#check

~.5

?(player in list house1) : goto "1"

?(player in list house2) : goto "2"

?(player in list house3) : goto "3"

?(player in list house4) : goto "4"

?(player in list house5) : goto "5"

?(player in list house6) : goto "6"

?(player in list house7) : goto "7"

?(player in list house8) : goto "8"

exit

#1

playsound "arty2"

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house1 = nearestObject [house1, "Building"]

_house1 setDammage 1

exit

#2

playsound "arty2"

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house2 = nearestObject [house2, "Building"]

_house2 setDammage 1

exit

#3

playsound "arty2"

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house3 = nearestObject [house3, "Building"]

_house3 setDammage 1

exit

#4

playsound "arty2"

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house4 = nearestObject [house4, "Building"]

_house4 setDammage 1

exit

#5

playsound "arty2"

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house5 = nearestObject [house5, "Building"]

_house5 setDammage 1

exit

#6

playsound "arty2"

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house6 = nearestObject [house6, "Building"]

_house6 setDammage 1

exit

#7

playsound "arty2"

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house7 = nearestObject [house7, "Building"]

_house7 setDammage 1

exit

#8

playsound "arty2"

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house8 = nearestObject [house8, "Building"]

_house8 setDammage 1

exit

Everything works fine if you are on foot. If a vehicle drives through nothing happens BUT... if you get out of the vehicle and run back into the trigger angain nothing happens. Its like the trigger gets triped but nothing happens.

I need to check for West and East in and out of vehicles.

It is MP and Ive tried

this

this && (vehicle player)

this && (vehicle player) in thislist

None have worked.

I dont understand why BIS changed the trigger format from OFP it worked great. Everything is so over complicated now sad_o.gif

Share this post


Link to post
Share on other sites

I just looked at my post and saw my check inside the script..

?(player in list house1) : goto "1"

?(player in list house2) : goto "2"

?(player in list house3) : goto "3"

?(player in list house4) : goto "4"

?(player in list house5) : goto "5"

?(player in list house6) : goto "6"

?(player in list house7) : goto "7"

?(player in list house8) : goto "8"

This is why its not working isnt it? I need to add the vehicle player to it.

But can I do it without using "thislist" and going through all the extra steps to make the message global?

Share this post


Link to post
Share on other sites

1 more dumb question... If I put that check in the script do I leave the condition: "this" in the trigger?

Thanx for all the help guyz. Kyle you are the man! notworthy.gif

Share this post


Link to post
Share on other sites

Well if you want to save yourself a lot of repetition, here's what you should instead do:

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

titleText ["INCOMING!!!","PLAIN DOWN",1]

~5

_house1 = nearestObject [_this, "Building"]

_house1 setDammage 1

exit

And in each trigger call it with a different house:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">house1 exec "artillery.sqs"

Share this post


Link to post
Share on other sites

Thats a good idea. Will the "Incoming" message be global if I do that?

Share this post


Link to post
Share on other sites
Thats a good idea. Will the "Incoming" message be global if I do that?

The script's locality is determined by where it's executed from (and whether or not it exits for specified localities). Since you executed it from a global trigger the script and all its effects will be shown for everyone.

Share this post


Link to post
Share on other sites

Ya know Kyle... if I didn't love women so much. Thanx man.

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  

×