Log in

I forgot my password

Current Version: v0.0.01A

Alpha version


Changelogs to come



Poll

Changes to the way I release versions? (read the thread)

creep defense and such I_vote_lcap63%creep defense and such I_vote_rcap 63% [ 5 ]
creep defense and such I_vote_lcap38%creep defense and such I_vote_rcap 38% [ 3 ]

Total Votes : 8

Latest topics
» With everyone dead
creep defense and such I_icon_minitimeTue Nov 20, 2018 3:24 pm by DeusMechanicus

» Faction creeps
creep defense and such I_icon_minitimeSun Dec 21, 2014 12:49 am by Grass Hopper

» [SCII] [Inquisition] Hector Rex
creep defense and such I_icon_minitimeThu Dec 18, 2014 9:06 am by Grass Hopper

» [necrons] Orikan, the Diviner
creep defense and such I_icon_minitimeTue Dec 16, 2014 5:58 pm by Grass Hopper

» Talent System
creep defense and such I_icon_minitimeMon Dec 15, 2014 10:59 am by Grass Hopper

» Capture Points system
creep defense and such I_icon_minitimeFri Dec 12, 2014 2:36 pm by Grass Hopper

» [SCII] [Orks] Warboss(es)
creep defense and such I_icon_minitimeFri Dec 12, 2014 11:44 am by Grass Hopper

» Game Guide
creep defense and such I_icon_minitimeThu Dec 11, 2014 2:12 pm by Grass Hopper

» [Inquisition] Mordrak
creep defense and such I_icon_minitimeWed Dec 10, 2014 3:28 pm by Grass Hopper

» [inquiition] Kaldor Draigo
creep defense and such I_icon_minitimeWed Dec 10, 2014 3:07 pm by Grass Hopper

Version Progress
Changes for v0.02.0A
||||||||||||||||||||[] [general]
||||||||||||||||||||[] [Heroes]
||||||||||||||||||||[] [Items]
||||||||||||||||||||[] [Bugs]
||||||||||||||||||||[] [Total]

creep defense and such

Go down

creep defense and such Empty creep defense and such

Post by Grass Hopper on Wed Jul 29, 2009 12:36 am

protect friendlies
Code:
function Trig_Protect_Friendly_Conditions takes nothing returns boolean
    return SameTeam(GetTriggerUnit(), GetAttacker())
endfunction
function Trig_Protect_Friendly_Actions takes nothing returns nothing
    if GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) > 150 then
        call IssueImmediateOrderById(GetAttacker(), OrderId("stop"))
    endif
endfunction
//===========================================================================
function InitTrig_Protect_Friendly takes nothing returns nothing
    set gg_trg_Protect_Friendly = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Protect_Friendly, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_Protect_Friendly, Condition( function Trig_Protect_Friendly_Conditions ) )
    call TriggerAddAction( gg_trg_Protect_Friendly, function Trig_Protect_Friendly_Actions )
endfunction

and the functions SameTeam and PlayerForceById

Code:
function PlayerForceById takes integer i returns integer
    if IsPlayerInForce(Player(i), udg_team[1]) then
        return 0
    elseif IsPlayerInForce(Player(i), udg_team[2]) then
        return 1
    endif
   
    return 3
endfunction
Code:
function SameTeam takes unit u, unit v returns boolean
    return PlayerForceById(GetPlayerId(GetOwningPlayer(u))) == PlayerForceById(GetPlayerId(GetOwningPlayer(v)))
endfunction

_________________
warning! very-stubborn, sarcastic, self-important, argumentative developer detected!

And unto the masses, He doth spoke:
"Behold The Stuff! It Is Good!"
And the Stuff was good.

Heroes:
Commander Farsight (colab - implemented) - Ku'gaath Plaguefather(incomplete) - Ilyana Arienal(incomplete) - Harlequin Shadowseer(incomplete) - Modular Tau Battlesuit(sandbox)
Grass Hopper
Grass Hopper
Admin

Posts : 3839
Join date : 2009-03-30

https://40kaos.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum