1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Welcome to the new Hive! Be advised that we're still working on the site. There are still many rough edges, so please bear with us.
    Dismiss Notice
  3. The 14th Icon Contest is still in progress (and may be extended). You can still make it in time.
    Dismiss Notice
  4. The 25th Texturing Contest has started! Contestants are to create a skin representing a dark elf person/being or any construct related to it using the vanilla models or the custom ones found on the site.
    Dismiss Notice
  5. The poll for Terraining Contest #18 is finally up! Play through the maps and cast your vote on your favourite.
    Dismiss Notice
  6. Buy it, use it, break it, fix it, trash it, change it, mail - upgrade it. Join (Optionally) Paired Techtree Contest #11 - Techno Magic now!
    Dismiss Notice
  7. Voting squad, line up! Cast your vote on the poll for Modeling Contest #29 - Squads!
    Dismiss Notice
  8. Hero Contest #8 is up and running! This time it's a joint contest between artists and coders. Go here for team matchmaking.
    Dismiss Notice
  9. The poll for the theme of our StarCraft II Terraining Contest is up. Cast your note now!
    Dismiss Notice
  10. The ninth Concept Art Contest has launched. Enter now!
    Dismiss Notice
  11. The member Kam is making HIVE coasters. Take a look. For every coaster you buy, Hive gets $1.
    Dismiss Notice

buff /effect trigger

Discussion in 'World Editor Help Zone' started by Blackair, Jul 16, 2012.

  1. Blackair

    Blackair
    Joined:
    Aug 18, 2011
    Messages:
    76
    hi everyone
    i tried to use this trigger to add a freeze effect and slowing down enemy units with buff Cold of cone

    what wrong with this trigger and why it wont work?
    • Cone of Cold buff
      • Events
        • Time - Every 1.00 seconds of game time
      • Conditions
      • Actions
        • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) has buff Cone of Cold ) Equal to True)) and do (Actions)
          • Loop - Actions
            • Unit - Set (Picked unit) movement speed to ((Current movement speed of (Picked unit)) - ((Current movement speed of (Picked unit)) x 0.60))
            • Animation - Change (Picked unit)'s vertex coloring to (0.00%, 0.00%, 100.00%) with 0.00% transparency
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • ((Picked unit) has buff Cone of Cold ) Equal to False
              • Then - Actions
                • Animation - Change (Picked unit)'s vertex coloring to (0.00%, 0.00%, 100.00%) with 0.00% transparency
                • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
              • Else - Actions

    and how can i fix it? i need the pros guide!
     
  2. mckill2009

    mckill2009
    Joined:
    Mar 10, 2009
    Messages:
    4,681
    I think you should do;
    • Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) - ((Default movement speed of (Picked unit)) x 0.60))

    but that is bad also, coz you're checking everytime, so you should put a condition to run it just one time...

    BTW:
    - your group leaks
    - This is useless " ((Picked unit) has buff Cone of Cold ) Equal to False" since it will filter the ONLY the unit who has that buff
    - Picking units in playable map area to check buff using a looper 1.0/sec is bad coz you need to off this trigger somehow

    SUGGETIONS:
    - Make a group variable, if this is a spell, add the target to that group
    - PIck all units in THAT GROUP and put conditions like you mentioned above, this way it will pick units with or w/o buff
    - If no buff detecetd, remove unit from group

    EDIT; something like this
    • Cone of Cold buff
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (YOUR_GROUP) and do (Actions)
        • Loop - Actions
          • If - Conditions ((Picked unit) has buff Cone of Cold ) Equal to False
          • Then - Actions
            • Animation - Change (Picked unit)'s vertex coloring to (0.00%, 0.00%, 100.00%) with 0.00% transparency
            • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
            • Custom script: call GroupRemoveUnit(udg_YOUR_GROUP, GetEnumUnit())
            • Custom script: if IsUnitGroupEmptyBJ(udg_YOUR_GROUP) then
            • Trigger - Turn Off this trigger
            • Custom script: endif
          • Else - Actions