Jump to content

Need help with Papyrus, need to change script variables during dialogu


Guest Messenjah

Recommended Posts

I find the dialogue system a bit... convoluted, so don't have much experience with it, sorry. All I know is that .setValue() and .getValue() are proper ways to set the values of global variables. So you could try setting up your NPC flags as global variables, then setting them as described above within your quest script. It should work.

 

Other than than I have no idea.

Link to comment
Share on other sites

You define them in the CK, under Global Variables. Then declare them as properties of your script and access them as I outlined a few posts above. I use Global Variables for all flag-settings which needs to work cross-script, it's direct, easy and it works.
Link to comment
Share on other sites

Guest MobMessenjah

It doesn't seem to work for a quest script. Setting it in the ck, I go to properties, set it to globalvalue but I can't set a value to it or it gives me a fail on the script. I also can't set a global to work as an integer....

 

 

Also, using

npcrun.setvalue(1)

doesn't work because it does not know how to find the quest script. :\

 

If you ask me, dialogue isn't what is convoluted. The scripting system is far more convoluted than that of Fallout 3/New Vegas. At least in there, I just named the script, named the variable, told it what to set it to and I was done. One single line of code. I believe it considered all quest scripts as being global however.

 

 

Also, I'm finding that if I set a globalvarariable, I can no longer see it with AI Package conditions, making it once again useless.

Link to comment
Share on other sites

My_DialogueQuest Property MyQuestRef auto
{Pass your quest script into this script/fragment as a property reference cast as the quest that holds that script}

; then somewhere in your script just do this to set those properties on your other script:

MyQuestRef.NPC01Run = 1
MyQuestRef.NPC02Run = 0
MyQuestRef.NPC03Run = 0

 

:cool:

Edited by steve40
Link to comment
Share on other sites

  • 2 weeks later...
Guest Messenjah

I don't see how to add a script name in as a variable?

 

 

Sorry for the delay, I've had a rib injury since the 4th so I haven't been able to touch modding in a while but getting back to it now.

 

I added a quest property to the fragment and added my quest to that property. Then did exactly as instructed above but had no luck.

 

It claims, " is not a property on script quest or one of its parents"

 

I pointed the property to the quest but not the script. How do you point a property to a script instead of a quest? I tried just copying and pasting in the name of my quest script into the fragment property but it gives me an error, telling me that it is unknown. Any ideas on what kind of property I need to select in the drop down menu? If I edit the source of the fragment, I don't see the properties defined there, only if I go into properties, do I see it defined.

Link to comment
Share on other sites

Guest Messenjah
Nevermind, I'm getting tired lol. I didn't see the properties defined at the bottom of the fragment before. Not paying attention. Also, found that I didn't copy the complete name of my script over to the property. Fixed these and it seems to compile just fine! Going to go to bed and will test it out tomorrow. Thanks everyone!
Link to comment
Share on other sites

  • Recently Browsing   0 members

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