1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[General] Need help with unit attack ! this is exhausting.

Discussion in 'World Editor Help Zone' started by angeldecastro, Sep 25, 2020.

  1. angeldecastro

    angeldecastro

    Joined:
    Sep 25, 2020
    Messages:
    11
    Resources:
    0
    Resources:
    0
    Hi guys!

    I hope someone can help out. I was trying to place building's as a barricade where unit's will attempt to attack the barricades first. unfortunately once my units attack the attacking enemies they totally ignore the barricade and finds a way to attack my unit's.

    And yes! I did my research already with older post's! for the past 4 days already! unfortunately this just led people having unsatisfying triggers.

    This is the only problem i had with my map. here's what i want to happen
    1. create a unit every seconds
    2. unit attacks any random units i have
    3. unit will attack the barricades first before they attack my heroes who are behind the barricade.

    Someone please im losing hope no one has posted a proper resolution on the older threads.
     
  2. chopinski

    chopinski

    Joined:
    May 16, 2012
    Messages:
    501
    Resources:
    8
    Models:
    1
    Spells:
    7
    Resources:
    8
    Have you tried messing with the Barricade Priority Field?
     
  3. A]mun

    A]mun

    Joined:
    Dec 4, 2007
    Messages:
    1,017
    Resources:
    0
    Resources:
    0
  4. angeldecastro

    angeldecastro

    Joined:
    Sep 25, 2020
    Messages:
    11
    Resources:
    0
    Resources:
    0
    This community is awesome thanks for the reply, The thread that you shared @a|mun was the one that i mentioned in my original post that i already checked. the resolution was not that good, the user was forced to add spell "tornado auro" to zombies just to break the barricades which is not what i have in mind. @chopinski yes i already messed that priorities and it did nothing
     
  5. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,483
    Resources:
    0
    Resources:
    0
    I think it has to do with Armor types. I remember reading something like targets with Fortified armor get ignored if there are other non-Fortified targets nearby.

    Also, try giving your barricades an attack that deals 0-0 damage. That may draw the attention of the enemy AI.
     
  6. DoomBlade

    DoomBlade

    Joined:
    Feb 5, 2018
    Messages:
    380
    Resources:
    0
    Resources:
    0
    How about hidden taunt? Make the barricades buildings owned by player. Order the barricades to cast taunt with some conditions.

    Remove the effects from the taunt.

    The taunt could also have maxium number of targets set to 1 or 2, and small AoE, so it wouldn't bug the units running around hitting different barricades.
     
  7. A]mun

    A]mun

    Joined:
    Dec 4, 2007
    Messages:
    1,017
    Resources:
    0
    Resources:
    0
    The solution you picked up is one of many offered in the thread.

    I think the most impactful/practical way (also with the most workload) would be to replace your barricades with attacking units (structures are by default low priority) + pathing blockers.

    The taunt solution might be worthwhile too.
    If you can live with zombies attacking walls primarily, since they will ignore units, even if they stand right behind them.
     
  8. angeldecastro

    angeldecastro

    Joined:
    Sep 25, 2020
    Messages:
    11
    Resources:
    0
    Resources:
    0
    yea i already did that.
    @DoomBlade are you trying to impose a trigger?
    @A]mun thats interesting however if i replace the barricades units they will spin because of the unit-rotation. what do you mean about pathing blockeres
     
  9. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,483
    Resources:
    0
    Resources:
    0
    Set the unit's Movement Type to None and Speed Base to 0. They will no longer be able to turn or move but they can still attack and cast spells.
     
  10. angeldecastro

    angeldecastro

    Joined:
    Sep 25, 2020
    Messages:
    11
    Resources:
    0
    Resources:
    0
    I already twicked game-constants and set movement speed to 0. problem is unit-turn is not inlcuded in the option so the minimum turn-speed will be 0.10 in the editor, i already thought of that however its capped under 0.10
     
  11. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,483
    Resources:
    0
    Resources:
    0
    The Turn Rate stat doesn't matter in this case, a Unit with those settings will NOT turn. Movement Type needs to be NONE.
     
  12. angeldecastro

    angeldecastro

    Joined:
    Sep 25, 2020
    Messages:
    11
    Resources:
    0
    Resources:
    0
    it will, if its a unit with atleast 0.10 turn it will face the unit that his attacking regardless the movement speed i already tried them you can try it yourself once a unit is placed under 0 movement speed they are already considered a building by the AI and will totally ignore them like the rest of the buildings.
     
  13. angeldecastro

    angeldecastro

    Joined:
    Sep 25, 2020
    Messages:
    11
    Resources:
    0
    Resources:
    0
    im totally fine with that. can you make me a tuant script for all barricades to taunt nearby units
     
  14. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,483
    Resources:
    0
    Resources:
    0
    Either it's different on older versions (i'm using the latest patch) or you aren't changing the Movement Type as well. I just tested it, the units will NEVER turn.

    But if the AI treats them like a building in this case than it doesn't matter anyway, although I'm not sure if that's confirmed or not.
     
  15. A]mun

    A]mun

    Joined:
    Dec 4, 2007
    Messages:
    1,017
    Resources:
    0
    Resources:
    0
    Units are considered a building (priority wise) with 0 movement?

    This begins to intrigue me verily, i'll give it a more thorough testing.
     
  16. angeldecastro

    angeldecastro

    Joined:
    Sep 25, 2020
    Messages:
    11
    Resources:
    0
    Resources:
    0
    im using an older version but i dont think the trigger will be that complicated r
     
  17. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,483
    Resources:
    0
    Resources:
    0
    What trigger? All I'm saying is that setting a unit's Movement Type to NONE and Speed Base to 0 will prevent it from turning. At least that's how it works on the latest patch.

    My suggestion was to use a Unit as a barricade with these movement settings, give it an Attack of 0-0, and give it non-fortified Armor.
     
  18. A]mun

    A]mun

    Joined:
    Dec 4, 2007
    Messages:
    1,017
    Resources:
    0
    Resources:
    0
    ^ Don't we have to make those flying so that we can put pathing blockers under them?
    (btw you can make their movement type flying without beging targeted as air, so melee units can still attack them)

    Indeed 0 movement speed makes the zombies ignore them.

    Findings:
    The solution so far is to have 1 movement speed, 1 max, 0 minimum (change gameplay constants to allow 0 movement speed for buildings).
    Give them attack (0-0 works).
    No fortified armor.

    New problems:
    The walls are turning now, very slowly (even with 0 turn rate).
    The walls are moving now, very slowly.
    Walls will be focussed, even if units are close.
     
  19. [db]east

    [db]east

    Joined:
    Feb 27, 2019
    Messages:
    144
    Resources:
    0
    Resources:
    0
    Lartin posted this in a thread a time ago: call SetUnitPropWindow(<Unit>,0)
    Combine that with setting Turn rate to 0.00 and the unit wont be able to move or turn.
     
  20. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    2,483
    Resources:
    0
    Resources:
    0
    Alright, I think I found a decent solution that solves most noticeable issues.

    The Barricade Unit is setup so that it cannot move/turn and has an attack to draw enemy aggro.

    It's model is made hidden by changing it's transparency to 100% and in it's place is a Barricade Special Effect.

    This Special Effect mimics the model of the Barricade.

    IMPORTANT: I use a Unit Indexer to link each Barricade to it's respective Special Effect. You might need to find an older Unit Indexer that's compatible with your map version. Just search for Unit Indexer, they should all be pretty similar.
    • Setup Barricades 1
      • Events
        • Time - Elapsed game time is 0.00 seconds
      • Conditions
      • Actions
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units of type Barricade) and do (Actions)
          • Loop - Actions
            • Set VariableSet Barricade_Point = (Position of (Picked unit))
            • Special Effect - Create a special effect at Barricade_Point using Doodads\LordaeronSummer\Terrain\Barricade\Barricade0.mdl
            • Special Effect - Set Yaw of (Last created special effect) to: (Radians((Facing of (Picked unit))))
            • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
            • Set VariableSet Barricade_Sfx[(Custom value of (Picked unit))] = (Last created special effect)
            • Custom script: call RemoveLocation (udg_Barricade_Point)

    • Setup Barricades 2
      • Events
        • Unit - A unit enters (Playable map area)
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Barricade
      • Actions
        • Set VariableSet Barricade_Point = (Position of (Triggering unit))
        • Special Effect - Create a special effect at Barricade_Point using Doodads\LordaeronSummer\Terrain\Barricade\Barricade0.mdl
        • Special Effect - Set Yaw of (Last created special effect) to: (Radians((Facing of (Triggering unit))))
        • Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
        • Set VariableSet Barricade_Sfx[(Custom value of (Triggering unit))] = (Last created special effect)
        • Custom script: call RemoveLocation (udg_Barricade_Point)

    • Barricade Death
      • Events
        • Unit - A unit Dies
      • Conditions
        • (Unit-type of (Triggering unit)) Equal to Barricade
      • Actions
        • Special Effect - Destroy Barricade_Sfx[(Custom value of (Triggering unit))]
     

    Attached Files:

    Last edited: Oct 8, 2020