[Solved] Custom Scripts / creating unit groups

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2012
Messages
204
Hey there :)

can somebody tell me how to properly use custom scripts to create a specific unit group in a group array.
I need to number it as follows: Custom value of Unit + (Player Nr. of owner casting unit * 10)

is that even possible?

greetings

CodeBlack
 
Level 7
Joined
Sep 19, 2012
Messages
204
An easy way to always be able to do it yourself is just to use variables. Don't forget their udg_ prefix in CS lines:
  • Set INT = (Custom value of UNIT) + (Player Number of (Owner of (Triggering Unit))) * 10)
  • Custom script: set udg_GROUP[udg_INT] = CreateGroup()

You could also create such a statement in GUI, then copy the trigger and convert it to custom script to see the generated JASS and copy it from there.

thank you very much :) this is exactly what i was looking for!

  • Set Unit = your unit
  • Custom script: set udg_Group[GetConvertedPlayerId(GetOwningPlayer(udg_Unit)) * 10 + GetUnitUserData(udg_Unit)] = CreateGroup()

this as well, but the other ideas are more reusable for me xD
 
Status
Not open for further replies.
Top