Jump to content

Help with modding - using optional mod quest variables


Recommended Posts

Posted

Hi,

 

During the creation of my new mod I encountered an issue I have no idea how to solve.

 

In my new mod I'm trying to create an optional connection to the "Wasteland Stress.esp" mod, but I can't find a method to get or set  it's quest variables.

 

Here is what I have so far:

if IsModLoaded "Wasteland Stress.esp"
			set rStressQuest to GetFormFromMod "Wasteland Stress.esp" "0AE4"

			if eval !(IsFormValid rStressQuest)
				set iStressLoaded to 0
			elseif GetType rStressQuest != 71
				set iStressLoaded to 0
			else
				set iStressLoaded to 1
			endif
endif

Ok, so far so good. I get a reference to the "StressQuest" quest from the "Wasteland Stress.esp" mod and confirm that it's valid and of the correct type.

The problem is, that I can't seem to access it's variables in any way.

 

rStressQuest.Stress
GetQuestVariable rStressQuest "Stress"

Both do not work. The compiler won't accept them.

 

I also tried GetVariable, but apparently the reference rStressQuest has no variables at all. I also tried referencing it's quest script directly to no avail.

 

Is there some other way this can be acomplished, or is it simply not possible?

 

I'd really appreciate any help. ?

Posted

Try this:

GetVariable "Stress" rStressQuest

 

EDIT: of course I'm assuming the rest is correct, that part is more important, I'd try to be twice sure i.e. some GetQuestRunning rStressQuest should return 1 etc.

Posted
7 hours ago, A.J. said:

Try this:

GetVariable "Stress" rStressQuest

 

EDIT: of course I'm assuming the rest is correct, that part is more important, I'd try to be twice sure i.e. some GetQuestRunning rStressQuest should return 1 etc.

Holy crap! It worked! Thank you!

 

But why? Arent the two forms equivalent?

Posted

GetQuestVariable should be only for conditions (i.e. AI package etc.), GetVariable is the NVSE function for scripting

Posted
On 5/2/2020 at 10:30 PM, A.J. said:

GetQuestVariable should be only for conditions (i.e. AI package etc.), GetVariable is the NVSE function for scripting

Thanks, but I meant the difference between "reference.GetVariable  variableName" and "GetVariable variableName reference".

Posted
9 hours ago, ylenard said:

Thanks, but I meant the difference between "reference.GetVariable  variableName" and "GetVariable variableName reference".

REF.FUNCTION is the usual syntax, but for some rare cases it doesn't work and it's just a matter of trials and tests until you figure it. In this case I knew it because I already used it in some mods to make soft dependencies.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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