Jump to content

[LE] Setting a Quest Variable through Dialog


xenaclone

Recommended Posts

Very simple, or so it seems. I'm trying to set a quest variable via dialog in the Creation Kit for the old version of Skyrim (i.e., not SE). Doing this in Oblivion's Construction Set is so much easier. Start a new quest, open up its main script, and type

 

Short Status

 

as a variable. Now I could use Status in lines of code. For instance, I could type

 

Set aaaQuest.Status to 1

 

into the Topic tab's Result Script to move Status up to 1. During dialog, an NPC will say certain things when Status is 0, and other things when it is 1. I like using variables sometimes because I can make them go up or down. With Quest Stages, they only go one direction (up).

 

So I've mastered how this works in the CS or GECK, but I'm not seeing how to do this in the Skyrim CK. Yet it must be possible because there's a function called GetVMQuestVariable.

 

Here's where I'm at so far.

 

1). I made a test quest in the Creation Kit, with two instances of dialog. First instance, the NPC says "Hello, you are on Var 1" and the second instance she's supposed to say "Welcome to Var 2".

 

 

2). I clicked on the Scripts tab and added a new script. So far it looks like this...

 

Scriptname aaaTestScript extends Quest Conditional

 

Int Property aaaTestProperty Auto Conditional

 

All of that compiles okay. Wonderful. I made sure the property's Int Value is 0.

 

 

3). I go back to the Player Dialog tab. For the Conditions window I've got

 

GetIsID Actor: NPCname == 1.00

GetVMQuestVariable Quest: aaaTestQuest == 0.00

 

I was able to choose aaaTestProperty for the quest variable, as well.

 

 

4). In the Papyrus Fragment box I typed:

 

Int aaaTestProperty = 1

 

which I assume is supposed to bump the VMQuestVariable up to 1. This compiles okay.

 

 

5). For the second instance of dialog ("Welcome to Var 2") I've got

 

GetIsID Actor: NPCname == 1.00

GetVMQuestVariable Quest: aaaTestQuest == 1.00

 

as conditions. I go into the game. The NPC says the first bit of dialog, "Welcome to Var 1" just fine, but then she drops the conversation, almost as though "Goodbye" has been flagged. Grrr....

 

So the problem seems to be the Int aaaTestProperty = 1 line. It doesn't seem to be bumping the variable to 1.

 

 

Edit: I also tried changing the second instance of dialog so that its VMQuestVariable == 0.00. In this case, both lines of dialog show up. The Int aaaTestProperty = 1 bit of code compiles okay, but doesn't seem to do anything.

 

Thanks :geek:

Edited by xenaclone
Link to comment
Share on other sites


After studying a bunch of Beth quests in which VMQuestVariable is used, I've come to the conclusion they use this condition in a way-different manner than I'm trying to. VMQuestVariable gets called for a lot during the early Companions quests, for instance. Always, it's used as something definite is happening: the player leaves a conversation, and VMQuestVariable shows up with a Get == 1. A scene commences between two Companions members, and again it pops up, again with ==1. And of course, I can't begin to grasp what causes the variable to return a 1 in the first place. :rolleyes: Whatever Beth's doing makes no sense to me; wouldn't be the first time!


I can't find an example in which it's used during a script; that's the main thing. It's never the result of a pure script declaration, not from what I've seen.


I also never see this condition go backwards, never see it return a 0 after it's been a 1. Definitely not like the old scripting days in which quest and script variables could go up and down. So VMQuestVariable seems to be useless (to me). I'm going to try using Faction changes to make my idea happen, I guess.
Edited by xenaclone
Link to comment
Share on other sites

Why don't you just create however many Integer Global variables you need and then in the papyrus fragment on the Topic Info do this:

 

MyVariable.SetValue(<something>)

 

or if you just want to increment it:

 

MyVariable.Mod(1)

 

 

Don't forget to start the line with a semi colon, then when you have assigned the property to MyVariable take away the semi colon and recompile.

Link to comment
Share on other sites

Nice, finally!

 

You're saying the Integer Global Variables would go into the initial script I wrote (on the scripts tab?) how would they be phrased, could you give an example?

 

So MyVariable could be the aaaTestProperty I declared in that first script?

 

(Sorry, I'm at the point I've run out of tutorials to watch or read...and I'm too stubborn to give up.)

Edited by xenaclone
Link to comment
Share on other sites

If you using global variables you don't need to declare that variable within a script; but the same usage applies if you do. Just create the Global from the Object viewer in the CK. The advantage of Globals is they are then available to any script fragments you use.

 

In the 'quest data' tab of a quest there is a box on the right where you add the global variables you are using in the quest. I have never been entirely sure whether this is necessary, but I do it to be on the safe side.

Link to comment
Share on other sites

  • 2 weeks later...

Hey, Happy New Year (unless you don't celebrate).

 

Just wanted to say the "MyVariable.SetValue(X)" method works like a charm. :) Does exactly what I want, which is, during various portions of dialog the global variable goes back and forth, up and down, which allows different bits of dialog to repeat without going at this the long way. I probably could have used quest stages and then the Story Manager to get what I want, repeating those quest stages. But that would be overly-complex. I prefer the variable methods instead.

 

:turned: Wish I could bake you cookies or whatever. That's how happy I am.


MyVariable.SetValue(<something>)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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