1. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  2. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  3. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  4. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  5. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  6. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  7. 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.

Any Leaks@ This Spell?

Discussion in 'World Editor Help Zone' started by Space_Ship, Oct 12, 2011.

  1. Space_Ship

    Space_Ship

    Joined:
    Oct 4, 2011
    Messages:
    223
    Resources:
    0
    Resources:
    0
    no unitgroup leak, idk what else :D thanks guys. I thought maybe the Casting unit would leak so i did call RemoveUnit(udg_etc... and realized that removes unit from game so i figured that doesnt leak?

    • Goo and Bugs
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Goo and Bugs (Crypt fiend)
      • Actions
        • Set CarrionSwarm_CasterUnit = (Casting unit)
        • Set CarrionSwarm_UnitGroup = (Units within 425.00 of (Target point of ability being cast) matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is A structure) Equal to False)))
        • Unit Group - Pick every unit in CarrionSwarm_UnitGroup and do (Actions)
          • Loop - Actions
            • Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) x 0.20)
        • Wait 3.00 seconds
        • Unit Group - Pick every unit in CarrionSwarm_UnitGroup and do (Actions)
          • Loop - Actions
            • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
            • Unit - Cause CarrionSwarm_CasterUnit to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Normal
        • Custom script: call DestroyGroup(udg_CarrionSwarm_UnitGroup)
     
  2. Ultimatony

    Ultimatony

    Joined:
    Dec 9, 2009
    Messages:
    397
    Resources:
    0
    Resources:
    0
    No leaks(Ok, I missed a leak), but

    Waits are BAD, they kill your skills if you want them useable by more than one person/unit within that wait time.

    You'll need to learn to use hashtables, or an easier route would be adding a custom value to each unit on map (and every unit to enter map)
    Initialization

    • Initialization
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Set TempGroup = (Units in (Playable map area))
        • Unit Group - Pick every unit in TempGroup and do (Actions)
          • Loop - Actions
            • Set CreepValue = (CreepValue + 1)
            • Unit - Set the custom value of (Picked unit) to CreepValue
        • Custom script: call DestroyGroup(udg_TempGroup)


    To get rid of the wait you need to make a periodic trigger.
    (This trigger is initially off)

    Loop
    • GooLoop
      • Events
        • Time - Every 0.50 seconds of game time
      • Conditions
      • Actions
        • Unit Group - Pick every unit in GooGroup and do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • GooGroupTimer[(Custom value of (Picked unit))] Less than or equal to (<=) 1
              • Then - Actions
                • Unit Group - Remove (Picked unit) from GooGroup
                • Unit - Cause GooCaster[(Custom value of (Picked unit))] to damage (Picked unit), dealing GooDamage[(Custom value of (Picked unit))] damage of attack type Spells and damage type Normal
              • Else - Actions
                • Set GooGroupTimer[(Custom value of (Picked unit))] = (GooGroupTimer[(Custom value of (Picked unit))] - 1)
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in GooGroup) Equal to (==) 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions


    Then you need to add these within your first trigger in the loop

    • Actions
      • Set GooCaster[(Custom value of (Picked unit))] = (Casting unit)
      • -------- However you want damage calculated --------
      • Set GooDamage[(Custom value of (Picked unit))] = (Real((Strength of (Casting unit) (Include bonuses))))
      • Set GooGroupTimer[(Custom value of (Picked unit))] = 6
      • Trigger - Turn on GooLoop <gen>



    These triggers do not support the effect stacking, best to add a buff to the units that are effected by the skill so you can check if unit has buff in your first loop.
     
    Last edited: Oct 13, 2011
  3. Vladadamm

    Vladadamm

    Joined:
    Apr 19, 2011
    Messages:
    1,255
    Resources:
    9
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    9
    there is a leak in the unitgroupset : Target point of ability being cast.
     
  4. Bannar

    Bannar

    Joined:
    Mar 19, 2008
    Messages:
    3,099
    Resources:
    20
    Spells:
    5
    Tutorials:
    1
    JASS:
    14
    Resources:
    20
    (Target point of ability being cast) leaks; Set it to custom location variable and remove it afterwards.
    (Casting unit) -> (Triggering unit)
    (Owner of (Casting unit)) -> (Triggering player)

    Using waits make this not MUI - indexing/hashtables can help you convert it into MUI version.
     
  5. Vladadamm

    Vladadamm

    Joined:
    Apr 19, 2011
    Messages:
    1,255
    Resources:
    9
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    9
    You can do MUI with waits ^^
    He just need an index system for make it MUI.
     
  6. Bannar

    Bannar

    Joined:
    Mar 19, 2008
    Messages:
    3,099
    Resources:
    20
    Spells:
    5
    Tutorials:
    1
    JASS:
    14
    Resources:
    20
    Actaully no; it would require locals usage in such case, because you can't just refer to globals with TriggerSleepAction. You risk interfering with other instances that are currently running what can lead to total mess.

    Timers/indexing + loop/hashtables + loop is the way to make it MUI; or.. locals usage.
     
  7. Space_Ship

    Space_Ship

    Joined:
    Oct 4, 2011
    Messages:
    223
    Resources:
    0
    Resources:
    0
    I suck T.T..... None of that makes sense for me.. Map initilazition trigger? I think seriously i giveup. Probably all of my work has leaks and is crap.
     
    Last edited: Oct 12, 2011
  8. GangSpear

    GangSpear

    Joined:
    Oct 25, 2009
    Messages:
    971
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Don't give up,for newbies,many things will leak,just try continue,next time u will know all of the leaks and make spells etc.
     
  9. Narogog

    Narogog

    Joined:
    Apr 1, 2010
    Messages:
    269
    Resources:
    1
    Spells:
    1
    Resources:
    1
    what you should do is
    • Goo and Bugs
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Goo and Bugs (Crypt fiend)
      • Actions
        • Custom script: local unit u = GetTriggerUnit()
        • Custom script: local group g
        • Set CarrionSwarm_CasterUnit = (Casting unit)//this is equal to triggering unit
        • Set Loc = (Target Point of Ability being cast)
        • Set CarrionSwarm_UnitGroup = (Units within 425.00 of Loc matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and (((Matching unit) is A structure) Equal to False)))
        • Unit Group - Pick every unit in CarrionSwarm_UnitGroup and do (Actions)
          • Loop - Actions
            • Unit - Set (Picked unit) movement speed to ((Default movement speed of (Picked unit)) x 0.20)
        • Custom script: call RemoveLocation(udg_Loc)
        • Custom script: set g = udg_CarrionSwarm_UnitGroup
        • Wait 3.00 seconds
        • Custom script: udg_CarrionSwarm_UnitGroup = g
        • Unit Group - Pick every unit in CarrionSwarm_UnitGroup and do (Actions)
          • Loop - Actions
            • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
            • Unit - Cause CarrionSwarm_CasterUnit to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Normal
        • Custom script: call DestroyGroup(udg_CarrionSwarm_UnitGroup)
        • Custom script: set u = null
        • Custom script: set g = null

    this will work and you won't have to do more then one trigger for it.
    offtopic
    my 200th post
     
  10. Bannar

    Bannar

    Joined:
    Mar 19, 2008
    Messages:
    3,099
    Resources:
    20
    Spells:
    5
    Tutorials:
    1
    JASS:
    14
    Resources:
    20
    @Narogog That probably won't. You have to add units in one group to second with function instead.

    @Ultimatony
    DONT EVER suggest someone custom value manipulation - if you do that by your own, let it be, but please don't complicate others life. Custom values are required for Indexers (AutoIndex/AIDS/UnitIndexer/GUI UnitIndexer) - that is first; and secondly, custom values could have far more usage in custom maps for job hard to handle instead of using them just for a spell.
    I suggest to you that as well: remove CV manipulation.
     
  11. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    It will work. Remember that variables are pointers.

    He sets the variables to point to the same object.
     
  12. Ultimatony

    Ultimatony

    Joined:
    Dec 9, 2009
    Messages:
    397
    Resources:
    0
    Resources:
    0
    I was basically showing him an easy way to index, with each unit having a custom value your able to save things about them individually without hashes. It can be used for any aspect of the map.

    How is that any different?

    In my map it's used for Respawn System, Regen System, Triggered Damage system, saves armor, crit chance, crit rate, position, facing angle, unit specific timers. So it's used in almost everything in my map.

    (Maker is the one that suggested the system 2 yrs ago btw)