• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] have a problem with a spell

Status
Not open for further replies.
Level 19
Joined
Feb 15, 2008
Messages
2,184
the spell kills my friendly units and my self?
  • TimeWalk Start
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Time Walk
    • Actions
      • Set TW_Unit = (Triggering unit)
      • Set TW_TrigUnitPoint = (Position of TW_Unit)
      • Set TW_DashPoint = (Target point of ability being cast)
      • Set TW_Angle = (Angle from TW_TrigUnitPoint to TW_DashPoint)
      • Set TW_MaxDistance = (Distance between TW_TrigUnitPoint and TW_DashPoint)
      • Set TW_DistanceTraveled = 0.00
      • Unit - Turn collision for TW_Unit Off
      • Unit - Pause TW_Unit
      • Animation - Play (Triggering unit)'s spell animation
      • Animation - Change TW_Unit's vertex coloring to (0.00%, 0.00%, 0.00%) with 50.00% transparency
      • Special Effect - Create a special effect attached to the left hand of TW_Unit using <Empty String>
      • Set TW_Unit_effect[1] = (Last created special effect)
      • Special Effect - Create a special effect attached to the right hand of TW_Unit using <Empty String>
      • Set TW_Unit_effect[2] = (Last created special effect)
      • Custom script: call RemoveLocation(udg_TW_TrigUnitPoint)
      • Custom script: call RemoveLocation(udg_TW_DashPoint)
      • Wait 0.50 seconds
      • Trigger - Turn on TimeWalk Dash <gen>
  • TimeWalk Dash
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TW_DistanceTraveled Greater than or equal to TW_MaxDistance
        • Then - Actions
          • Set TW_DistanceTraveled = 0.00
          • Set TW_DashPoint = (Position of TW_Unit)
          • Unit - Turn collision for TW_Unit On
          • Animation - Change TW_Unit's vertex coloring to (8.50%, 48.00%, 100.00%) with 0.00% transparency
          • Special Effect - Destroy TW_Unit_effect[1]
          • Special Effect - Destroy TW_Unit_effect[2]
          • Unit - Create 1 Dummy Unit WALKER for (Owner of TW_Unit) at TW_DashPoint facing Default building facing degrees
          • Unit - Set level of Time Walk Dummy for (Last created unit) to (Level of AoE Life Drain for TW_Unit)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
          • Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
          • Unit - Unpause TW_Unit
          • Custom script: call RemoveLocation(udg_TW_DashPoint)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Set TW_TrigUnitPoint = (Position of TW_Unit)
          • Set TW_DashPoint = (TW_TrigUnitPoint offset by 15.00 towards TW_Angle degrees)
          • Unit - Move TW_Unit instantly to TW_DashPoint
          • Set TW_DistanceTraveled = (TW_DistanceTraveled + 15.00)
          • Destructible - Pick every destructible within 100.00 of TW_DashPoint and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
          • Unit Group - Pick every unit in (Units within 100.00 of TW_DashPoint matching (TW_Unit Not equal to (Matching unit))) and do (Actions)
            • Loop - Actions
              • Unit - Cause TW_Unit to damage (Picked unit), dealing 100.00 damage of attack type Normal and damage type Normal
          • Custom script: call RemoveLocation(udg_TW_TrigUnitPoint)
          • Custom script: call RemoveLocation(udg_TW_DashPoint)

so where is the problem?
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
You don't turn of the Else making it pick every unit and keep damaging it for 100 damage each 0.01 seconds? xD
And I think that the Pick every unit... action is kinda bugged aswell, it also picks your allies? xD (Not sure about that one though.)

You should also clean the leak that the pick every unit thing makes.
 
Level 3
Joined
Feb 13, 2008
Messages
65
  • Unit Group - Pick every unit in (Units within 100.00 of TW_DashPoint matching (TW_Unit Not equal to (Matching unit))) and do (Actions)
  • Loop - Actions
  • Unit - Cause TW_Unit to damage (Picked unit), dealing 100.00 damage of attack type Normal and damage type Normal
Thats your issue. Every 0.01 seconds of the game, everyone within 100 range of TW_DashPoint (Including your allies) Takes 100 damage.

To fix this, simple change it to this:
  • Unit Group - Pick every unit in (Units within 100.00 of TW_DashPoint matching ( (Matching unit)) is an enemy of Tw_Unit) and do (Actions)
