1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] My trigger have memory leak?

Discussion in 'Triggers & Scripts' started by narutoj, Nov 4, 2007.

  1. narutoj

    narutoj

    Joined:
    Apr 22, 2007
    Messages:
    16
    Resources:
    0
    Resources:
    0
    Events
    Every 15.00 seconds of game time

    Conditions

    Actions
    Unit Group - Pick every unit in (Units owned by Hostile) and do (Actions)
    Loop actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    (Percentage life of (Picked unit)) Equal 50.00

    Then - Actions
    Custom script: set by_wantDestroyGroup = true
    Set horo_go_fight = (Random point in (playable map area))
    unit - Order (Picked unit) to attack to move horo_go_fight
    Custom script: call RemoveLocation(udg_horo_go_fight)

    Else - Actions
    Do nothing
    Custom script: call RemoveLocation(udg_horo_go_fight)
     
  2. DenZel94

    DenZel94

    Joined:
    Jun 4, 2006
    Messages:
    127
    Resources:
    5
    Maps:
    3
    Tutorials:
    2
    Resources:
    5
    Thats

    • Poop
      • Events
        • Time - Every 15.00 seconds of the game
      • Conditions
      • Actions
        • Custom script: set bj_wantDestroyGroup
        • Unit Group - Pick every unit in (units owned by (Hostile)) and do (Actions)
          • Loop - Actions
            • If (All conditions) are true then do (Actions), else do (Else Actions)
              • If - Conditions
                • (Percentage Life of (Picked Unit)) LESS THAN or equal to 50.00
              • Then - Actions
                • Set horo_go_fight = (Random point in (Playable Map Area))
                • Unit - Order (Picked unit) to attack-move to horo_go_fight
                • Custom script: call RemoveLocation(udg_horo_go_fight)
              • Else - Actions
                • Custom script: call RemoveLocation(udg_horo_go_fight)


    Just a question..

    If you intended the condition to ONLY be 50.00 percent, then it will only occur WHEN his life is 50.00% but not (and less) or (and greater)
     
  3. narutoj

    narutoj

    Joined:
    Apr 22, 2007
    Messages:
    16
    Resources:
    0
    Resources:
    0
    If i use Less than or equal 50.00 will memory leaks?
    because this trigger not for one unit (about 20~50 units).
     
  4. DenZel94

    DenZel94

    Joined:
    Jun 4, 2006
    Messages:
    127
    Resources:
    5
    Maps:
    3
    Tutorials:
    2
    Resources:
    5
    No it will not, the only thing that will create leaks are points(call RemoveLocation), both unit and player groups(call DestroyForce/Group or set bj_wantDestroyGroup = true ~ for UG only) and some things that I have already forgotten (due to the fact that I quit mapping from June until now..)
     
  5. narutoj

    narutoj

    Joined:
    Apr 22, 2007
    Messages:
    16
    Resources:
    0
    Resources:
    0
    thank's your help!