Jump to content
Sign in to follow this  
Guest

Making trigger activate when player(s) present?

Recommended Posts

Guest

I am making a multiplayer mission with 8 playable units (p1,p2,p3,p4,p5,p6,p7,p8).

I want to have a trigger activate when any of the players enter it. What would I have to put in the activation field of the trigger for it to activate when a player enters it?

Note: I can't use blufor present as the trigger covers an area which has other blufor units within it...

Thanks in advance:)

Edited by Guest

Share this post


Link to post
Share on other sites

{_x in playableunits} count thislist > 0

{vehicle _x in thislist} count playableUnits > 0

Edited by Shuko

Share this post


Link to post
Share on other sites
Guest

I seem to get this error with the above code shk: Type bool, expected nothing

I put it in the activation box of the trigger...

Edited by Guest

Share this post


Link to post
Share on other sites
Guest

Ok, I put it in the condition box and now the error is gone but it doesn't activate when a player unit enters it...

I'm guessing I have to change some of the code:confused:

Sorry, I'm new to this:o

EDIT: My bad... I changed playableunits to p1,p2,p3,p4,p5,p6,p7,p8. I was being a bit stupid.

Edited by Guest

Share this post


Link to post
Share on other sites

What exactly is the trigger supposed to do? If you have nothing in the OnAct field it'll trigger, but not do anything.

Both playableunits and p1 through p8 (as an array) would work, but first what is supposed to happen? :)

Share this post


Link to post
Share on other sites
Guest

hmm... It's still not working:confused:

I have tried:

p1,p2,p3,p4,p5,p6,p7,p8

p1 and p2 and p3 and p4 and p5 and p5 and p6 and p7 and p8

p1 && p2 && p3 && p4 && p5 && p6 && p7 && p8

None of them work...

What am I supposed to add inbetween each playable unit?

Thanks in advance

---------- Post added at 08:39 PM ---------- Previous post was at 08:37 PM ----------

What exactly is the trigger supposed to do? If you have nothing in the OnAct field it'll trigger, but not do anything.

Both playableunits and p1 through p8 (as an array) would work, but first what is supposed to happen? :)

I have just put down a test trigger for the moment untill I can get it to work.

I have set the trigger to show some text on the screen. It works if I just add for example p1. But if I try to add more than one player, it doesn't work:confused:

Share this post


Link to post
Share on other sites
Guest

ah, ok.

I'll test it in LAN and see what happens:)

Share this post


Link to post
Share on other sites

{vehicle _x in [p1,p2,p3,p4,p5,p6,p7,p8]} count thislist > 0

Should work in SP / Editor

Share this post


Link to post
Share on other sites
{vehicle _x in [p1,p2,p3,p4,p5,p6,p7,p8]} count thislist > 0

Should work in SP / Editor

Would something like this apply for me?

Acelondoner,

Since you had you question answered, I am going to ask one in here that is similar, instead of searching anymore.

I have two 'extra' Team Leaders hiding away, so if I die (as TL), I can get back to base and have one join, switch to the newly joined TL, and supposedly have everything I originally started with. Buuut, I cannot seem to get everything to work.

I have an ACM, SOM with CAS and Transport, Predator (not for attacking, more or less for the heck of it, so I am not worried about it), and a mortar script.

What do I use in all to activate assets with out having multiple things, like the SOM? Currently, I start as TL1, the other two are TL2 and TL3.

I was so tired (and frustrated) when I quit working on it this morning that I really cannot remember what combination of things was working, or not. I'm going 'back in' now. Egads! :eek:

EDIT: Yes, the newly joined TL actually becomes the new TL when he joins.

Share this post


Link to post
Share on other sites
Guest

Ok, I just tested this: {vehicle _x in p1, p2, p3, p4, p5, p6, p7, p8} count thislist > 0 in LAN and it didn't work.

I then tested this: {vehicle _x in [p1, p2, p3, p4, p5, p6, p7, p8]} count thislist > 0 in single player and LAN and it worked in both:)

