1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Weird Issue with Devour Cargo ability?

Discussion in 'World Editor Help Zone' started by aple, Jun 17, 2017.

  1. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    807
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    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.
     
  2. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,723
    Resources:
    0
    Resources:
    0
    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
     
  3. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    807
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    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: Jun 17, 2017
  4. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,723
    Resources:
    0
    Resources:
    0
    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
     
  5. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    807
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    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):

    Code (vJASS):

    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: Jun 18, 2017