Jump to content
TheGeneral2899

Getting group ID and attribute +1 to score in custom variable

Recommended Posts

Hey everyone,

 

The concept is as follows:

1) Multiple teams of 2 with objectives spread across map.

2) These objectives have an addAction attached

3) I want to catch the player who activated the addAction via (_this select 1)

4) Find out what group he is in (right now I have in the init of all the playable units something along the lines of ("this group alpha", "this group bravo") 

5) Add a +1 to that groups score (currently a public variable defined already called "alphaScore".

 

For the life of me I have not been successful in getting past steps 3/4.  Here is the current block of code:

 

moneyCrate addaction ["<t color='#f0ff00'>Collect Cash",{
	_unitGroup = groupId (group (_this select 1));
	hint format ["Unit group is : %1", _unitGroup];
	deleteVehicle moneyCrate;
	deleteVehicle money1;
	deleteVehicle money2;
	deleteVehicle money3;
	hint parseText _moneyMissionEndText;
	}
];

The print out for the hint is "Alpha 1-5" for instance, however doesnt match up with what I set in the unit's init.   The only solution I can think of would be to map out a table as such Alpha 1-5 is equal to my bravo and Alpha 2-1 is equal to my charlie etc. etc.

 

Any thoughts / ideas would be greatly appreciated.

Share this post


Link to post
Share on other sites

if you simply have (group (_this select 1)) it should be same as the variable you assigned to it in the editor.

 

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

×