Is there a way to cross-reference scripts?

Post » Mon Aug 23, 2010 11:21 am

Suppose I want to make an "IF" command, but I want the "IF" to be wholly dependent on a variable that is calculated in an entirely different script. Not the same quest, not the same NPC, at all.

I have a feeling it can be done. After all, accomplishing some things in questlines will often result in those accomplishments being acknowledged in completely unrelated quests (such as generic rumors or black horse courier editions).

The question is, HOW do you do it?
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm

Post » Tue Aug 24, 2010 1:08 am

Take a look at this page: http://cs.elderscrolls.com/constwiki/index.php/GetQuestVariable

Here's an example of how to do what you want:

ScriptName QuestABegin GameModeif ( QuestB.VariableB == 50 )	; Do somethingendifEnd

User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Mon Aug 23, 2010 7:57 pm

Global variables are easier and actually take a bit less processing since quests have overhead.

On the toolbar select, >Gameplay >Globals.

Right-click in the window and select 'New'.

Name your global. This variable can now be used anywhere in the game. In scripts, conditions, quests, anywhere. And if its updated in one place, its updated everywhere it can be used.

And you do not need to prefix the global variable name. You use it just like you would a variable you define in the local script.
User avatar
Destinyscharm
 
Posts: 3404
Joined: Sun Jul 23, 2006 6:06 pm


Return to IV - Oblivion