- Joined
- Oct 10, 2009
- Messages
- 1,426
[solved] Trigger issue.
Solved
Hello again.
I have a slight issue with this trigger.
The line
It says the syntax is wrong because it's comparing to variable of different types. The variables are the same type, but the trigger is stupid and doesn't know that.
It won't let me run the map because of this issue and it's very annoying.
I'm sure it's this line as well.
How can I work around this?
Here's the full code if needed:
Will reward with rep, of course. <3
Oh, and any tips you can give me on how to remove a few bjs or compress the code more are also welcomed with rep. <3
Solved
I have a slight issue with this trigger.
The line
if GetTriggerPlayer() == udg_Mayors_Copy[1]
has an issue.It says the syntax is wrong because it's comparing to variable of different types. The variables are the same type, but the trigger is stupid and doesn't know that.
It won't let me run the map because of this issue and it's very annoying.
I'm sure it's this line as well.
How can I work around this?
Here's the full code if needed:
JASS:
function Conditions_Spy_232 takes nothing returns boolean
return GetSpellAbilityId() == 'A000'
endfunction
function Trig_Spy_Actions takes nothing returns nothing
local location loc
if GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD) < 1500 then
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"Not enough gold.")
call UnitResetCooldown(GetTriggerUnit())
return
endif
if GetTriggerPlayer() == udg_Mayors_Copy[1] then
set loc = gg_rct_spyT1
else
set loc = gg_rct_spyT2
endif
call SetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)-1500)
call CreateUnitAtLoc(GetTriggerPlayer(),'XXZZ',loc,GetRandomReal(0,359))
call PanCameraToLocForPlayer(GetTriggerPlayer(),loc)
call RemoveLocation(loc)
endfunction
//===========================================================================
function InitTrig_Spy takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddAction( t, function Trig_Spy_Actions )
call TriggerAddCondition(t,Condition(function Conditions_Spy_232))
endfunction
Oh, and any tips you can give me on how to remove a few bjs or compress the code more are also welcomed with rep. <3
Last edited: