Jump to content
Sign in to follow this  
MehMan

Getting the group leader

Recommended Posts

Hello!

I'm making myself some missions that don't involve heavy scripting but are still random enough to be replayable. So far so good, I've got several squads that appear depending on the leader, with the probabilty set down to 50%. The biggest problem is that I have to name the squad leader and every squad member needs a condition set like so:

alive name_of_leader

That means that I have to set it manually for every squad and if I want to copy paste it takes a while.

I've tried with the leader command, but it gives me errors. Any other ideas?

Share this post


Link to post
Share on other sites

just try this:

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

Share this post


Link to post
Share on other sites

You can group several triggers to the leader and set them to vehicle present.

Or you can drop a trigger bluefor present and put...

LeadersName in thislist

in the condition field.

Share this post


Link to post
Share on other sites

Well, sorry but without referencing that initial leader (with the 50% probability of presence) with a name you just can't do it, because if he's not present then the next person in the group will just start as the leader, so you'll always have a leader and it won't always be the same person. You could execute a script from that unit's init field that spawns the rest of the squad, and therefore when he's not present the rest of the group is not created, but that's even more work than just naming them IMO.

Share this post


Link to post
Share on other sites

That was my second thought on how to do it and probably the most plausable and best option.

Share this post


Link to post
Share on other sites

Set the init somewhere: xTime=false

make a trigger that activates after 1 second:

xTime=true

make a trigger that incircles the group:

condition: count thislist<9 and !xTime

on activation {deletevehicle _X} foreach thislist

Im assuming the size of your group is 9

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  

×