• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Grouping Last Created Unit

Status
Not open for further replies.

bnu

bnu

Level 2
Joined
Apr 6, 2012
Messages
17
hello hiver :ogre_hurrhurr:

i want to ask a trigger, the trigger use for grouping unit. After the unit Created in a region, then the Created unit on the region is one group

sorry for my bad english :vw_sad: my grammar is very suck :ogre_rage:

thanks :ogre_haosis:
 
Level 10
Joined
Dec 15, 2012
Messages
650
So the whole actions are
[Trigger=Actions]Copy these actions
Unit - Create 10 Footman for Player 1 (Red) at (Center of (Your Region)) facing Default building facing degrees
Set Unit_Group = (Last created units)[/Trigger]
Variable name : Unit_Group
Vaiable type : Unit Group
 

bnu

bnu

Level 2
Joined
Apr 6, 2012
Messages
17
So the whole actions are
[Trigger=Actions]Copy these actions
Unit - Create 10 Footman for Player 1 (Red) at (Center of (Your Region)) facing Default building facing degrees
Set Unit_Group = (Last created units)[/Trigger]
Variable name : Unit_Group
Vaiable type : Unit Group

maybe Last Created Units group?

and how to default the unit Formation. i'll make the Unit on the group always together, not too fast not too slow and not too far from every other Unit?
 
maybe Last Created Units group?

and how to default the unit Formation. i'll make the Unit on the group always together, not too fast not too slow and not too far from every other Unit?

it actually add them to
JASS:
bj_lastCreatedGroup

heres the full thing for creating units
JASS:
function CreateNUnitsAtLoc takes integer count, integer unitId, player whichPlayer, location loc, real face returns group
    call GroupClear(bj_lastCreatedGroup)
    loop
        set count = count - 1
        exitwhen count < 0
        call CreateUnitAtLocSaveLast(whichPlayer, unitId, loc, face)
        call GroupAddUnit(bj_lastCreatedGroup, bj_lastCreatedUnit)
    endloop
    return bj_lastCreatedGroup
endfunction
 
Status
Not open for further replies.
Top