Jump to content

Writing first script but need guidance.


cxgdarch

Recommended Posts

This is my first attempt at scripting in Skyrim and can't quite figure out a way to do what I want. I want an event to happen when I activate an actor and then a different event to happen when the conversation is over. I know to use onActivate for the first part, but I can't seem to find something to use that will trigger when the conversation ends. Is there such a thing? Or am I looking at this the wrong way and it's more complicated than this?

 

Basic outline I'm picturing...

 

 

Scriptname MyScriptName extends ObjectReference

 

Event OnActivate(ObjectReference akActionRef)

blahblahblah

endEvent

 

Event CONVERSATIONEND(ObjectReference akActionRef)

blahblahblah

endEvent

Link to comment
Share on other sites

I may be misunderstanding what you're trying to do, but I believe you may be overcomplicating things. If your "activated" actor is an NPC, you can handle what you mention in the CK's quest interface as a script fragment without attaching a script to an object (your actor). You'd simply create your dialogue, and either bind the fragment to the dialogue fragment itself (e.g., in the box for after a line is spoken) or, alternatively, use the dialogue fragment to SetStage() and have your trigger actions in the stage fragment. Without knowing more about exactly what you're trying to do when the dialogue ends, this is the only general advice I can give.
Link to comment
Share on other sites

scripting gods to the rescue. :armscrossed:

 

you gave

 

Scriptname MyScriptName extends ObjectReference

 

Event OnActivate(ObjectReference akActionRef)

blahblahblah

endEvent

 

is correct... however...

 

ONCONVERSATIONEND is not an event.

 

To see what works for events and functions, bookmark this: http://www.creationkit.com/Category:Papyrus

 

In the CK, there is dialogue, and in that dialogue screen there are "papyrus fragments" those white boxes (aka fragments) are where you can insert code. You would want to add your code on the end. Fill it with properties and etc like you normally would.

Link to comment
Share on other sites

As far as this goes, I found another way to make what I wanted to happen, happen. I wanted to write a script to do a behind the scenes add of a perk when I spoke to an NPC and then remove it when I was done with the conversation so I wouldn't have it the entire game.

 

I know that ONCONVERSATIONEND isn't an event, that's why I didn't type it in camel case and used all caps to make it stand out. I looked at that page you linked before posting but couldn't find anything that seemed to fit the bill. That's why I asked here. Anyway, thanks for the replies.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...