Jump to content

Recommended Posts

In the editor you can create groups quickly, however, you can't name these groups.

How would i name the group, Group_a so that I could then later delete this group?

cheers.

Share this post


Link to post
Share on other sites

Of course you can name these groups in the editor, where else?

In init line of groupleader:

Group_a=group this

Share this post


Link to post
Share on other sites

Wolle/anybody lol is there any way to use the group name in a script and it be recognized? Basically I have two groups that if they are killed Im going to offer reinforcments for each group thats killed.

in the init field I did Grp1 = group this; and then tried the above, but doesnt seem to work.

Example in the editor Ive named two groups: Grp1 and Grp2 Ive placed a trigger with anybody notpresent that calls a script and here is my code:

hint format ["testing now"];

sleep 3;

waitUntil
{
{alive _X && !(fleeing _X)} count "Grp1" == 0 or {alive _X && !(fleeing _X)} count "Grp2" == 0;

};

hint format ["should have infantry support"];

helo = True

publicVariable "helo";

exit;

Yes The public Varible works with my other scripts ;) Dont think thats my issue. :D

thanx :)

Edited by Mikey74

Share this post


Link to post
Share on other sites

Try:

hint format ["testing now"];

sleep 3;

waitUntil
{
({alive _X && !(fleeing _X)} count (units Grp1) == 0) or ({alive _X && !(fleeing _X)} count (units Grp2) == 0);

};
hint format ["should have infantry support"];
helo = True
publicVariable "helo";

Btw, if that's SQF, you don't need to use 'exit'.

Share this post


Link to post
Share on other sites

ahh thanks was wondering about the exit thing. :)

It had the same results. Maybe its how Im calling the script?

Thanks for your reply. :)

I know I can make it work by writing a script to spawn them in. Just seems like I should be able to do this without doing that.

Edited by Mikey74
An Idea :(

Share this post


Link to post
Share on other sites

Little typo in the script, there's a missing ";" near helo = True

Also try without a trigger.

Quick Checkup aswell:

- A member of the group #1 has a Grp1 = group this in it's init field

- A member of the group #2 has a Grp2 = group this in it's initfield.

- create a file init.sqf in your mission root and call your script from there, like ExecVM "myscript.sqf"

hint format ["testing now"];
sleep 3;

waitUntil {
({alive _X && !(fleeing _X)} count (units Grp1) == 0) or ({alive _X && !(fleeing _X)} count (units Grp2) == 0);
};
hint format ["should have infantry support"];
helo = True;
publicVariable "helo";

Edited by Benny.

Share this post


Link to post
Share on other sites

ha haaaa that worked great!!!! Thanks!!!!

Edited by Mikey74
re read and figured it out ;) ie typo

Share this post


Link to post
Share on other sites

how do I actually verify an entire group is dead?

Here's my situation:

The PC will attack a group of enemy (3 men, group name RU1). So for each men, I have the line ... RU1 = group this; ... in their init.

My trigger is set to condition ... !alive RU1;

And it's getting activated whenever a single of those souls are dying.

And yes, I'm a complete noob in scripting (just started today ... )

Share this post


Link to post
Share on other sites
{alive _x} count units RU1 == 0

Thanks mate, that helped a lot. Been on that for the past hours. I just noticed though, it takes forever for the trigger to process that condition.

A good minute passed before it did the "On Activation" section. Any idea what's happening here?

Share this post


Link to post
Share on other sites

It takes a while for a group to realize it's units are gone.

If you wanted it to be faster, then do something like this:

!alive ru1_unit1 && !alive ru1_unit2 && !alive ru1_unit3

and so on, with a !alive unit for each specific unit you wanted to check for. Where ru1_unit1 is the Name given to a unit in the Editor.

Share this post


Link to post
Share on other sites
It takes a while for a group to realize it's units are gone.

If you wanted it to be faster, then do something like this:

!alive ru1_unit1 && !alive ru1_unit2 && !alive ru1_unit3

and so on, with a !alive unit for each specific unit you wanted to check for.

If that's the only alternative, I guess I'll just stick with the previous code you gave me.

Thank you again for the information.

Share this post


Link to post
Share on other sites
It takes a while for a group to realize it's units are gone.

That is true. However, when you add {alive _x} or {!alive _x} check it will bypass the group member status update, because it directly checks for the members status. Using the condition the group units is used just as an array.

In other words, {alive _x} checks if the unit is alive, not if his group leader thinks he's alive. :)

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  

×