Jump to content

Scripting: Variables not set?


Bumblebee25

Recommended Posts

Hi all,

I've been trying to set up a short quest similar to freeformriften04 or freeformivarstead (ie collect X amount of X item) but i've hit a small snag in trying to get the game to display how many of an item the player has collected

 

My Scrip is this, (similar to the quests listed)

 

 

Scriptname ShardQuest01 extends Quest

Quest Property ShardsQuest  Auto Conditional
GlobalVariable Property ShardsGemCount  Auto Conditional
GlobalVariable Property ShardsGemTotal  Auto Conditional
MiscObject Property GemItem Auto Conditional

Function GemsCounted()

float CurrentGemCount = Game.GetPlayer().GetItemCount(GemItem)

ShardsGemCount.Value = CurrentGemCount
UpdateCurrentInstanceGlobal(ShardsGemCount)
if CurrentGemCount >= 8
	ShardsQuest.SetObjectiveCompleted(10,1)
	ShardsQuest.SetObjectiveDisplayed(20,true,true)
elseif CurrentGemCount < 8
	ShardsQuest.SetObjectiveCompleted(10,0)
	ShardsQuest.SetObjectiveDisplayed(20,0)
	ShardsQuest.SetObjectiveDisplayed(10,true,true)	
endif

endFunction

 

 

 

I think the variables have been set (as far as I can see) within the code and in the CK

Variables

 

and the quest objective should be displaying "Gather 8 Shards of Dawn to reforge the sword (<Global=ShardGemCount>/<Global=ShardGemTotal>)", obviously the GemCount is the number collected and the Total is the 8 needed to complete the objective.

 

But in game, all i see is this

Broked Display

 

Clearly I'm missing something, probably very simple as is always the case. So could someone point me in the right direction please?

 

Any help is very much so appreciated :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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