Difference between revisions of "Talk:IsTalking"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Kuertee
(Created page with "==What is this?== This is True so long as the NPC is speaking their lines - regardless of whether the Dialogue Menu is open or close. ==How to use it?== ===Attach a Script to...")
 
imported>Kuertee
Line 61: Line 61:
This method is from my previous post, Passing Conditions to Papyrus:
This method is from my previous post, Passing Conditions to Papyrus:
http://www.creationkit.com/Passing_Conditions_to_Papyrus
http://www.creationkit.com/Passing_Conditions_to_Papyrus
--[[User:Kuertee|Kuertee]] ([[User talk:Kuertee|talk]]) 2013-07-16T07:49:38 (EDT)

Revision as of 06:49, 16 July 2013

What is this?

This is True so long as the NPC is speaking their lines - regardless of whether the Dialogue Menu is open or close.

How to use it?

Attach a Script to Magic Effect that captures this Condition.

Usual Papyrus only method

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 ()

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.

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.

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

--Kuertee (talk) 2013-07-16T07:49:38 (EDT)