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

Why is this not working -.-

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
Why this trigger Creates enemy units, but doesn't creates Stunner units?

it's not finished and i know it leaks... just answer :)

  • Storm Hammer Loop 2
    • Events
      • Time - StormHammer_Timer expires
    • Conditions
    • Actions
      • Set StormBolt_EnemyUnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 90.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 180.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 270.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 360.00 degrees)
      • Set StormBolt_UnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 90.00 degrees)
      • Set StormBolt_UnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 180.00 degrees)
      • Set StormBolt_UnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 270.00 degrees)
      • Set StormBolt_UnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 360.00 degrees)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Storm Bolt Enemy for Player 12 (Brown) at StormBolt_EnemyUnitsPoints[(Integer A)] facing Default building facing degrees
          • Set StormBolt_EnemyUnits[(Integer A)] = (Last created unit)
          • Unit - Create 1 Dummy Storm Bolt Stunner for (Owner of StormBolt_TrigUnit) at StormBolt_UnitsPoints[(Integer A)] facing Default building facing degrees
          • Set StormBolt_Units[(Integer A)] = (Last created unit)
          • Unit - Add Dummy Storm Bolt to StormBolt_Units[(Integer A)]
          • Unit - Set level of Dummy Storm Bolt for StormBolt_Units[(Integer A)] to (Level of Storm Bolt for StormBolt_TrigUnit)
          • Unit - Order StormBolt_Units[(Integer A)] to Human Mountain King - Storm Bolt StormBolt_EnemyUnits[(Integer A)]
 
Level 18
Joined
May 11, 2012
Messages
2,103
I tried to separate the trigger so I made like this:

Trigger 1:

  • Storm Hammer 2
    • Events
      • Time - StormHammer_Timer[1] expires
    • Conditions
    • Actions
      • Set StormBolt_EnemyUnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 90.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 180.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 270.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 360.00 degrees)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Storm Bolt for Player 12 (Brown) at StormBolt_EnemyUnitsPoints[(Integer A)] facing Default building facing degrees
          • Set StormBolt_EnemyUnits[(Integer A)] = (Last created unit)
          • Countdown Timer - Start StormHammer_Timer[2] as a One-shot timer that will expire in 0.30 seconds
and Trigger 2:

  • Storm Hammer Loop 2
    • Events
      • Time - StormHammer_Timer[2] expires
    • Conditions
    • Actions
      • Set StormBolt_UnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 90.00 degrees)
      • Set StormBolt_UnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 180.00 degrees)
      • Set StormBolt_UnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 270.00 degrees)
      • Set StormBolt_UnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 360.00 degrees)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Storm Bolt Stunner for (Owner of StormBolt_TrigUnit) at StormBolt_UnitsPoints[(Integer A)] facing Default building facing degrees
          • Set StormBolt_Units[(Integer A)] = (Last created unit)
          • Unit - Add Dummy Storm Bolt to StormBolt_Units[(Integer A)]
          • Unit - Set level of Dummy Storm Bolt for StormBolt_Units[(Integer A)] to (Level of Storm Bolt for StormBolt_TrigUnit)
          • Unit - Order StormBolt_Units[(Integer A)] to Human Mountain King - Storm Bolt StormBolt_EnemyUnits[(Integer A)]
and still doesn't works
 
