Jump to content
Sign in to follow this  
kocrachon

Scripting Issue

Recommended Posts

Right now I am trying to make a trigger where the condition is a group being inside of a vehicle. I cant do it to where I say Soldier1 AND soldier2 blah blah and so forth because its at the end of the mission and I need to make it based on the group since some of them may die and the vehicle wont move unless every unit is alive if I do it that way.

So right now it needs to look something like this, the leader of the groups name is Leader1

(Group Leader1 in Stryker1)

However I cant do it that way. Anyone able to help me out with this?

Share this post


Link to post
Share on other sites

put this into your trigger's condition field:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(({alive _x && not( _x in Stryker1) }count group Leader1) == 0)

or you may try this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(({not( _x in Stryker1) }count group Leader1) == 0)

...i think that it should work even without the "alive _x" condition, because dead units should be automatically removed from the group - but sometimes that can take few seconds (i think the unit is removed from the group after its leader finds out that the unit is dead).

Share this post


Link to post
Share on other sites

I get the error

Quote[/b] ]count: Type Group, expected array

Share this post


Link to post
Share on other sites

'in'-command doesn't work that way. You can ask only individual soldier, not groups, to be in vehicle with it.

One solutions is this: groups uses 'get in'-waypoint to get to stryker and on waypoint's activation-field you type something like: GroupLeader1InStryker = true or gogo = true (word doesn't matter). then make trigger and put to it's condition-field this: GroupLeader1InStryker (or the word you choosed to use).

Now when all existing units are in vehicle (waypoint is completed) activation-field turns that word to true and so trigger gets what it asks (and activates itself).

There's other ways too (not requiring waypoint for Leader1), but i don't have time to explain and test it (so that i know i'm not talking BS).

Share this post


Link to post
Share on other sites
put this into your trigger's condition field:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(({alive _x && not( _x in Stryker1) }count group Leader1) == 0)

or you may try this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(({not( _x in Stryker1) }count group Leader1) == 0)

...i think that it should work even without the "alive _x" condition, because dead units should be automatically removed from the group - but sometimes that can take few seconds (i think the unit is removed from the group after its leader finds out that the unit is dead).

There might be mistake in here: Group need to be replaced by units. Group can't be count, but units can wink_o.gif

SO:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(({not( _x in Stryker1) }count units Leader1) == 0)

Share this post


Link to post
Share on other sites
'in'-command doesn't work that way. You can ask only individual soldier, not groups, to be in vehicle with it.

One solutions is this: groups uses 'get in'-waypoint to get to stryker and on waypoint's activation-field you type something like: GroupLeader1InStryker = true or gogo = true (word doesn't matter). then make trigger and put to it's condition-field this: GroupLeader1InStryker (or the word you choosed to use).

Now when all existing units are in vehicle (waypoint is completed) activation-field turns that word to true and so trigger gets what it asks (and activates itself).

There's other ways too (not requiring waypoint for Leader1), but i don't have time to explain and test it (so that i know i'm not talking BS).

That is not working either...

Share this post


Link to post
Share on other sites

As Second wrote:

put the following in the condition field: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(({ not(_x in Stryker1) }count units Leader1) == 0)

and the action, to activate when all units are inside the Stryker1, put into the 'OnActivation' field.

It works. If it isn't working for you, then you did something wrong.

Of course the trigger has to be a "Switch", and must be set to "Repeatedly", maybe you forgot that.

Share this post


Link to post
Share on other sites

One solutions is this: groups uses 'get in'-waypoint to get to stryker and on waypoint's activation-field you type something like: GroupLeader1InStryker = true or gogo = true (word doesn't matter). then make trigger and put to it's condition-field this: GroupLeader1InStryker (or the word you choosed to use).

Now when all existing units are in vehicle (waypoint is completed) activation-field turns that word to true and so trigger gets what it asks (and activates itself).

That is not working either...

Either i spelled that in bad way, or you are doing something wrong.

1. Make 'get in'-waypoint and give stryker 'load'-waypoint and syncronize them.

2. Put into 'get in'-waypoint's OnActivation-field this: inside = true

3. create trigger which has in it's condition field word (and only that word, delete 'this' ): inside

4. Now trigger activates when leader considers that everyone (who fits inside) is in vehicle.

Does work.

What ever way you choose to try. I give you a hint as i assume that you are beginner in this:

Put some some music and text and you should see the results as soon as trigger is activated. Try it in empty map so you don't waste time on test-playing mission and noticing that there's bug in the end of the mission. I have wasted something like half of my test-playing hours (which is alot) because i don't learn that lession.

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  

×