Adding to variable in result script

Post » Sat May 28, 2011 2:13 pm

The question first:

I am wanting to add to a quest variable at the result script portion of a conversation (or topic, to be more precise). How can I go about doing this?




The blab:

Sorry if it is an easy question or already answered. The flood filter was killing me as I was trying to think of what exactly to search for. Also, I tried looking on the GECK page and did find things about quests as well as variables, but was having a hard time finding what I want exactly. I did find out how to specifically set the variable (set questid.questvar to #), but wasn't sure how to add. Simply tried add, but that didn't work. Also found the list of functions a while back (which I have been using), and block types (such as game mode and the like), but haven't found much info on altering variables.

Anyhow, I don't mind working and learning myself, so if you have the website for this sort of stuff, I would appreciate it. Short of that, a simple answer or direction to look would be appreciated just as much. Thanks in advance!
User avatar
Jenna Fields
 
Posts: 3396
Joined: Mon Dec 11, 2006 11:36 am

Post » Sat May 28, 2011 3:20 pm

I'm not sure that I understand what you want to do, are you trying to add an extra variable to a quest script without explicitly declaring it in that script? If so, you can't remotely declare variables. If you want a quest script to have an extra variable in it, then you'll need to declare it explicitly in that script.

Cipscis
User avatar
Alexander Lee
 
Posts: 3481
Joined: Sun Nov 04, 2007 9:30 pm

Post » Sat May 28, 2011 4:02 pm

I think he wants to change a variable already in a quest script, via the result script of a line of dialogue. If so, just do this. Say your quests ID is MyQuest01 and the variable is MyVariable. You want it to be set 1 higher at the end of a line of dialog. Simple put this in the result box of that line.

Set MyQuest01.MyVariable to MyQuest01.MyVariable + 1


Then, no matter what the variable is at, it will be set one higher. Also make sure you have declared the variable in the quest script or it wont recognize the variable, as it does not exist.
User avatar
Michelle Smith
 
Posts: 3417
Joined: Wed Nov 15, 2006 2:03 am

Post » Sat May 28, 2011 5:51 pm

Whoops! Sorry about that, Cipscis, I guess I didn't do a very good job at explaining myself. =D But, you did provide me with some useful info despite that!

Luckily Gunmaster95 was able to decode what it is I was looking for. ;) Thanks for the help. I imagined it was something silly and simple, but for some reason it just never jumped out at me. That makes perfect sense, though. Also, I have the variables and all set up, so I should be good to go - just didn't know the exact syntax to use in the result script area.

Thanks again to both of you!
User avatar
Allison Sizemore
 
Posts: 3492
Joined: Wed Jul 19, 2006 6:09 am


Return to Fallout 3