- Joined
- Dec 25, 2010
- Messages
- 972
Tittle Says anything, need help to start with and how to apply to all non hero units
Any Suggestions?
Any Suggestions?
function Trig_MoraleDownRed_Func002C takes nothing returns boolean
if ( ( GetOwningPlayer(GetTriggerUnit()) == Player(0) ) ) then
return true
endif
return false
endfunction
function Trig_MoraleDownRed_Conditions takes nothing returns boolean
if ( not Trig_MoraleDownRed_Func002C() ) then
return false
endif
return true
endfunction
function Trig_MoraleDownRed_Func001C takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(0) ) ) then
return false
endif
return true
endfunction
function Trig_MoraleDownRed_Actions takes nothing returns nothing
if ( Trig_MoraleDownRed_Func001C() ) then
set udg_RedPlayerMorale = ( udg_RedPlayerMorale - 1 )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_MoraleDownRed takes nothing returns nothing
set gg_trg_MoraleDownRed = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_MoraleDownRed, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_MoraleDownRed, Condition( function Trig_MoraleDownRed_Conditions ) )
call TriggerAddAction( gg_trg_MoraleDownRed, function Trig_MoraleDownRed_Actions )
endfunction
function Trig_MoraleUpRed_Func002C takes nothing returns boolean
if ( ( GetOwningPlayer(GetKillingUnitBJ()) == Player(0) ) ) then
return true
endif
return false
endfunction
function Trig_MoraleUpRed_Conditions takes nothing returns boolean
if ( not Trig_MoraleUpRed_Func002C() ) then
return false
endif
return true
endfunction
function Trig_MoraleUpRed_Func001C takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(1) ) ) then
return false
endif
return true
endfunction
function Trig_MoraleUpRed_Actions takes nothing returns nothing
if ( Trig_MoraleUpRed_Func001C() ) then
set udg_RedPlayerMorale = ( udg_RedPlayerMorale + 1 )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_MoraleUpRed takes nothing returns nothing
set gg_trg_MoraleUpRed = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_MoraleUpRed, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_MoraleUpRed, Condition( function Trig_MoraleUpRed_Conditions ) )
call TriggerAddAction( gg_trg_MoraleUpRed, function Trig_MoraleUpRed_Actions )
endfunction
function Trig_RetreatRed_Conditions takes nothing returns boolean
if ( not ( udg_RedPlayerMorale < 10 ) ) then
return false
endif
return true
endfunction
function Trig_RetreatRed_Func001A takes nothing returns nothing
call IssuePointOrderLocBJ( GetEnumUnit(), "move", GetRandomLocInRect(GetPlayableMapRect()) )
endfunction
function Trig_RetreatRed_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectOfPlayer(GetPlayableMapRect(), Player(0)), function Trig_RetreatRed_Func001A )
endfunction
//===========================================================================
function InitTrig_RetreatRed takes nothing returns nothing
set gg_trg_RetreatRed = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_RetreatRed, Player(0), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_RetreatRed, Condition( function Trig_RetreatRed_Conditions ) )
call TriggerAddAction( gg_trg_RetreatRed, function Trig_RetreatRed_Actions )
endfunction
I know what morale is, but again, you don't give us any info about how it should work, except that in the game you saw it in it was represented by blue number.Morale is how the mind of a soldier is being affected by the battlefield around him/her, In Dawn of War that is represented by a blue number below the squad's health points once it is depleted they lose effectiveness, that is how i envision the system