Jump to content

Recommended Posts

Posted

I know that scripts can use the variables in a quest's script by referencing it like so:

 

set questid.variable to 1

 

I can do this with quest that are already made, but for some reason when I created a quest and a related script and then referenced one of the quest variables in another script GECK complained that the variable doesn't exist. I tested it out with a few other quest not made by me and no compaint...

 

So is there anything I am doing wrong? The quest is set to be enabled at the beginning of the game. I am refencing the quest's id not the script name... It is working for other quest so... :wallbash:

Posted

Have you attached the script to the quest, and is it a quest script, and are you sure you are writing the variable properly in both the script (e.g short doonce) and aren't making any spelling mistake?

 

All I can think of.

Posted
I am pretty sure I checked all of those more than once. I will check them again. I'll slap myself if it is one of those mistakes.
Posted

Have you closed the quest window? The quest is not created until you have set it all up and closed the window.

 

I used this a lot in my mod so it should be working.

Posted

I am not at my computer s I can't check, maybe I shouldn't comment on this until I am. But I am pretty sure that when refering to the variable I copy and pasted all the names to make sure I didn't misspell them. I also check to make sure that the quest did have that script.

 

For speedy's suggestion, I even restarted GECK to make sure that it need to load the quest first before using variables (which would be silly). So I think I closed the window... maybe I reopened it again after I opened GECK.

 

I will try when I get back home. Thanks guys. :)

Posted

Okay, let's make sure I am not being really stupid here is what I have:

 

Quest

Quest Name: 0Test1

Quest Id: 0Test2

Priority: 50

Quest Script: 0TestQuest

Start Game Enabled

 

 

The Quest Script:

Type: Quest

 

scn 0TestQuest

short TestVar

Begin GameMode

set TestVar to 1

End

 

 

The Script Accessing the Variable:

Type: Object

 

scn 0TestVarScript

Begin GameMode

set 0Test2.TestVar to 2

End

 

 

 

I have made sure that both the quest window and the quest script are closed. GECK says 'Unknown variable 0Test1.TestVar'.

 

So... what am I doing wrong here?

Posted
So is there something I am missing? Am I supposed to do anything more then what I stated above... cause it still doesn't work. :(
Posted

Thats very odd :confused: It looks good to me. Very strange I have no idea why it would not work. Try using all letters and maybe change the testVarscript to begin onactivate :confused: ?

 

This technique worked great for me so it must be something.

  • Recently Browsing   0 members

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