'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'...
Could you post what the error says?
EDIT: Shouldn't 'local boolexpr b = Condition( HeroCheck )' be: 'local boolexpr b = Condition(function HeroCheck)'?
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...
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...
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...
...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())...
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...
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.
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...
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...
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.
If the global was made using the GUI tool, then yes, that variable has to have the 'udg_' prefix. If using vJASS' globals block, that is not necessary.
(1) 'endfunction' should be below your function like so:
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
set udg_TempPlayer = GetPlayersAll()
call ForForce( udg_TempPlayer, function Trig_Untitled_Trigger_001_Func002A )
endfunction // 'endfunction' needs to be...
After much time spent debugging this code, I've figured out that the problem is that GetCSData(GetTriggeringTrigger()) isn't actually getting the struct that I attached.
Does anyone see the problem with my code? (It uses Vexorian's Caster System.)
scope Envision
private struct Envision...