Jump to content
Sign in to follow this  
meatball

Triggering off of Group Name

Recommended Posts

Man, I'm banging my head on the wall with this one. I've searched all over and found 20 threads with people asking almost the same thing I'm asking for, but not exactly and I can't get it to work. Basically I need to do two things.

First, put all players in a mission into the same group so I can call out the group name for scripts when I'm not 100% sure that all the player ID's will actually be in the game. I believe I've accomplished this by putting the following in every playable unit's init field, "this setGroupID ["demoteam"]"

Next, I need a trigger to fire when a player from that group steps into it (or drives a vehicle into it), but not when other AI from the same team or players from other groups step into it. I've tried everything from thislist to count group and I can't for the life of me get it to work.

I'm sure it's out there somewhere, but I've spent the last hour digging through posts to no avail. Any suggestions?

Thanks!

Share this post


Link to post
Share on other sites

Skip triggers and have the players run a script checking distance to whatever you wanna trigger from. Or check that !isServer and local player or something.

Share this post


Link to post
Share on other sites

Not sure how that'd work, but I'll give it a go. I'm using the militarize and ambient combat scripts from the AI spawn script pack. I've got certain areas I want to militarize when players get close to them, but I don't want to militarize when AI blufor that's roaming around due to ambient combat get close to them.

---------- Post added at 21:00 ---------- Previous post was at 20:35 ----------

Condition "playername in thislist;" works fine.

Condition "playername in thislist or playername2 in thislist;" does not.

:confused:

Share this post


Link to post
Share on other sites

To create group variable use group this on the group leader init field.

Example: MainGrp = group this;

Of course "MainGroup" is the name I chose. You call it whatever you want.

Share this post


Link to post
Share on other sites

Ah, I figured out another way to get basically the same effect and it works in a lot of cases where other setups weren't.

({_x in thisList} count [(vehicle man1),(vehicle man2),(vehicle man3),(vehicle man4),(vehicle man5),(vehicle man6)]) > 0

This appears to work regardless of whether the player is on foot, or in a vehicle and can be placed in a trigger condition. Only took me 6 hours of banging my head on the keyboard. :p

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  

×