Recent content by AceLegend90

  1. A

    Does this code leak?

    'SafeTriggerDestroy' is my libraried function that, first, disables the trigger in question and, second, destroys the trigger 15 seconds later (and uses a timer, not 'TriggerSleepAction'). I created this function based on emjlr's tutorial on auto-cast abilities and read that 'DestroyTrigger'...
  2. A

    Does this code leak?

    scope OneBadMagicTrick private function Conditions takes nothing returns boolean return GetSpellAbilityId() == 'A01A' endfunction private function Actions takes nothing returns nothing local unit caster = GetTriggerUnit() local boolean ability_1 local boolean ability_2...
  3. A

    Need help checking code error (unknown)

    Could you post what the error says? EDIT: Shouldn't 'local boolexpr b = Condition( HeroCheck )' be: 'local boolexpr b = Condition(function HeroCheck)'?
  4. A

    Trigger Help

    You need to disable 'CripplingShot' and re-enable it whenever you use the event 'EVENT_UNIT_DAMAGED'. So add the following: function Trig_Crippling_Shot_Conditions takes nothing returns boolean return GetUnitAbilityLevel(GetAttacker(),'A00R') > 0 endfunction function CripplingShot...
  5. A

    Can a global ever be used simultaneously?

    Okay, thank you very much. I never use 'TriggerSleepAction' or 'PolledWait' functions anymore so I should be safe in that department. +Rep
  6. A

    Can a global ever be used simultaneously?

    You guys aren't getting what I'm saying. I can't use locals because I use the global in another function (mainly due to "sliding units" spells). I have code like this: set tempUnit = .caster call GroupEnumUnitsInRange(.nears, GetUnitX(.hook), GetUnitY(.hook), 100., Condition(function...
  7. A

    Can a global ever be used simultaneously?

    As the title states, can a global variable ever be used in two instantaneous triggers at the same time? For example, I often use a global variable 'tempUnit' and set it to the caster of a certain spell and use 'tempUnit' in another function that checks if a unit is an enemy or not in a...
  8. A

    If a certain struct does not exist, then...

    ...if that struct is returned, will the value be null? For example, I'm trying to do something like this: local BoneRend spell if GetTriggerEventId() == EVENT_UNIT_SPELL_EFFECT then set spell = GetCSData(GetSpellTargetUnit()) else set spell = GetCSData(GetTriggerUnit())...
  9. A

    Missle Collision, boolexpr filter help needed.

    No, it wouldn't affect you because you set 'tempUnit' every time you need it. Since the global is instantaneously used, it should never work the way you described. So, for example, you and your enemy cast a missile right at each other. The 'tempUnit' global will be switching from you and your...
  10. A

    Starting Jass, What does this mean?

    Yes, it's just a name for the function you're using.
  11. A

    Starting Jass, What does this mean?

    This is because bolded part needs to know what it's doing first. The compiler compiles the code line by line so if the bolded part was first, the compiler would be confused on what function it's trying to call since it isn't actually created yet.
  12. A

    Missle Collision, boolexpr filter help needed.

    Currently, it isn't MUI because 'pickedgroup' is global, therefore would have too many units in it if two missiles are being casted. Back up your old code and try this code to make it MUI: globals unit tempUnit endglobals struct spell unit missle unit caster location end...
  13. A

    Missle Collision, boolexpr filter help needed.

    Here's the code you should use: globals group pickedgroup = CreateGroup() unit tempUnit endglobals struct spell unit missle unit caster location end real angle endstruct function Trig_Missle_Conditions takes nothing returns boolean return...
  14. A

    Missle Collision, boolexpr filter help needed.

    Use something like: function True takes nothing returns boolean if IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) then return false elseif GetWidgetLife(GetFilterUnit()) <= 0. then return false elseif IsUnitAlly(GetFilterUnit(), GetTriggerPlayer()) then...
  15. A

    Spell Help: Cannot Retrieve Attached Trigger

    Thank you! That solved the problem. Another question, should non-static methods be placed above their caller methods as well? It does not seem to be a problem when they are below.
Top