• 🏆 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] Generate and launch orbs

Status
Not open for further replies.
Level 5
Joined
Feb 18, 2016
Messages
96
Hello

I was trying to make an ability that should work this way

The hero generates a Custom unit above his position and make the custom move to the position of the nearest hero

The Custom unit will explode when it arrives to the saved position causing AOE damage but it will not follow the enemy if he moves

Every time the Custom unit dies the trigger should generate another that will follow the same commands until it reaches a specific limit

These are the triggers i have made for this spell but it does not work at all

Any help?


This trigger is the one who spawns the initial unit and sets the variables where the real 3 is the amount of units remaining to generate and the real 2 is a detection range that periodically updates to detect the nearest hero
  • CAST
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to SPELL
    • Actions
      • Set RATREAL[1] = 2.00
      • Set RATREAL[2] = 110.00
      • Set RATREAL[3] = 10.00
      • Trigger - Run Spawns <gen> (checking conditions)
      • Game - Display to (All players) the text: CAST
This is the trigger that spawns the custom unit and turns on the hero detector
  • Spawns
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: SPAWN
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RATREAL[3] Less than or equal to 0.00
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Set RPoint = (Position of Aatrox)
          • Set APOINTTEMP = (Position of (Dying unit))
          • Unit - Create 1 CUSTOM for (Owner of Hero) at APOINTTEMP facing Default building facing degrees
          • Set Summoned = (Last created unit)
          • Custom script: call RemoveLocation (udg_APOINTTEMP)
          • Set RATREAL[3] = (RATREAL[3] - 1.00)
          • Game - Display to (All players) the text: MOVE
          • Trigger - Turn on Detect heroes <gen>
This trigger run every time the custom unit dies generatin another and lowering the variable until it reaches 0
  • Regenerate
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Summoned
    • Actions
      • Set APOINTTEMP = (Position of (Dying unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 200.00 of APOINTTEMP) and do (Actions)
        • Loop - Actions
          • Unit - Cause Hero to damage (Picked unit), dealing damage of attack type Normal and damage type Normal
      • Custom script: call RemoveLocation (udg_APOINTTEMP)
      • Trigger - Run Spawns <gen> (checking conditions)
      • Game - Display to (All players) the text: DEAD
      • Set RATREAL[3] = (RATREAL[3] - 1.00)

This trigger search for a hero nearest hero increasing the real[3] each time it does not find any
Being the real[3] used as an area it detects the closest hero to the point
  • Detect heroes
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set RPoint = (Position of Hero)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within RATREAL[2] of APOINTTEMP) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to False
            • Then - Actions
              • Set RATREAL[2] = (RATREAL[2] + 100.00)
            • Else - Actions
              • Set APOINTTEMP = (Position of (Picked unit))
              • Unit - Order (Summoned) to Move To APOINTTEMP
              • Custom script: call RemoveLocation (udg_APOINTTEMP)
              • Set RATREAL[2] = 110.00
              • Trigger - Turn off (This trigger)
      • Custom script: call RemoveLocation (udg_RPoint)

This trigger kills the unit until it reaches the point
  • stop
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ordered unit) Equal to Summoned
          • (Issued order) Equal to (Order(stop))
        • Then - Actions
          • Unit - Kill Summoned
        • Else - Actions
 
CAST

  • What is RATREAL[1]? I strongly recommend to change names and to use seperate variables. One for each use case, and not mixed array.
  • The variable that counts remaining spanws should be an integer variable, not a real.

SPAWNS

  • The trigger has no event, you don't need to turn it off.
  • There is not necessarily a "Dyning Unit".
  • The unit variables are ... I'm not sure what. I hope they are set properly somewhere else(?).

Other triggers slightly confuse me, too, like the periodic event, but we should talk about what the exact problem is / still will be first. Was/is the spawn at wrong position?
 
Level 5
Joined
Feb 18, 2016
Messages
96
CAST

  • What is RATREAL[1]?
It was supposed to be a damage modifier but i did not add it because of the units not spawning in first place

SPAWNS
Other triggers slightly confuse me, too, like the periodic event, but we should talk about what the exact problem is / still will be first. Was/is the spawn at wrong position?
The periodic event is an attemp to some kind of system to detect the nearest hero to a point
It checks for heroes within an area of 110
If there are no heroes it updates the area of detection in 100 units

-----------------------------------------------------

Made the changes you have suggested to me but the problem still here

Units are no generated and i dont know why
 
Status
Not open for further replies.
Top