Thursday, May 3, 2012

CK: Controlling Actor Casting Frequency

Two methods of getting an actor not to spam their most powerful spell: Il Ducey: Just put [this] as one of your effect scripts, and blammo you're done.
Scriptname SpellCoolDown extends ActiveMagicEffect

Int Property time Auto

SPELL Property Move Auto

event OnEffectStart(Actor akTarget, Actor akCaster)
     akCaster.removespell(Move)
     Utility.Wait(time)
     akCaster.addspell(Move)
endEvent
Redwood Elf: You could Only give them the low power abilities, and use states to "build up" to the high power attacks
Int BuildUpLevel = 0

Function AdToBuildup(int Powerlevel)
EndFunction

Auto State OutOfCombat
    event OnStateBegin()
        BuildUpLevel = 0
        ; Code to disable all but "Starter" abilities here.
    EndEvent

    Function AddToBuildUp(int PowerLevel) ; Needs to be defined in all states.
    EndFunction

    Event OnCombatStateChanged(Actor Who, Int What)
       BuildUpLevel = 3 - What ; Gets +2 if entering combat, but only +1 if "searching"
       GoToState("CombatStart")
    EndEvent
EndState

State CombatStart

    Function AddToBuildUp(int PowerLevel) ; Call this from each of the High (3) low (1) and mid(2) level effects.
       BuildUpState += PowerLevel
       If BuildUpState >= 5
           GoToState("CombatLevel5")
       EndIf
    EndFunction

EndState

State CombatLevel5
    event OnStateBegin()
       ; Code to enable mid level abilities here.
    EndEvent

    Function AddToBuildUp(int PowerLevel)
       BuildUpState += PowerLevel
       If BuildUpState >= 15
           GoToState("CombatLevel15")
       EndIf
    EndFunction
EndState

State CombatLevel15
    event OnStateBegin()
       ; Code to enable High level abilities here.
    EndEvent

    Function AddToBuildUp(int PowerLevel)
       BuildUpState += PowerLevel
       If BuildUpState >= 20
           GoToState("CombatStart")
       EndIf
    EndFunction

EndState
The first method does seem pretty easy. Yet as stated it would affect the use of that spell game-wide. I like the second method's attachment directly to an actor that you want to influence. Source: How to get NPCs to not spam one spell

No comments:

Post a Comment