spandrel Posted July 27, 2017 Share Posted July 27, 2017 I'm attempting to alter the "defaultclearlocationontriggerscript" so that a formlist of shipment items is given to the player when a location is cleared. This is what I've added:....SalvageClearedEndifEndEventFunction SalvageClearedGame.GetPlayer().AddItem(1sp_Shipment_FLST, 1, true)Notification("Salvage complete")EndFunction I get several errors trying to compile: extraneous input ' 1' expecting IDmismatched input '\\r\\n' expecting LPARENObject reference not set to an instance of an object Any help would be much appreciated Link to comment Share on other sites More sharing options...
kitcat81 Posted July 27, 2017 Share Posted July 27, 2017 (edited) I think it`s not a good idea to alter scripts, it`s better to attach another script. And I`m not sure what you are trying to achieve and if this is going to work but the compiler does not like your syntax. You can always check syntax in the Fallout 4 wiki. It also has some simple examples for any function. Function SalvageCleared() ; it was missing brackets. You also need to add them anywhere you call this function. Game.GetPlayer().AddItem(sp_Shipment_FLST, 1, true) ; the first thing in brackets must be the ID that you use in properties . The name of your property looks a bit weird. If it`s a formlist you need to tell the game the index of the intem. For example, Game.GetPlayer().AddItem(MyFormlist.GetAt(2)), 1, true) - give player an item that is index 2 in MyFormlist Debug.Notification("Salvage Complete")EndFunction PS My apologies, I meant the Creation kit wiki, not Fallout 4. Edited July 27, 2017 by kitcat81 Link to comment Share on other sites More sharing options...
spandrel Posted July 27, 2017 Author Share Posted July 27, 2017 Thank you. I think I will take your advice though and change tactics. I was never very good at scripting skyrim and I've obviously forgotten what little I knew. I am adding a leveled list of resource shipments to boss chests instead, will accomplish more or less same thing. Your help and advice are much appreciated. Link to comment Share on other sites More sharing options...
JonathanOstrus Posted July 27, 2017 Share Posted July 27, 2017 (edited) I'm attempting to alter the "defaultclearlocationontriggerscript" so that a formlist of shipment items is given to the player when a location is cleared. This is what I've added:....SalvageClearedEndifEndEventFunction SalvageClearedGame.GetPlayer().AddItem(1sp_Shipment_FLST, 1, true)Notification("Salvage complete")EndFunction I get several errors trying to compile: extraneous input ' 1' expecting IDmismatched input '\\r\\n' expecting LPARENObject reference not set to an instance of an object Any help would be much appreciated Following what kitkat81 said I'd agree not to modify vanilla scripts. Relating to your original question though the reason you get compile errors is that you're calling and defining the SlavageCleared function incorrectly. You need the parenthesis on it. Also not sure if that script has import debug or not. If not then your notification line needs to be changed. Though you should use a Message and display it with .Show() instead Message Property msgSalvageComplete auto const mandatory SalvageCleared() ; call the function Function SalvageCleared() ; define the function Game.GetPlayer().AddItem(1sp_Shipment_FLST, 1, true) Debug.Notification("Salvage complete") ; unless you have import debug in the script then the debug can be omitted. msgSalvageComplete.Show() ; get rid of the notification line and create a message then fill the property EndFunction Edited July 27, 2017 by BigAndFlabby Link to comment Share on other sites More sharing options...
spandrel Posted July 27, 2017 Author Share Posted July 27, 2017 Your help also much appreciated! I went with a non-script version which still has basically zero vanilla footprint, no mod conflicts likely (I hope), and more or less gets the same thing done. God, when I started this, I planned on quest aliases for each location with unique resource rewards upon clearing them. And then I realized I really don't remember any of the little scripting I used to know, and that there are some differences with skyrim ck on top of that. Anyway, thank you for your advice and instruction. Link to comment Share on other sites More sharing options...
Recommended Posts