• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Weird Issue with Devour Cargo ability?

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
To recreate: Add Devour Cargo Hold to a unit and then load/unload. Load a unit, then try to unload it.

It seems as though manually unloading a unit cannot find a proper position to place the unit, so it just sets them at the center of the map. If you click on the unit's icon in the UI of the unit with the cargo hold, they'll pop out right next to the unit just fine. This can't really be ordered via trigger as far as I'm aware, though. Only unloading onto a point. Which then causes the unit to spawn at the center of the map. Any ideas what's wrong or how to fix it? I've tried adjusting the unit's collision size, I've tried increasing the range on the devour cargo hold ability and load/unload abilities, but nothing seems to work.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Add the transport ability to the unit as well and it will automatically assign devoured units to be off loaded as if transport units

Just remember to set the transport ability to zero storage
 
Level 12
Joined
May 20, 2009
Messages
822
That doesn't seem to do anything. Can you be a bit more specific?

To clarify: I'm copying the Goblin Transport cargo hold ability. I'm setting the size to 0. And I'm adding it onto the unit that also has my Devour Cargo ability. That's what you meant, right? It doesn't seem to do anything.
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
That doesn't seem to do anything. Can you be a bit more specific?

To clarify: I'm copying the Goblin Transport cargo hold ability. I'm setting the size to 0. And I'm adding it onto the unit that also has my Devour Cargo ability. That's what you meant, right? It doesn't seem to do anything.
Huh... yes you followed my instructions correctly

I seem to recall having the same problem but I did solve it.

How I apparently can no longer remember.

How about whenever that ability is triggered you kill and replace the unit using the ability, keeping their stats like health and so on so that it doesn't auto heal the caster.

Oh wait I remember now. I gave the unit the resurrect ability from the ank of life, then created a trig that kills who ever uses that ability. Modify the ank of life so that it shows no visuals and doesn't change the health on resurrection, and also change it so that it resurrect units instantly, this result in no visual evidence that they have died when the ability is triggered. Add the ability of the ank to the unit and remove it 1 second in game every time the ability is cast.

Your trigger should be as follows

Event
...

Condition
...

action

give ability ank
kill
remove ability ank
 
Level 12
Joined
May 20, 2009
Messages
822
I need to be careful when using something like kill, because it's important that the score remains intact when using it. That shouldn't add to the score screen's Units Lost or Resources Lost or anything like that right?

Also this feels like a pretty hacky solution. Is there nothing else that can be done?

EDIT:

So after using the order analyzer script thing (I forgot where I got it from, but I didn't write it):

JASS:
function Trig_orders_Actions takes nothing returns nothing
    local integer order = GetIssuedOrderId()
    call BJDebugMsg(GetUnitName(GetOrderedUnit()) + " has been ordered " + OrderId2String(order)+ " ("+I2S(order)+")")
endfunction

function InitTrig_orders takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ISSUED_ORDER )
    call TriggerAddAction(t, function Trig_orders_Actions)
endfunction

There does appear to be an order ID and way to emulate clicking on the icon in the cargo hold of the unit. By doing this:


  • Unit - Order DevourUnit to Unload DevourVictim
This is an Order Targeting a Unit, and the target is the unit that is loaded in the cargo hold. This makes them eject the unit perfectly fine. :D

It doesn't really make sense what's happening with UnloadAll order though. It's as though feeding an order point into Devour Cargo Hold is completely clearing where to dump the unit out.

EDIT2:

Okay so I managed to get the actual unloading process working how I want except one thing: If you spam an order enough, say Stop, the unit can't unload because the unloading process takes a long time, even with everything set to as low as it'll go. The only way I think I can fix this is by having some kind of transport system that can tell me what units are loaded into which transports and from there I know what I can do.

I'm going to add the Devour Cargo unit into a unit group when something loads into them, and remove them from the group when something is unloaded. When they're deindexed normally, if you're spamming stop they won't be removed from the group because they'll still have cargo. I'll set the unit's custom value to 1 when they're deindexed as well (I won't be using special value for anything else really) so they can be easily sorted into a system that will continue to order them to unload continuously if they have a special value of 1 and are inside of the group. This is not a perfect fix but unless I can directly remove a unit from their cargo space without having to issue them an order, I think this is all that can be done.

EDIT3: I ended up not needing any special system to do this, I can just use that custom value and use a Unit is in Transport condition.
 
Last edited:
Status
Not open for further replies.
Top