I was just missing the []:rolleyes:

Thanks so much for the help guys, really appreciate it!

Edited by Guest

Share this post


Link to post
Share on other sites

Right, [ ] means the values are considered an array. I tested the playableUnits in MP and it was not working, which seems odd. :(

Share this post


Link to post
Share on other sites
Ok, I just tested this: {vehicle _x in p1, p2, p3, p4, p5, p6, p7, p8} count thislist > 0 in LAN and it didn't work.

I then tested this: {vehicle _x in [p1, p2, p3, p4, p5, p6, p7, p8]} count thislist > 0 in both single player and LAN and it worked:)

I was just missing the []:rolleyes:

Thanks so much for the help guys, really appreciate it!

I tried a similar array last night and could not get it to work. Let me see if I can duplicate it. I'll be back.

EDIT: Hmmm, no code button?

[[["tactical_airstrike", "transport"], [player, TL2, TL3]] call BIS_SOM_addSupportRequestFunc;    SOM setVariable ["TSS_vehicle_custom", Helo_Transport_1];

I tried as player, and as TL1.

Edited by CyOp

Share this post


Link to post
Share on other sites

Quickly tested, both worked on MP host:

{_x in playableunits} count thislist > 0

{vehicle _x in thislist} count playableUnits > 0

Share this post


Link to post
Share on other sites

Sorry, I thought he was done. I did not mean to thread hi-jack. I will not ask any more questions. :(

Share this post


Link to post
Share on other sites

Bah, the playableUnits didn't work for me since I forgot to set the trigger to ANYBODY PRESENT. :)

CyOp, looks like you have an extra [ at the beginning of that line?

Share this post


Link to post
Share on other sites
Guest
Sorry, I thought he was done. I did not mean to thread hi-jack. I will not ask any more questions. :(

I am done, its working fine:)

Bah, the playableUnits didn't work for me since I forgot to set the trigger to ANYBODY PRESENT.

:)

Share this post


Link to post
Share on other sites
&& means and but what does mean or?

||

kjhsdkjhsd char limit

Share this post


Link to post
Share on other sites

And what the heck does kjhsdkjhsd mean? :D

I tried a similar array last night and could not get it to work. Let me see if I can duplicate it. I'll be back.

EDIT: Hmmm, no code button?

[[["tactical_airstrike", "transport"], [player, TL2, TL3]] call BIS_SOM_addSupportRequestFunc;    SOM setVariable ["TSS_vehicle_custom", Helo_Transport_1];

I tried as player, and as TL1.

Not sure as I never used the SOM module, but I'd say you have to add the support request for each unit.

[["tactical_airstrike", "transport"], player] call BIS_SOM_addSupportRequestFunc;
[["tactical_airstrike", "transport"], TL2] call BIS_SOM_addSupportRequestFunc;
[["tactical_airstrike", "transport"], TL3] call BIS_SOM_addSupportRequestFunc;

Share this post


Link to post
Share on other sites

(Thanks Acelondoner!)

I did that and had it working. I also did it with a trigger when I would go to have the new TL join. But, I thought there was a 'cleaner' way to do everything, like with arrays.

EDIT: Oh, wait, I think that did not work, and that is why I set up the trigger. I think the above will work only of all three were players joining at mission start (using the GAME LOGIC).

EDIT:

I originally asked in here because I was trying to get an array to work, but I am going to move my question to the SOM thread. Thanks for any help I received. :)

Edited by CyOp

Share this post


Link to post
Share on other sites
And what the heck does kjhsdkjhsd mean? :D

Forum has a minimum char limit for posting, || didnt cut it. :P

Share this post


Link to post
Share on other sites

Btw, you can probably also do a multiplayer check using isMultiplayer. If it is, then playableUnits are checked, if it's not, then switchableUnits are checked instead. Makes it at least possible to do checks without having to rely on other players to be around.

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  

×