Jump to content
Sign in to follow this  
talkinBEERmug

Groups

Recommended Posts

This is kind of a noob question but I do need to know.

How do you set the name of your group, I have a group with 1 leader, do I just do this script in the init of the leader:

p1 setgroupid ["Delta","GroupColor4"]

Or do i have to do this in each soldier

on the wiki it says this

group1 setGroupId ["Delta","GroupColor4"]

that says to me that some one has named there group "group1", but how do you name your group. I dont remember when you add a group if there is settings page that pops up, and even if there is what if you grouped people your self how do you give them a group name to setgroupid.

Share this post


Link to post
Share on other sites

It goes:

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

NAMEOFYOURGROUP = group player

or

NAMEOFYOURGROUP = group unit1

You have to state a member of the group after the group command

Group command

Share this post


Link to post
Share on other sites

It can be the leader but any member of the group is a valid argument.

FYI:

You can retrieve the leader later with the command:

leader GROUPNAME

Share this post


Link to post
Share on other sites

hi.. Id like to the same, but I get always error messages like this:

Error missing;

I'd tried this in init.sqs:

playerGrp = group player

playerGrp setCaptive true

removeAllWeapons playerGrp

what is the problem?... pls heeelp banghead.gif

Share this post


Link to post
Share on other sites

I tryed : removeallweapons this, but it causes error..

The error message was not "Error missing;", but:

"Error removeallweapons type group expected object"

in the editor I have 5 players in one group

the init.sqs:

playerGrp = group player

removeallweapons playerGrp

Share this post


Link to post
Share on other sites

You cannot removeAllWeapons from a group, but only from individuals.

removeAllWeapons soldier;

OK

removewAllWeapons group1;

NOT OK

removewAllWeapons forEach units group1;

OK

Share this post


Link to post
Share on other sites
hi.. Id like to the same, but I get always error messages like this:

Error missing;

I'd tried this in init.sqs:

playerGrp = group player

playerGrp setCaptive true

removeAllWeapons playerGrp

what is the problem?... pls heeelp banghead.gif

You're using 2 commands (setCaptive and removeAllWeapons) that only take individual units as an argument. You can't simply replace the group with a unit for any command. If you want to execute commands that only work on a single unit for a whole group use forEach.

Quote[/b] ]removewAllWeapons forEach units group1;

OK

I seriously question how often you successfully use forEach... with that syntax at least. I don't know who gave you the idea that forEach magically converts an array of many units into a single unit, but forEach doesn't work that way; instead it executes the code 1 time for each item in the array. So an array of 3 items executes the code 3 times, that's once time for each item. Proper syntax includes curled braces (they look like this: {} ) ONLY (because quotes don't work where CODE is required now, unlike OFP where quotes and curled braces were interchangable) and the local variable '_X' to represent the current item of the array. You can also use any number of commands seperated with semicolons (;). The end result is:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_X setCaptive true; removeAllWeapons _X} forEach units playerGrp

Share this post


Link to post
Share on other sites

I always name my player units aP,aP1... so I would use this code.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">playerGrp = group aP;

{removeallweapons _x;}forEach units playerGrp;

if you use 'player' the group could be different on other client mashines, because player represents the local player unit.

ups didn't read the post over mine.

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  

×