Level 18
Joined
May 11, 2012
Messages
2,103
complete triggers:

  • Storm Hammer
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Hammer
    • Actions
      • Set StormBolt_TrigUnit = (Triggering unit)
      • Set StormBolt_TrigUnitPosition = (Position of StormBolt_TrigUnit)
      • Set StormBolt_TargetUnit = (Target unit of ability being cast)
      • Set StormBolt_TargetUnitPosition = (Position of StormBolt_TargetUnit)
      • Unit - Create 1 Dummy Storm Bolt for (Owner of (Triggering unit)) at StormBolt_TrigUnitPosition facing ((Facing of StormBolt_TrigUnit) / 2.00) degrees
      • Set StormBolt_Dummy = (Last created unit)
      • Trigger - Turn on Storm Hammer Loop <gen>
      • Custom script: call RemoveLocation(udg_StormBolt_TrigUnitPosition)
  • Storm Hammer Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set StormBolt_DummyPosition = (Position of StormBolt_Dummy)
      • Set StormBolt_Angle = (Angle from (Position of StormBolt_TrigUnit) to (Position of StormBolt_TargetUnit))
      • Set StormBolt_MovingDummy = (StormBolt_DummyPosition offset by 17.00 towards StormBolt_Angle degrees)
      • Unit - Move StormBolt_Dummy instantly to StormBolt_MovingDummy, facing StormBolt_Angle degrees
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 125.00 of (Position of StormBolt_Dummy)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to StormBolt_TargetUnit
            • Then - Actions
              • Unit - Add a 0.01 second Generic expiration timer to StormBolt_Dummy
              • Unit - Create 1 Dummy Storm Bolt Stunner for (Owner of StormBolt_TrigUnit) at StormBolt_TargetUnitPosition facing Default building facing degrees
              • Unit - Add Dummy Storm Bolt Stun to (Last created unit)
              • Unit - Set level of Dummy Storm Bolt Stun for (Last created unit) to (Level of Storm Hammer for StormBolt_TrigUnit)
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Special Effect - Create a special effect attached to the origin of StormBolt_TargetUnit using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Add a 0.30 second Generic expiration timer to (Last created unit)
              • Countdown Timer - Start StormHammer_Timer[1] as a One-shot timer that will expire in 0.30 seconds
              • Trigger - Turn off (This trigger)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_StormBolt_DummyPosition)
  • Storm Hammer 2
    • Events
      • Time - StormHammer_Timer[1] expires
    • Conditions
    • Actions
      • Set StormBolt_EnemyUnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 90.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 180.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 270.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 360.00 degrees)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Storm Bolt for Player 12 (Brown) at StormBolt_EnemyUnitsPoints[(Integer A)] facing Default building facing degrees
          • Set StormBolt_EnemyUnits[(Integer A)] = (Last created unit)
          • Countdown Timer - Start StormHammer_Timer[2] as a One-shot timer that will expire in 0.30 seconds
  • Storm Hammer Loop 2
    • Events
      • Time - StormHammer_Timer[2] expires
    • Conditions
    • Actions
      • Set StormBolt_UnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 90.00 degrees)
      • Set StormBolt_UnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 180.00 degrees)
      • Set StormBolt_UnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 270.00 degrees)
      • Set StormBolt_UnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 360.00 degrees)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Storm Bolt Stunner for (Owner of StormBolt_TrigUnit) at StormBolt_UnitsPoints[(Integer A)] facing Default building facing degrees
          • Set StormBolt_Units[(Integer A)] = (Last created unit)
          • Unit - Add Dummy Storm Bolt to StormBolt_Units[(Integer A)]
          • Unit - Set level of Dummy Storm Bolt for StormBolt_Units[(Integer A)] to (Level of Storm Hammer for StormBolt_TrigUnit)
          • Unit - Order StormBolt_Units[(Integer A)] to Human Mountain King - Storm Bolt StormBolt_EnemyUnits[(Integer A)]
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Unit Group - Pick every unit in (Units within 125.00 of (Position of StormBolt_Dummy)) and do (Actions)

^^ Point leak

it would be nice to know what do you want to achieve. There's probably a better way to do it without 4 triggers.
 
Level 18
Joined
May 11, 2012
Messages
2,103
ah, forgot, will fix that now.

Basically, I wanted to make storm bolt like in dota and improve it a bit and I DID that! but the last trigger doesn't works, only that is the problem i want to fixand I can't continue...

Btw, anything else leaks in first two triggers?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
It destroys the group, but not the Point you use to create the group.

But strombolt in dota ins a dummy moved towards a unit, and pick every unit around the point, and stum them (with an AoE stun, or single stun for each unit in group)

Here you're using 4 points and a loop and some other stuff

BTW this ability isn't MUI. It cant be casteable once at the time in the whole map.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I was just advancing forward to future problems you may find with this :) I usually like to Optimize and suggest better ways to handle things some just ignore.

<< EDIT >> Trying to figure it out...

What's this for? It's virtually the same as removing the unit or killing it instantly.
  • Unit - Add a 0.01 second Generic expiration timer to StormBolt_Dummy
Here are leaks
  • Unit Group - Pick every unit in (Units within 125.00 of (Position of StormBolt_Dummy)) and do (Actions)
  • Set StormBolt_EnemyUnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 90.00 degrees)
  • Set StormBolt_EnemyUnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 180.00 degrees)
  • Set StormBolt_EnemyUnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 270.00 degrees)
  • Set StormBolt_EnemyUnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 360.00 degrees)
  • Set StormBolt_UnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 90.00 degrees)
  • Set StormBolt_UnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 180.00 degrees)
  • Set StormBolt_UnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 270.00 degrees)
  • Set StormBolt_UnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 360.00 degrees)
