Jump to content

Simple quest script


chucksteel

Recommended Posts

Also, both MasterMagnus and TummaSuklaa are correct about your script property, if you need access to a quest alias in a script, make the property a ReferenceAlias and point it to the quest alias, and there's no need to do playerRef.AddInventoryFilter, the current object the script is run on is assumed, so just AddInventoryFilter is what you need.

 

Alternatively, when you need the player in a script you can just do PlayerRef = Game.GetPlayer() at the top of the function or event you need it in.

Link to comment
Share on other sites

I'm testing from a save at the vault exit with no mods. I install the mod, exit the vault and COC to my test cell.

 

My list is incomplete it only has 26 of the 30 gnomes in it at the moment would that matter?

 

I'll test with the Debug next.

 

I'm glad you enjoy Beantown, This is The Drunken Gnomes quest I'm trying to get working by the way. :tongue:

Link to comment
Share on other sites

I would setup an array to track which ones you've grabbed:

 

ObjectReference[] Property CollectedGnomes Auto Hidden

 

Then change your event a little by replacing the Counter += 1 line to this:

if CollectedGnomes.Find(akItemReference.GetBaseObject()) < 0
     Counter += 1
     CollectedGnomes.Add(akItemReference.GetBaseObject())
endif
Link to comment
Share on other sites

Well I know I'm just clueless on this and I'm sorry for being a pain but I don't get how to add the array.

 

I did this

Scriptname BTInt_DRGN_Alias_Script extends ReferenceAlias


FormList Property BTInt_DRGN_Gnome_List Auto
Quest Property BTint_DRGN_Quest Auto
Message Property DRGN_CollectedMessage Auto
ObjectReference[] Property CollectedGnomes Auto Hidden

Int Counter = 0    ;If you want to be able acces this count outside the script you could replace the int with a global property.

Event OnInit()
    AddInventoryEventFilter(BTInt_DRGN_Gnome_List)
EndEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
	if CollectedGnomes.Find(akItemReference.GetBaseObject()) < 0
  	   Counter += 1
 	    CollectedGnomes.Add(akItemReference.GetBaseObject())
	endif
    If(Counter == 1)
        BTint_DRGN_Quest.SetStage(10)    ;change the 5 after setstage to wathever stage you need.
    ElseIf(Counter == 5)
        BTint_DRGN_Quest.SetStage(15)
    ElseIf(Counter == 10)
        BTint_DRGN_Quest.SetStage(20)
    ElseIf(Counter == 15)
        BTint_DRGN_Quest.SetStage(25)
    ElseIf(Counter == 20)
        BTint_DRGN_Quest.SetStage(30)
    ElseIf(Counter == 25)
        BTint_DRGN_Quest.SetStage(35)
	ElseIf(Counter == 30)
        BTint_DRGN_Quest.SetStage(40)
    EndIf
	DRGN_CollectedMessage.show(afArg1 = Counter)
EndEvent

Event OnLocationChange(Location akOldLoc, Location akNewLoc)
Debug.MessageBox("Location change detected.")
EndEvent

and get this error.

Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright (C) ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "BTInt_DRGN_Alias_Script"...
C:\Users\Chuckisteel\AppData\Local\Temp\PapyrusTemp\BTInt_DRGN_Alias_Script.psc(16,41): type mismatch on parameter 1 - cannot pass a form to a objectreference
C:\Users\Chuckisteel\AppData\Local\Temp\PapyrusTemp\BTInt_DRGN_Alias_Script.psc(16,58): cannot compare a void to a int (cast missing or types unrelated)
C:\Users\Chuckisteel\AppData\Local\Temp\PapyrusTemp\BTInt_DRGN_Alias_Script.psc(18,42): type mismatch on parameter 1 - cannot pass a form to a objectreference
No output generated for BTInt_DRGN_Alias_Script, compilation failed.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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