• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
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