Also, every time unit is created there's a bug leak wich can be removed, but can be avoided, by avoiding unnecessary unit creation.
 
Level 18
Joined
May 11, 2012
Messages
2,103
I was just advancing forward to future problems you may find with this :) I usually like to Optimize and suggest better ways to handle things some just ignore.

<< EDIT >> Trying to figure it out...

What's this for? It's virtually the same as removing the unit or killing it instantly.
  • Unit - Add a 0.01 second Generic expiration timer to StormBolt_Dummy
Here are leaks
  • Unit Group - Pick every unit in (Units within 125.00 of (Position of StormBolt_Dummy)) and do (Actions)
  • Set StormBolt_EnemyUnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 90.00 degrees)
  • Set StormBolt_EnemyUnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 180.00 degrees)
  • Set StormBolt_EnemyUnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 270.00 degrees)
  • Set StormBolt_EnemyUnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 360.00 degrees)
  • Set StormBolt_UnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 90.00 degrees)
  • Set StormBolt_UnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 180.00 degrees)
  • Set StormBolt_UnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 270.00 degrees)
  • Set StormBolt_UnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 360.00 degrees)
Also, every time unit is created there's a bug leak wich can be removed, but can be avoided, by avoiding unnecessary unit creation.

hah, I could also use remove that unit instead of expiring timer, it's the same

i know those are leaks, I asked for leaks in first two triggers
 
Level 8
Joined
Oct 26, 2008
Messages
387
  • Unit - Create 1 Dummy Storm Bolt for Player 12 (Brown) at StormBolt_EnemyUnitsPoints[(Integer A)] facing Default building facing degrees
    • Unit - Order StormBolt_Units[(Integer A)] to Human Mountain King - Storm Bolt StormBolt_EnemyUnits[(Integer A)]
Are you sure those 2 players are enemies?
 
Level 8
Joined
Oct 26, 2008
Messages
387
  • Storm Hammer 2
    • Events
      • Time - StormHammer_Timer[1] expires
    • Conditions
    • Actions
      • Set StormBolt_EnemyUnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 90.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 180.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 270.00 degrees)
      • Set StormBolt_EnemyUnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 450.00 towards 360.00 degrees)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Storm Bolt for Player 12 (Brown) at StormBolt_EnemyUnitsPoints[(Integer A)] facing Default building facing degrees
          • Set StormBolt_EnemyUnits[(Integer A)] = (Last created unit)
          • Countdown Timer - Start StormHammer_Timer[2] as a One-shot timer that will expire in 0.30 seconds

Here in trigger #3 you create 4 units. And you se those units, in StormBolt_EnemyUnits variable.


  • Storm Hammer Loop 2
    • Events
      • Time - StormHammer_Timer[2] expires
    • Conditions
    • Actions
      • Set StormBolt_UnitsPoints[1] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 90.00 degrees)
      • Set StormBolt_UnitsPoints[2] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 180.00 degrees)
      • Set StormBolt_UnitsPoints[3] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 270.00 degrees)
      • Set StormBolt_UnitsPoints[4] = ((Position of StormBolt_TargetUnit) offset by 125.00 towards 360.00 degrees)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Storm Bolt Stunner for (Owner of StormBolt_TrigUnit) at StormBolt_UnitsPoints[(Integer A)] facing Default building facing degrees
          • Set StormBolt_Units[(Integer A)] = (Last created unit)
          • Unit - Add Dummy Storm Bolt to StormBolt_Units[(Integer A)]
          • Unit - Set level of Dummy Storm Bolt for StormBolt_Units[(Integer A)] to (Level of Storm Hammer for StormBolt_TrigUnit)
          • Unit - Order StormBolt_Units[(Integer A)] to Human Mountain King - Storm Bolt StormBolt_EnemyUnits[(Integer A)]

Here, in trigger #4 you create 4 more units, and set them as StormBolt_Units. And then you order StormBolt_Units, (created in trigger #4) to storm bolt StormBolt_EnemyUnits (created in trigger#3)

So i am asking, is "Player 12 (Brown)" an enemy with "(Owner of StormBolt_TrigUnit)" because if they are allies, your StormBolt_Units, (created in trigger #4) wont be able to cast storm bolt in StormBolt_EnemyUnits (created in trigger#3)

EDIT: Also, are units "Dummy Storm Bolt" Immune to magic, or invisible, or locusted, or invunlerable?
EDIT2: Also does your Dummy Storm Bolt ability require mana to be cast? And if so, does your Dummy Storm Bolt unit has enough mana?
 
Status
Not open for further replies.
Top