Talk:IsTalking

From the CreationKit Wiki
Jump to navigation Jump to search

How to use it?[edit source]

Firstly, what is IsTalking ()?[edit source]

This is True when the Actor is speaking their lines - regardless of whether the Dialogue Menu is open or close. It could also work on ObjectReferences, but I am not sure.

Instructions on how to use it[edit source]

Attach a Script to a Magic Effect that captures this the value of this Condition.[edit source]

Usual Papyrus only method[edit source]
Scriptname myMagicEffectIsTalking extends activemagiceffect  

MyMainQuestS Property myMainQuest Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
    myMainQuest.addToTalkingActorsList (akTarget)
EndEvent

Event Event OnEffectFinish(Actor akTarget, Actor akCaster)
    myMainQuest.removeFromTalkingActorsList (akTarget)
EndEvent
OR with SKSE's SendModEvent ()[edit source]
Scriptname myMagicEffectIsTalking extends activemagiceffect  

Event OnEffectStart(Actor akTarget, Actor akCaster)
    ;send it from the target - not this Magic Effect
    akTarget.SendModEvent ("talkingEvent", "started")
EndEvent

Event Event OnEffectFinish(Actor akTarget, Actor akCaster)
     akTarget.SendModEvent ("talkingEvent", "finished")
EndEvent

Then elsewhere:

Function onGameLoad ()
    ;register for mod event needs to be registered at every game load because SKSE registrations do not stick in your save game.
    RegisterForModEvent ("talkingEvent",  "OnTalking")
EndFunction ()
;
;
;
Event OnTalking (string eventName, string strArg, float numArg, Form sender)
    If eventName == "talkingEvent"
        If strArg == "started"
            Debug.Notification (sender + " is talking")
        ElseIf strArg == "finished"
            Debug.Notification (sender + " is finished talking")
        EndIf
    EndIf
EndEvent

Add it to an Ability Spell with the IsTalking Condition.[edit source]

Make sure that you also add a Condition for a GlobalVariable that is specific to your mod. This is a fail-safe fro when the user needs to uncleanly uninstall and deactivate the mod. The Ability Spell doesn't stick - because the condition for the GlobalVariable becomes false. This fail-safe is described in Thanatos00's post in my Compatibiliy thread in Bethesda's forums http://forums.bethsoft.com/topic/1362474-compatibility-with-other-mods-tips/page-2#entry20656711

Add that Spell to an Alias or Actor. I think this will also work on a "talking" Activator.[edit source]

This method is described in my previous post, Passing Conditions to Papyrus: http://www.creationkit.com/Passing_Conditions_to_Papyrus

--Kuertee (talk) 2013-07-16T07:56:00 (EDT)