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

Powerup Trigger Annoyance...

Status
Not open for further replies.
Level 6
Joined
Aug 29, 2008
Messages
134
I'm having some trouble with a trigger.
It's an automatic powerup system, so you don't have to right-click items.
But, ehh... it doesn't really work.

I can't seem to find my error :ugly:

This isn't going to be in any real map, but is for training/learning purposes, so i would be happy if someone could point the error out for me :)

  • Powerup Trigger
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set tempLoc = (Position of Player)
      • Set tempGroup = (Units within 48.00 of tempLoc matching ((Owner of (Matching unit)) Equal to Neutral Passive))
      • Unit Group - Pick every unit in tempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Health Orb
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit - Set life of Player to ((Life of Player) + 25.00)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Mana Orb
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Unit - Kill (Picked unit)
                  • Unit - Set mana of Player to ((Mana of Player) + 25.00)
                • Else - Actions
      • Custom script: call RemoveLocation( udg_tempLoc )
      • Custom script: call DestroyGroup( udg_tempGroup )
I will continue to try and find the fault myself, and update the thread if some of my wacked ideas works.


EDIT: Removed signature
EDIT2: Found out the problem. Apparently when you put locust on units, they wont get picked up by triggers.
 
Last edited:
Oh, you solved it, because I tried another way, with items.
  • One
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Target item of issued order)) Equal to Health Stone
          • (Item-type of (Target item of issued order)) Equal to Mana Stone
    • Actions
      • Custom script: local item i = GetOrderTargetItem()
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local real x = GetItemX (i)
      • Custom script: local real y = GetItemY (i)
      • Custom script: call IssuePointOrder (u, "move", x, y)
      • Custom script: set i = null
      • Custom script: set u = null
  • Two
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Item - Pick every item in (Playable map area) and do (Actions)
        • Loop - Actions
          • Set Points[1] = (Position of (Picked item))
          • Set UnitGroup = (Units of type Blood Mage)
          • Unit Group - Pick every unit in UnitGroup and do (Actions)
            • Loop - Actions
              • Set Points[2] = (Position of (Picked unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between Points[1] and Points[2]) Less than or equal to 60.00
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Picked item)) Equal to Health Stone
                    • Then - Actions
                      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 25.00)
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\Heal\HealTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-type of (Picked item)) Equal to Mana Stone
                        • Then - Actions
                          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + 25.00)
                          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Items\AIre\AIreTarget.mdl
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                  • Item - Remove (Picked item)
                • Else - Actions
              • Custom script: call RemoveLocation (udg_Points[2])
          • Custom script: call DestroyGroup (udg_UnitGroup)
          • Custom script: call RemoveLocation (udg_Points[1])
Test Map:
View attachment Nearby Items' Pickup.w3x
 
Status
Not open for further replies.
Top