Forum Jump :

Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 23
In-game name: Wak

 
#195677 Posted at 2017-01-06 04:00        
     
Look at the wiki page, groupSelectedUnits returns an array; that means a list of units. When you write `unit2 = groupSelectedUnits player;` or `unit3 = groupSelectedUnits player;`, what you're getting is actually something like this:
unit2 = [unit1, unit2, unit3];
unit3 = [unit1, unit2, unit3];

That's why you get an error that says "Type array,Expected object", because you're trying to use an array instead of a unit. You'd need to use the select command to pick a specific unit from that array, or use a forEach loop to do something with all the objects in the array.

https://community.bistudio.com/wiki/Array

Hope it's clear enough now, you don't really need to something specific for each key press, you just have to make sure it's an 'FX' key, then use groupSelectedUnits.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage