- Joined
- Jun 30, 2006
- Messages
- 230
JASS:
function AllianceWins takes nothing returns nothing
call CustomVictoryBJ( GetEnumPlayer(), true, true )
endfunction
function HordeLoses takes nothing returns nothing
call CustomDefeatBJ( GetEnumPlayer(), "You have failed to achieve victory!" )
endfunction
function AllianceWinsActions takes nothing returns nothing
call ForForce( udg_Alliance, function AllianceWins )
call ForForce( udg_Horde, function HordeLoses )
call DisableTrigger( gg_trg_HordeWins )
endfunction
//===========================================================================
function InitTrig_AllianceWins takes nothing returns nothing
local unit HeartOfTheHorde = gg_unit_nshr_0042
set gg_trg_Human_Won = CreateTrigger()
call TriggerRegisterUnitEvent( gg_trg_AllianceWins, HeartOfTheHorde, EVENT_UNIT_DEATH )
call TriggerAddAction( gg_trg_AllianceWins, function AllianceWinsActions )
set HeartOfTheHorde = null
endfunction
I have one problem: udg_Alliance and udg_Horde do not exist. Right now they are merely place-holders for the respective forces they represent, Alliance and Horde. I would think that if you when up to Scenario > Forces Properties and defined those forces it would set them to a variable of some sort to use in a trigger. I cannot find them if they are created. Questions:
1. Are they automatically created?
2. If so, how are they named?
3. If not, how do you correctly assign players to a force?
4. Can these BJ's be replaced or made more efficient? I've never done a custom Victory/Defeat before.