Jump to content
Sign in to follow this  
RangerX3X

Unit Name vs. Group Name

Recommended Posts

Just trying to share some info I came across in testing a mission I am working on. I checked the Biki which did not address this as far as I could find, and a search on here using "unit" or "group" is overwhelming to say the least.

Basically the deal is this: I have a three man BMP group standing guard outside their APC. Once a certain trigger condition is met, they jump in and become Heros of the Soviet Union...:butbut:

In the group leaders initialization field I have the following code:

EAPC2 = group this; {_x disableAI "MOVE"} forEach units EAPC2; {_x setUnitPos "MIDDLE"} forEach units EAPC2; this setpos [1961.6,3216.07,0]; this setDir 170

For the other two loons, I just have them setpos'd so they look all l33t and crap...

NOTE: By the way, using setDir in this manner works perfectly.

In the on activation field of my trigger I have the following code:

EAPC2CMD moveInCommander EAPC2; EAPC2GNR moveInGunner EAPC2; EAPC2DRV moveInDriver EAPC2; EAPC2LOAD = true; hint "EAPC2LOAD"

End result is no joy.

The reason (at least one reason) is because the first five characters of the group name (EAPC2) is the same as the first five characters of the unit leader name (EAPC2CMD). If I simply change the group name one digit from EAPC2 to EAPC3 (or something other than EAPC2 entirely), the whole package works perfectly as intended.

The fifth character in the group/unit name is killer.

Share this post


Link to post
Share on other sites

EAPC2CMD moveInCommander [u]EAPC2[/u]; EAPC2GNR moveInGunner [u]EAPC2[/u]

It seems that the real issue may be that you're using EAPC2 (a group) as a vehicle...

You should also try to create less ambiguous names, for example: EAPC2Grp for the group, EAPC2 for the vehicle, etc...

Share this post


Link to post
Share on other sites

The trick to keep in mind is that groups really don't have names.

You don't refer to group "blah", you refer to the group whose leader is named "blah";

Share this post


Link to post
Share on other sites
The trick to keep in mind is that groups really don't have names.

You don't refer to group "blah", you refer to the group whose leader is named "blah";

Groups can definately be named, and then refered to as a Group data type.

Share this post


Link to post
Share on other sites

Agree about data types. And there is a group identity set/get call. But you cannot really find the group that way - hence my statement. If that is incorrect, please share.

Share this post


Link to post
Share on other sites

There is no group "variable name" in the same way that there are unit/object variable names, if that's what you mean. But you most definitely can assign a variable to a group and then reference that variable later on.

Share this post


Link to post
Share on other sites
EAPC2CMD moveInCommander [u]EAPC2[/u]; EAPC2GNR moveInGunner [u]EAPC2[/u]

It seems that the real issue may be that you're using EAPC2 (a group) as a vehicle...

You should also try to create less ambiguous names, for example: EAPC2Grp for the group, EAPC2 for the vehicle, etc...

Thanks Dawg - bitten by the obvious right in front of me...

:459:

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  

×