Moon_Raven
New Member
- Reaction score
- 8
Ok, so there is no point in posting all triggers involved, after some debugging I found out that after this is executed:
When I run this trigger:
The game displays false! OF COURSE the unit is alive, nothing happened to it, it just got summonede and I typed debug bool and it displays false!!! Why does the damn edtor think my poor highlander isn't alive?? :'(
EDIT: FAIL! It doesn't even set the unit to udg_Highlanders[n]! I debuged the game to display the name of udg_Highlanders[0] and it didn't display anything! I don't get it! GetLasteCreatedUnit() works for CreateUnitAtLoc()?
JASS:
//=======================SUMMONS PLAYERS AT START=====================
function Summon takes nothing returns nothing
local integer n = 0
local integer m = 0
local location l
local string e ="Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl"
local effect x
loop
exitwhen(n==udg_Num_of_Players)
set l = GetUnitLoc(udg_Circles_of_Power[n])
call AddSpecialEffectLoc(e,l)
set x = bj_lastCreatedEffect
call CreateUnitAtLoc(udg_PlayersActive[n],039;h000039;,l,90.00)
set udg_Highlanders[n] = GetLastCreatedUnit()
set udg_AliveHighlanders = udg_AliveHighlanders + 1
set n = n+1
call RemoveLocation(l)
call DestroyEffect(x)
endloop
call ConditionalTriggerExecute( gg_trg_Set_Players )
call DisplayTextToPlayer(Player(0),0,0,"udg_Num_of_Players = "+I2S(udg_Num_of_Players))
call DisplayTextToPlayer(Player(0),0,0,"udg_AliveHighlanders = "+I2S(udg_AliveHighlanders))
endfunction
When I run this trigger:
Trigger:
- Debug Bool is highlanderdead
- Events
- Player - Player 1 (Red) types a chat message containing debug bool as An exact match
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Highlanders[0] is alive) Equal to True
- Then - Actions
- Game - Display to (All players) the text: true
- Else - Actions
- Game - Display to (All players) the text: false
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
The game displays false! OF COURSE the unit is alive, nothing happened to it, it just got summonede and I typed debug bool and it displays false!!! Why does the damn edtor think my poor highlander isn't alive?? :'(
EDIT: FAIL! It doesn't even set the unit to udg_Highlanders[n]! I debuged the game to display the name of udg_Highlanders[0] and it didn't display anything! I don't get it! GetLasteCreatedUnit() works for CreateUnitAtLoc()?