• 🏆 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] Leak in triggers

Status
Not open for further replies.
Level 1
Joined
Jun 5, 2008
Messages
151
Hi i will make a list for few triggers here and if someone can help me to optimize them and make less leaks i will appreciate it ;)

First Trigger

  • First Trigger
    • Events
      • Unit - A unit is starting to cast spell
    • Conditions
      • (Ability being cast) = Spell
    • Actions
      • Sound - Play Sound <gen> at 100.00% volume, attached to (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInteger1 < 1000
        • Then - Actions
          • Set TempInteger1 = (TempInteger1 + 1)
        • Else - Actions
          • Set TempInteger1 = 1
      • Set TP[1] = (Position of (Triggering unit))
      • Set TP[2] = (Target point of ability being cast)
      • Unit - Move (Triggering unit) instantly to TP[2]
      • Unit - Create 1 Hero (Dummy) for (Owner of (Triggering unit)) at TP[1] facing (Angle from TP[1] to TP[2]) degrees
      • Unit - Add a 0.50 second Ogólny expiration timer to (Last created unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) = Hero methamorphosis
        • Then - Actions
          • Unit - Hide (Last created unit)
          • Unit - Create 1 Hero methamophosis (Dummy) for (Owner of (Triggering unit)) at TP[1] facing (Angle from TP[1] to TP[2]) degrees
        • Else - Actions
      • Unit - Set the custom value of (Last created unit) to TempInteger1
      • Unit - Set the custom value of (Triggering unit) to TempInteger1
      • Unit Group - Add (Last created unit) to TG[1]
      • Unit Group - Add (Triggering unit) to TG[2]
      • Custom script: call RemoveLocation(udg_TP[1])
      • Custom script: call RemoveLocation(udg_TP[2])
Second Trigger

  • Second Trigger
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (TG[1] is empty) = NO
          • (TG[2] is empty) = NO
    • Actions
      • Unit Group - Pick every unit in TG[1] and do (Actions)
        • Loop - Actions
          • Set CV = (Custom value of (Picked unit))
          • Set TempInteger3[CV] = (TempInteger3[CV] + 10)
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with (Real(TempInteger3[CV]))% transparency
          • Set TP[1] = (Position of (Picked unit))
          • Set TP[2] = (TP[1] offset by (Random real number between -10.00 and 10.00) towards (Random angle) degrees)
          • Unit - Move (Picked unit) instantly to TP[2]
          • Custom script: call RemoveLocation(udg_TP[1])
          • Custom script: call RemoveLocation(udg_TP[2])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempInteger3[CV] ">" or "=" 100
            • Then - Actions
              • Set TempInteger3[CV] = 0
              • Unit - Remove (Picked unit) from the game
              • Unit Group - Remove (Picked unit) from TG[1]
            • Else - Actions
      • Unit Group - Pick every unit in TG[2] and do (Actions)
        • Loop - Actions
          • Set CV = (Custom value of (Picked unit))
          • Set TempInteger4[CV] = (TempInteger4[CV] + 10)
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with (100.00 - (Real(TempInteger4[CV])))% transparency
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempInteger4[CV] ">" or "=" 100
            • Then - Actions
              • Set TempInteger4[CV] = 0
              • Unit Group - Remove (Picked unit) from TG[2]
            • Else - Actions

If there are any leaks please tell me where and i will test it, thanks. I will add another triggers tomorrow ;)
 
Last edited:
Level 18
Joined
Jan 21, 2006
Messages
2,552
You realize you can copy GUI code as text and just paste it onto the forum, right?

Here's an example:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Selection - Clear selection for Player 1 (Red)
      • AI - Start melee AI script for Player 1 (Red): map.ai
      • Neutral Building - Add 5000 gold to No unit
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area))) Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Last created item)) Equal to Tome of Experience
            • Then - Actions
              • Selection - Clear selection for Player 1 (Red)
            • Else - Actions
        • Else - Actions
This trigger is complete non-sense, but all of the formatting is proper. Its kind of hard to read with the format all screwed up.
 
Level 1
Joined
Jun 5, 2008
Messages
151
ok i will do it ;) wait =]


I edited first post. anyway thanks for helping me with that =]
 
Last edited:
Level 1
Joined
Jun 5, 2008
Messages
151
ahh my bad ;) i will change it =]


ok I changed it...If you can I have another question.


This skill base on "Blink" Can you tell me how to make to allow my character teleport only on ground? I mean hmm actually when i use this skill i can teleport to water or even to "bourn" i can teleport to any type of terrain ;( I dont want it, Can i change something in this trigger to allow teleport only on ground? because when i teleport to water I cant move -.-
 
Level 1
Joined
Jun 5, 2008
Messages
151
ok i will post this spell in map....but later =] and one more thing...this spell isnt casting on unit but on ground...it is blink ;) it is my problem ^_^
 
Status
Not open for further replies.
Top