Hot to display a global variable in quest objective displaye

Post » Tue Nov 20, 2012 3:05 am

OK, I've got an objective to kill a bunch of Thalmor, but I want the objective in the journal to tell how many are left to kill. I have all the scripting and my global in place and it's all working properly. I have this in my quest objective: Kill all the Thalmor in the prison. (/15 remaiming)

And what I see in the journal looks like this: Kill all the Thalmor in the prison. ([...]/15 remaiming.)

So, I'm not seeing the count correctly. Any suggestions on how to make this work?
User avatar
D LOpez
 
Posts: 3434
Joined: Sat Aug 25, 2007 12:30 pm

Post » Tue Nov 20, 2012 1:13 am

In the Quest Data tab (first tab in a quest) you'll see in the bottom right Text Display Globals. You need to add your globals to there.
User avatar
Anna Watts
 
Posts: 3476
Joined: Sat Jun 17, 2006 8:31 pm

Post » Tue Nov 20, 2012 9:43 am

Thanks BigDaddy, I'll try it.
User avatar
Emily Shackleton
 
Posts: 3535
Joined: Sun Feb 11, 2007 12:36 am

Post » Tue Nov 20, 2012 6:35 am

OK, that made it display: Kill all the Thalmor in the prison. (15/15 remaining.), but it's not counting down from 15, to 14, to 13 etc. So I added "UpdateCurrentInstanceGlobal(BalokThalmorPrison)" to OnDeath block of my actors script and it won't compile. It says "UpdateCurrentInstanceGlobal is not a function or does not exist". Here's the full script:

Spoiler
Scriptname BalokThalmorGuardsScript extends ReferenceAliasimport gameimport debugQuest Property BalokThalmorPrison autoObjectReference Property PlayerRef autoGlobalVariable Property BalokThalmorGuardCount  Auto  auto State waiting	Event onHit(objectReference akAggressor, Form akWeapon, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)GoToState("KillThalmor")		 if akAggressor==PlayerRef && BalokThalmorPrison.GetCurrentStageID()&--#60;55			 BalokThalmorPrison.SetCurrentStageID(90)			 Debug.Notification("player started a fight stage 90 set")					endIf	endEventEndStateState KillThalmorEvent OnDeath(Actor akKiller)	 BalokThalmorGuardCount.Value -= 1	 Debug.Notification("global count minus 1")	 UpdateCurrentInstanceGlobal(BalokThalmorGuardCount)	If (BalokThalmorGuardCount.Value &--#60; 1) && BalokThalmorPrison.GetCurrentStageID() == 60		 BalokThalmorPrison.SetCurrentStageID(70)		 Debug.Notification("global count is done stage 70 set")		 ElseIf (BalokThalmorGuardCount.Value &--#60; 1) && BalokThalmorPrison.GetCurrentStageID() == 90		 BalokThalmorPrison.SetCurrentStageID(100)		 Debug.Notification("global count is done stage 100 set")		 gotoState ("allDone")	endifendEventEndStateState allDone				 ;do nothingendState


EDIT: I think I got it, going to test - brb.

YES! I needed to add the quest where the global was instanced like: BalokHelgen01.UpdateCurrentInstanceGlobal(BalokThalmorGuardCount), and it works now!
User avatar
Lauren Dale
 
Posts: 3491
Joined: Tue Jul 04, 2006 8:57 am

Post » Tue Nov 20, 2012 1:27 am

UpdateCurrentInstanceGlobal() is a Quest Script function mate, that's why it won't compile. a ReferenceAlias script doesn't recognise that function.

What you need to do, is add a script to your quest script (scripts tab). Call it BalokThalmorGuardUpdate. Add this code:

Spoiler

Scriptname BalokThalmorGuardUpdate extends Quest conditionalGlobalVariable Property BalokThalmorPrison  AutoFunction UpdateBalokThalmorPrison()		  UpdateCurrentInstanceGlobal(BalokThalmorPrison)EndFunction

Once you've done this, set the property to point to your global. Save the quest, close it, then reopen and go back to alias your script is attached.

Now, edit the properties of your Reference Alias Script (not the new script you just made). Add a new property called:

BalokThalmorGuardUpdateScript

For it's type, put:

BalokThalmorGuardUpdate

Now it should allow this to be input when you click OK. For the value, your quest should be in the dropdown options. If you did it right, it'll work. Save, close the quest, then go back in.


Now in your script where you modify the global by 1, below that line put:


BalokThalmorGuardUpdateScript.UpdateBalokThalmorPrison()



This should work :smile: What you're doing here now, is calling a custom Function you have made, in a script outside your working script. This is a very handy way of doing globals for objectives.
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm

Post » Mon Nov 19, 2012 10:27 pm

lol ya ninj'd me! (see my edit above I just added my quest property and "BalokHelgen01.UpdateCurrentInstanceGlobal(BalokThalmorGuardCount)" and it works. Thanks for the help Big Daddy! BTW, if I ever get this damn mod finished and actually start playing the game again, I'm dying to try your hunting mod.
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Tue Nov 20, 2012 3:04 am

lol ya ninj'd me! I figured that out the same time you were typing! Thanks for the help Big Daddy! BTW, if I ever get this damn mod finished and actually start playing the game again, I'm dying to try your hunting mod.

lol it's better you figured it out yourself mate, more feeling of accomplishment :)

Well if you use NMM, download the current version, and wait until I update to 1.3 (NMM will let you know). 1.3 is going to include tonnes of content, including a new crafting system, and more immersive way of pelt taking :)
User avatar
Cartoon
 
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm


Return to V - Skyrim