• 🏆 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!

[Trigger] Region that stays

Status
Not open for further replies.
Level 6
Joined
May 9, 2010
Messages
127
Trigger 1 starts the effect

  • TotemChargeCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tauren Lancer - Totem Charge
    • Actions
      • Set TotemCharge = (Target point of ability being cast)
      • Wait 0.00 seconds
      • Set TempLoc1 = (Position of (Triggering unit))
      • Unit - Pause (Triggering unit)
      • Animation - Play (Triggering unit)'s attack slam animation
      • Unit - Move (Triggering unit) instantly to TempLoc1, facing TotemCharge
      • Special Effect - Create a special effect at TempLoc1 using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Set TotemChargeRegion = (Region centered at TotemCharge with size (10.00, 10.00))
      • Trigger - Add to TotemChargeArrival <gen> the event (Unit - A unit enters TotemChargeRegion)
      • Set TotemChargeTimer = 1

This one doesn't have problems, it works fine.

  • TotemCharge
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • ((Playable map area) contains TotemCharge) Equal to True
      • TotemChargeTimer Not equal to 0
    • Actions
      • Set TempLoc1 = (Position of TaurrenLancer)
      • Set TempLoc2 = (TempLoc1 offset by 7.00 towards (Facing of TaurrenLancer) degrees)
      • Item - Show Claws of Attack +15 0085 <gen>
      • Item - Move Claws of Attack +15 0085 <gen> to TempLoc2
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Set TempRegion = (Region centered at TempLoc2 with size (7.00, 7.00))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Claws of Attack +15 0085 <gen> is in TempRegion) Equal to True
        • Then - Actions
          • Unit - Move TaurrenLancer instantly to TempLoc2, facing TotemCharge
        • Else - Actions
          • Trigger - Run TotemChargeArrival <gen> (ignoring conditions)
      • Custom script: call RemoveRect(udg_TempRegion)
      • Item - Hide Claws of Attack +15 0085 <gen>
      • Custom script: call RemoveLocation(udg_TempLoc2)

This is the one that requires attention

  • TotemChargeArrival
    • Events
    • Conditions
      • (Entering unit) Equal to TaurrenLancer
    • Actions
      • Set TempLoc1 = (Position of TaurrenLancer)
      • Set TempGroup = (Units within 250.00 of TempLoc1 matching ((((Unit-type of (Matching unit)) is A Hero) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of TaurrenLancer)) Equal to True)))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy for (Owner of TaurrenLancer) at TempLoc1 facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Stun to (Last created unit)
          • Unit - Set level of Stun for (Last created unit) to (Level of Tauren Lancer - Totem Charge for TaurrenLancer)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
      • Special Effect - Create a special effect at TempLoc1 using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Unpause TaurrenLancer
      • Animation - Play TaurrenLancer's Reset Unit Animation animation
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Set TotemChargeTimer = 0
      • Custom script: call RemoveRect(udg_TotemChargeRegion)
      • Custom script: call RemoveLocation(udg_TotemCharge)


My problem is, after everything is done, when the unit walks where it had stopped before, it will trigger the effect.

I tried all I could thing of, moving a real region, and all it does is nothing, the unit never "enters" it even though I checked where the region is on every state.

I need to make it so when the unit enters the region, it does the effect and it removes it from the map. But the custom script doesn't do it or it's not working properly.

Thanks for any help, I'll reward with rep. I'm really bugged on this one.
 
Last edited:
Level 6
Joined
May 9, 2010
Messages
127
The region enter event uses the region at map initialization, it doesn't update the event when you move the region.

I don't recommend using a region. Use a real instead, distance.

You shouldn't create an item every 0.01 seconds. Create one at map initialization. Move it, do the check and hide it.

I fixed the item thingy

now I changed the trigger to show what other way I thought of it, and what I saw on the hive as an alternative. It works, the skill works as intended except everytime I go back on exact spot of the variable region, it still pops the effect

even though I really made sure to call RemoveRect(udg_TotemChargeRegion)
 
Status
Not open for further replies.
Top