This will make it select only enemies. Also, I suggest not using the event "Every 0.01 seconds" as it not only lags, but will basically kill anything in your map that this spell hits. If you were going for 100 damage every second, change it to "Every 1 second".
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
  • TimeWalk Dash
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TW_DistanceTraveled Greater than or equal to TW_MaxDistance
        • Then - Actions
          • Set TW_DistanceTraveled = 0.00
          • Set TW_DashPoint = (Position of TW_Unit)
          • Unit - Turn collision for TW_Unit On
          • Animation - Change TW_Unit's vertex coloring to (8.50%, 48.00%, 100.00%) with 0.00% transparency
          • Special Effect - Destroy TW_Unit_effect[1]
          • Special Effect - Destroy TW_Unit_effect[2]
          • Unit - Create 1 Dummy Unit WALKER for (Owner of TW_Unit) at TW_DashPoint facing Default building facing degrees
          • Unit - Set level of Time Walk Dummy for (Last created unit) to (Level of Time Walk for TW_Unit)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
          • Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
          • Unit - Unpause TW_Unit
          • Custom script: call RemoveLocation(udg_TW_DashPoint)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Set TW_TrigUnitPoint = (Position of TW_Unit)
          • Set TW_DashPoint = (TW_TrigUnitPoint offset by 15.00 towards TW_Angle degrees)
          • Unit - Move TW_Unit instantly to TW_DashPoint
          • Set TW_DistanceTraveled = (TW_DistanceTraveled + 15.00)
          • Destructible - Pick every destructible within 100.00 of TW_DashPoint and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
          • Unit Group - Pick every unit in (Units within 100.00 of TW_DashPoint matching (((Matching unit) belongs to an enemy of (Owner of TW_Unit)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Cause TW_Unit to damage (Picked unit), dealing 100.00 damage of attack type Normal and damage type Normal
          • Custom script: call RemoveLocation(udg_TW_TrigUnitPoint)
          • Custom script: call RemoveLocation(udg_TW_DashPoint)
i made it like this now it doesent work he dont move ? i mean the unit :S he move 1 mm a sec ? whats wrong?
 
Level 3
Joined
Feb 13, 2008
Messages
65
  • TimeWalk Dash
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TW_DistanceTraveled Greater than or equal to TW_MaxDistance
        • Then - Actions
          • Set TW_DistanceTraveled = 0.00
          • Set TW_DashPoint = (Position of TW_Unit)
          • Unit - Turn collision for TW_Unit On
          • Animation - Change TW_Unit's vertex coloring to (8.50%, 48.00%, 100.00%) with 0.00% transparency
          • Special Effect - Destroy TW_Unit_effect[1]
          • Special Effect - Destroy TW_Unit_effect[2]
          • Unit - Create 1 Dummy Unit WALKER for (Owner of TW_Unit) at TW_DashPoint facing Default building facing degrees
          • Unit - Set level of Time Walk Dummy for (Last created unit) to (Level of Time Walk for TW_Unit)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
          • Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
          • Unit - Unpause TW_Unit
          • Custom script: call RemoveLocation(udg_TW_DashPoint)
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Set TW_TrigUnitPoint = (Position of TW_Unit)
          • Set TW_DashPoint = (TW_TrigUnitPoint offset by 15.00 towards TW_Angle degrees)
          • Unit - Move TW_Unit instantly to TW_DashPoint
          • Set TW_DistanceTraveled = (TW_DistanceTraveled + 15.00)
          • Destructible - Pick every destructible within 100.00 of TW_DashPoint and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
          • Unit Group - Pick every unit in (Units within 100.00 of TW_DashPoint matching (((Matching unit) belongs to an enemy of (Owner of TW_Unit)) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Cause TW_Unit to damage (Picked unit), dealing 100.00 damage of attack type Normal and damage type Normal
          • Custom script: call RemoveLocation(udg_TW_TrigUnitPoint)
          • Custom script: call RemoveLocation(udg_TW_DashPoint)
i made it like this now it doesent work he dont move ? i mean the unit :S he move 1 mm a sec ? whats wrong?

Right now you have it where every 1 second, he moves to TW_Dashpoint. The simplest way to fix this is to make a third trigger, that basically does:

Trigger 3 (Initially off)
  • Events
  • Time - Every 0.01 seconds of game time
  • Conditions
  • Actions -
    • Set TW_TrigUnitPoint = (Position of TW_Unit)
    • Set TW_DashPoint = (TW_TrigUnitPoint offset by 15.00 towards TW_Angle degrees)
      • Unit - Move TW_Unit instantly to TW_DashPoint
    • Set TW_DistanceTraveled = (TW_DistanceTraveled + 15.00)
    • Custom script: call RemoveLocation(udg_TW_TrigUnitPoint)
    • Custom script: call RemoveLocation(udg_TW_DashPoint)
And remove those from your second trigger.

Have your first trigger turn this trigger on, and have your second trigger turn it off along with the Turn Off (This Trigger) action.
 
Status
Not open for further replies.
Top