HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Force Unload a single unit

05-21-2006, 08:04 AM#1
Pheonix-IV
Alrighty, i have my trigger as follows -

Trigger:
Training
Collapse Events
Time - TrainingTimer expires
Conditions
Collapse Actions
Set TempGroup = (Units in (Entire map) matching (((Matching unit) is A structure) Equal to True))
Collapse Unit Group - Pick every unit in TempGroup and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Picked unit)) Equal to Training Grounds (Human)
(Unit-type of (Picked unit)) Equal to Training Grounds (Orc)
Collapse Then - Actions
Set TempPoint = (Position of (Picked unit))
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Set TempGroup2 = (Units owned by (Player((Integer A))) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is loaded into (Picked unit)) Equal to True)))
Collapse Unit Group - Pick every unit in TempGroup2 and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Hero level of (Picked unit)) Less than or equal to 2
Collapse Then - Actions
Hero - Add 5 experience to (Picked unit), Hide level-up graphics
Collapse Else - Actions
Do nothing
Collapse Else - Actions
Do nothing
Custom script: call DestroyGroup (udg_TempGroup)
Custom script: call DestroyGroup (udg_TempGroup2)
Custom script: call RemoveLocation (udg_TempPoint)

And this is all fine an dandy. However, i'd like to make it so that this bit -

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Hero level of (Picked unit)) Less than or equal to 2
Collapse Then - Actions
Hero - Add 5 experience to (Picked unit), Hide level-up graphics
Collapse Else - Actions
Do nothing

Instead of doing nothing if the unit is level 3 or higher, to unload the unit instead. I can make the training grounds unload all units, but i can't seem to work out how to make it unload just the units at level 3 or over. And ideas?
05-21-2006, 06:01 PM#2
Naakaloh
Collapse JASS:
call IssuePointOrderLocBJ( GetEnumUnit(), "unloadall", UnloadLocation )

I think that translates back into GUI as something like:

Trigger:
Unit - Order Picked Unit to Unload All At UnloadLocation

Edit: I think the only issue is making sure that the unit will be able to get into range of the point, but that only matters if the 'transport' is immobile.
05-21-2006, 07:11 PM#3
blu_da_noob
Quote:
Originally Posted by Pheonix-IV
I can make the training grounds unload all units


I'm checking out something on this right now.

Edit:
Trigger:
Unit - Order Goblin Zeppelin 0001 <gen> to Unload Knight 0000 <gen>
It's the 'Issue order targetting a unit'.
05-22-2006, 06:06 AM#4
Pheonix-IV
Aha! Thanks, it never occured to me that i'd have to order the Training Grounds to unload the unit, makes sense now that i think about it though.

Cheers blu!