Jump to content

Scripting Help for "Floating text update"?


Tobias44142

Recommended Posts

I'm working on a simple quest where you collect say 10 iron ingotsfor someone and turn it in. I want the quest to "update" each time you get an iron ingot. This is similar to the Stones of Barenzia questline for the Thieves Guild.

 

Now i've familiarized myself with a decent bit of the dialogue views and I know that this is going to involve the "quest aliases for said iron ingot.

 

I've tried to mimic the RiftenFreeform07 quest: Ice Cold to no avail. Is there any video online that can run me through a tutorial on how to accomplish this?

Link to comment
Share on other sites

I created a local quest that tracks the dragon priest masks and it does what you want. I will use this as an example.

 

 

I have a single quest objective:

Seek out the Masks of Power (<Global=abim_DPMCurrent>/<Global=abim_DPMTotal>)

I have the following script attached to the quest:

Scriptname abim_DPMQuestScript extends Quest  

FormList Property FilterList  Auto 
Quest Property myQuest Auto
GlobalVariable Property abim_DPMCurrent Auto
GlobalVariable Property abim_DPMTotal Auto

Function MasksCounted()
;	Count = Game.GetPlayer().GetItemCount(FilterList)
	abim_DPMCurrent.Value = Count
	UpdateCurrentInstanceGlobal(abim_DPMCurrent)
	If 	Count >= abim_DPMTotal.GetValue()
		myQuest.SetObjectiveCompleted(10)
		myQuest.SetStage(10)
	ElseIf Count < abim_DPMTotal.GetValue()
		myQuest.SetObjectiveDisplayed(10,true,true)
	EndIf
EndFunction	

Float Count

Function CheckMasks(Form Mask)
	If Mask == FilterList.GetAt(0)
		If Mask1 == false
			Count = Count + 1
			Mask1 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(1)
		If Mask2 == false
			Count = Count + 1
			Mask2 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(2)
		If Mask3 == false
			Count = Count + 1
			Mask3 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(3)
		If Mask4 == false
			Count = Count + 1
			Mask4 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(4)
		If Mask5 == false
			Count = Count + 1
			Mask5 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(5)
		If Mask6 == false
			Count = Count + 1
			Mask6 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(6)
		If Mask7 == false
			Count = Count + 1
			Mask7 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(7)
		If Mask8 == false
			Count = Count + 1
			Mask8 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(8)
		If Mask9 == false
			Count = Count + 1
			Mask9 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(9)
		If Mask10 == false
			Count = Count + 1
			Mask10 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(10)
		If Mask11 == false
			Count = Count + 1
			Mask11 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(11)
		If Mask12 == false
			Count = Count + 1
			Mask12 = true
		EndIf
	ElseIf Mask == FilterList.GetAt(12)
		If Mask13 == false
			Count = Count + 1
			Mask13 = true
		EndIf
	ElseIf 	Mask == FilterList.GetAt(13) \
		||	Mask == FilterList.GetAt(14) \
		||	Mask == FilterList.GetAt(15) \
		||	Mask == FilterList.GetAt(16) \
		||	Mask == FilterList.GetAt(17) \
		||	Mask == FilterList.GetAt(18)
		If Mask14 == false
			Count = Count + 1
			Mask14 = true
		EndIf
	EndIf
	MasksCounted()
EndFunction

Bool Mask1
Bool Mask2
Bool Mask3
Bool Mask4
Bool Mask5
Bool Mask6
Bool Mask7
Bool Mask8
Bool Mask9
Bool Mask10
Bool Mask11
Bool Mask12
Bool Mask13
Bool Mask14

The player alias has the following script:

Scriptname abim_DPMQuestPlayer extends ReferenceAlias  

abim_DPMQuestScript Property DPMQS Auto
FormList Property FilterList  Auto 
Quest Property myQuest Auto

Event OnInit()
		AddInventoryEventFilter(FilterList)
EndEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
	If	 myQuest.GetStageDone(0) == 1
		If 	FilterList.HasForm(akBaseItem)
			DPMQS.CheckMasks(akBaseItem)
		EndIf
	EndIf
EndEvent

What is happening:

The formlist called FilterList contains the references to the items that I wish to count (my case dragon priest masks). As the player picks up the items and a specific stage has been met, the function called CheckMasks on the quest script is ran. This function updates the internal count of masks and then calls the MasksCounted function. This function in turn updates the global variable which references the current count of items and depending upon if all are accounted for advances the quest otherwise it displays the objective again.

 

 

 

Depending upon what you want to do, your scenario may not need to be as complicated as mine ended up. All you need is a display objective which shows a count value and a total value, a means to increase the count value as target items are obtained and display the objective each time an item is obtained.

 

FreeformIvarstead03 called "Grin and Bear It" in-game is another quest that you can look at to see how to set this up.

Link to comment
Share on other sites

Lets start out with the first line:

 

Scriptname abim_DPMQuestScript extends Quest. So what is "DPMQuestScript" refering to exactly? is that just the name of the questscript under the "script" tab at the very end of the Quest menu?

 

I think a short video would explain this a bit better. I'm still trying to find one that pertains to what i'm looking to do.

Link to comment
Share on other sites

Even trying to look into the "propterties" not the actual "source" is confusing cause I just have no clue which each of the properties each thing is refering to.

 

I know I must sound like an idiot but this is like giving the entire microsoft office suite to someone whose never even used notepad. :(

Link to comment
Share on other sites

I mean, I get the commands and what/how they are written. but i'm trying to make sure I know what its referencing. Example:

 

Scriptname abim_DPMQuestScript extends Quest (Where "abim_DPMQuestScript" is just the name of the script and is not linked to anything. Its sole purpose is for identification only and this never has to be referenced correct?

Link to comment
Share on other sites

It is the name of the script, yes.

As far as 'linking' you'll have to explain what you mean. Do you fill it like a property? No. But the compiler will reference it and complain if the PSC file name and the designated name do not match.

Most of the time you will not need to call upon a script externally. However, there are cases where one script will be referenced in another script.

 

I fear you are over thinking this. The scriptname line is created by the Creation Kit when you create your script inside the CK. Only reason to know the syntax is for purposes of creating a script outside of the Creation Kit.

Link to comment
Share on other sites

That script is extending Quest because the object the script is attached to is a Quest.

 

For you, "linking" would be the object a script is attached to. In this, that script is "linked" to something for sure and that something being the Quest object.

 

Explaining the extending of scripts(because scripts can also extend other scripts) would probably go over your head. But 99% of the time, you're only going to need to "link" a script to an object.

If a ReferenceAlias has a script attached to it. it'll extend ReferenceAlias.

Edited by Rasikko
Link to comment
Share on other sites

I keep getting the error when trying to compile ": cannot name a variable or property the same as a known type or script". Now I have to go into SSedit and delete this screwed up attempt without accidentally deleting other portions of my quests because for some reason creation kit won't do it.

 

I kinda get it.

 

I need to link the Object

 

I need to link the actor

 

I need to link the Quest.

 

For me the problem is WHERE I am linking this. I've looked at the papyrus primer page and its not helpful at all. I find Darkfox's step by step videos to be WAY more effective and are responsible for getting me this far.

 

I guess to just START: Do I want to create a fresh new script under the "SCRIPT" tab of my quest? Create the 3 needed aliases under "QUEST ALIASES"?

 

Another problem is WHERE am I to build these scripts? Under the Aliases? or under the SCRIPT tab of the quest? You can also write scripts under the dialogue views tab as well as the "Quest STAGES Tab".

 

Edit: The more I try the harder this gets. I'm trying to reference similar quests like "Ice cold" but WHERE is this reference coming from that reads "pteethcount". I really can't just make a misc object alias to have the script link to and just add the scripts to float count the item I want to keep track of?

Edited by Tobias44142
Link to comment
Share on other sites

  • Recently Browsing   0 members

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