kinggath Posted September 8, 2016 Share Posted September 8, 2016 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 More sharing options...
chucksteel Posted September 8, 2016 Author Share Posted September 8, 2016 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 More sharing options...
kinggath Posted September 8, 2016 Share Posted September 8, 2016 It would only matter if the one you're looting happens to be missing from the list... Link to comment Share on other sites More sharing options...
chucksteel Posted September 8, 2016 Author Share Posted September 8, 2016 ya the missing ones haven't even been added to the mod yet so that's not the issue. Link to comment Share on other sites More sharing options...
chucksteel Posted September 8, 2016 Author Share Posted September 8, 2016 well I don't know what to think! I only added the Debug and it all worked like a charm! So my next question is how do I make sure the script only counts the gnome in the list once? Link to comment Share on other sites More sharing options...
kinggath Posted September 8, 2016 Share Posted September 8, 2016 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 More sharing options...
MasterMagnus Posted September 8, 2016 Share Posted September 8, 2016 Glad you got it working. I didn't mean to focus on the EventFilter specifically, just using that line as an example. More power to ya! Link to comment Share on other sites More sharing options...
chucksteel Posted September 8, 2016 Author Share Posted September 8, 2016 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 More sharing options...
kinggath Posted September 8, 2016 Share Posted September 8, 2016 How are your Gnomes set up? Are there exactly one of each in the world? If so, just remove the all .GetBaseObject() bits from what I had you add. Link to comment Share on other sites More sharing options...
LoneRaptor Posted September 8, 2016 Share Posted September 8, 2016 Try changing the ObjectReference[] Property CollectedGnomes Auto HiddenTo: Form[] Property CollectedGnomes Auto Hidden Link to comment Share on other sites More sharing options...
Recommended Posts