Jump to content

Quest Variable issue


SalesKital

Recommended Posts

I'm having a lot of problems with getting several variables to work with a quest I am trying to make.

 

This is the code I have to set the variables in the quest script

 

SCN DCUpgradeSCRIPT

short DCUMattress 0
short DCUPlexiglass 0
short DCUWoodPlank 0
short DCUCleanMetal 0
short DCTrophy 0

BEGIN GameMode

 

This is the code in my quest Items when it refuses to save the script

 

SCN DCUMetalPlatesSCRIPT

BEGIN onActivate
if (getActionRef == player)
set DCUpgrade.DCUMetalPlate to + 1
Activate
endif
END

 

I tried to mimic what was done in the Wasteland Survival Guide quest script to make my quest variables but it refuses to work. I get two errors when i try to save the object script for the quest items.

 

"SCRIPTS:Script 'DCUMetalPlatesSCRIPT', line 5: Unknown variable or function 'DCUMetalPlate'."

and

"SCRIPTS:Script 'DCUMetalPlatesSCRIPT', line 5: Missing variable name in set command."

 

can someone please help me here?

Link to comment
Share on other sites

It should be:

set DCUpgrade.DCUMetalPlate to DCUpgrade.DCUMetalPlate + 1

 

But you haven't declared DCUMetalPlate alongside the other 5 variable declarations in DCUpgradeSCRIPT:

short DCUMetalPlate 0

 

(I didn't realise that variables could be initialised in their declarations - the documentation for the scripting language is somewhat lacking. Learn something new every day if that's correct...)

Edited by iFSS
Link to comment
Share on other sites

thank you, it looks like for that one I actually put in the wrong variable name in the object script. I'll try that to see if it works.

 

(EDIT)

It didn't work. I get the same error as listed above even with the correct variable name.

Edited by SalesKital
Link to comment
Share on other sites

thank you, it looks like for that one I actually put in the wrong variable name in the object script. I'll try that to see if it works.

 

(EDIT)

It didn't work. I get the same error as listed above even with the correct variable name.

Which error - "Unknown variable or function" or "Missing variable name in set command"? Could you repost the sections of the scripts as they are now please, along with the error?

 

Just to check: did you click the save button (the disk icon) to compile the script after you edited it, and then save the edited plugin before you exited the Geck? Is DCUpgradeSCRIPT definitely set as the quest script for the DCUpgrade quest?

Link to comment
Share on other sites

thank you, it looks like for that one I actually put in the wrong variable name in the object script. I'll try that to see if it works.

 

(EDIT)

It didn't work. I get the same error as listed above even with the correct variable name.

Which error - "Unknown variable or function" or "Missing variable name in set command"? Could you repost the sections of the scripts as they are now please, along with the error?

 

Just to check: did you click the save button (the disk icon) to compile the script after you edited it, and then save the edited plugin before you exited the Geck? Is DCUpgradeSCRIPT definitely set as the quest script for the DCUpgrade quest?

Both errors. The quest script is no different than how it was before. I also get a ton of messages on start up about a triangle of my navmesh having opposite normals from other triangles it's linked to and supposedly being linked to numerous other triangles. I don't know how to find a specific triangle in a navmesh by number. I also lost a cell that had 6 of the quest items in it. is there a limit to how many quest items can be in a cell?

 

the cell is "Wilderness(6,10)"

 

SCN DCUMetalPlatesSCRIPT

BEGIN onActivate
if (getActionRef == player)
set DCUpgrade.DCUCleanMetal to DCUpgrade.DCUCleanMetal + 1
Activate
endif
END

 

I would remove the numeric assignments to the variable declarations in the quest script. It may compile, but it's not valid.

 

Tell that to bethesda, they have numeric assignments for the variables in the quest script for the Wasteland Survival Guide's quest. sorry if I sounded rude but it is true.

 

Even without the variable value in the declearation the object script can't detect the quest script's variables

Link to comment
Share on other sites

Both errors. The quest script is no different than how it was before.

When you open the DCUpgrade quest with the Geck, is DCUMetalPlatesSCRIPT set as the script in the data tab?

 

If so, it may be worth going through it thoroughly to make sure there are no errors that the compiler isn't catching. Try Cipscis' validator.

 

 

I also get a ton of messages on start up about a triangle of my navmesh having opposite normals from other triangles it's linked to and supposedly being linked to numerous other triangles. I don't know how to find a specific triangle in a navmesh by number. I also lost a cell that had 6 of the quest items in it. is there a limit to how many quest items can be in a cell?

I can't help with that, sorry, hopefully someone else can.

Edited by iFSS
Link to comment
Share on other sites

Both errors. The quest script is no different than how it was before.

When you open the DCUpgrade quest with the Geck, is DCUMetalPlatesSCRIPT set as the script in the data tab?

 

If so, it may be worth going through it thoroughly to make sure there are no errors that the compiler isn't catching. Try Cipscis' validator.

 

 

The validator helped greatly, now I just need to figure out how to create a global variable when the GECK doesn't allow me to normally.

 

I get this error when trying to edit a global variable to make my own "TESDialog trying to use dialog box template for unknown type 'GLOB' "

 

I figured it out, I was accessing the variables through the object window instead of the gameplay/globals... option.

Edited by SalesKital
Link to comment
Share on other sites

Tell that to bethesda, they have numeric assignments for the variables in the quest script for the Wasteland Survival Guide's quest.

Yeah, a lot of Bethesda's own scripts have errors, unfortunately. The vast majority of them could also be improved in terms of efficiency with only small changes, which implies to me that most of their scripters, at least, don't have a very good understanding of how scripts work in Fallout 3. When it comes to best practises, they set a very poor and inconsistent standard.

 

Cipscis

Link to comment
Share on other sites

Tell that to bethesda, they have numeric assignments for the variables in the quest script for the Wasteland Survival Guide's quest.

Yeah, a lot of Bethesda's own scripts have errors, umfortunately. The vast majority of them could also be improved in terms of efficiency with only small changes, which implies to me that most of their scripters, at least, don't have a very good understanding of how scripts work in Fallout 3. When it comes to best practises, they set a very poor and inconsistent standard.

 

Cipscis

 

not to mention making it harder on people who learn the scripting better by studying pre-existing working scripts. If I have something I can take apart and study from a fully working position I can typically get a script like it working for me as well as making some working modifications to the script. One thing I can't figure out though is how to get clothing and armor textures to not go shiny on me. I'm trying to add at least 4 new types of clothing items to the game, 2 vault suits, adult and child, and 2 vault security armors, normal and elite.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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