GrimGrim31 Posted March 9, 2021 Share Posted March 9, 2021 Hello, I have a script function that is supposed to add 50 to an actor value. My debug notification tells me that the function is getting called when it is supposed to but the actor value never increases by 50. It doesn't change. I am just getting started with Papyrus so it has been a bumpy ride so far. The Creation Kit Wiki helps but often leaves me puzzled even more. The actor value is in my ESP and I also declared it at the beginning of my script. ActorValue property NPC_Friendship auto Function IncreaseNPC_Friendship()int Friendboost = 50Game.getplayer().ModValue(NPC_Friendship, Friendboost)debug.notification("IncreaseNPC_Friendship Function Called")EndFunction How do I write the script so that the actor value is increased correctly? Link to comment Share on other sites More sharing options...
dylbill Posted March 9, 2021 Share Posted March 9, 2021 Make sure you fill your script property. After attaching your script to something in the CK, click on Properties and Auto Fill All. If your property is named the same in the script and in the CK, it should automatically be set. Or you can set it manually by clicking Edit Value on the individual property. Link to comment Share on other sites More sharing options...
SKKmods Posted March 9, 2021 Share Posted March 9, 2021 Enable debug logging to see what errors are being thrown to the log https://www.creationkit.com/fallout4/index.php?title=Enable_Debug_Logging Function looks fine so most likely dylbill's suggestion. Link to comment Share on other sites More sharing options...
GrimGrim31 Posted March 9, 2021 Author Share Posted March 9, 2021 Thanks for the answers but I am still stuck. The script was already attached to a quest. Do I need to delete the script and add it again? When I select the script and get access to the properties button, clicking that button does nothing. If I try to add the script again, I am unable to see it as a selection choice in the dropdown. It is located in a subfolder within the scripts data folder. Link to comment Share on other sites More sharing options...
dylbill Posted March 9, 2021 Share Posted March 9, 2021 You shouldn't need to add it again. If the Auto Fill All button does nothing, you need to set properties manually. Click on the individual property, then click on the edit value button. Then you should have a drop down list where you can set your ActorValue property. Link to comment Share on other sites More sharing options...
niston Posted March 9, 2021 Share Posted March 9, 2021 it has been a bumpy ride so far. Welcome aboard - It'll always be like this. Renaming and/or changing the data type of properties on your script may break the script properties button in CK. It will do nothing when clicked and the properties dialog won't open.One solution is to clear out all stored properties from the relevant VMAD record in your plugin with xEdit. Removing the script in CK and then saving/reloading the plugin might work as well. Link to comment Share on other sites More sharing options...
GrimGrim31 Posted March 10, 2021 Author Share Posted March 10, 2021 (edited) it has been a bumpy ride so far. Welcome aboard - It'll always be like this. Renaming and/or changing the data type of properties on your script may break the script properties button in CK. It will do nothing when clicked and the properties dialog won't open.One solution is to clear out all stored properties from the relevant VMAD record in your plugin with xEdit. Removing the script in CK and then saving/reloading the plugin might work as well. Thanks! Will FO4EditQAC clean the stored properties if I run it on the esp file that has the script attached? If not, I am not sure how to use FO4Edit to clear out the stored properties from the relevant VMAD. EDIT: The Quick Auto Clean (QAC) worked but it took a while to figure that out. When I loaded the data for the esp into CK, I still wasn't able to get the property button to work. It would start but then a popup would tell me there was an error and the property window would open with no properties. I decided to try loading the data for two other files. One had an API that was referenced in the script and the other had the Actor Value variable that I used in the script. Using the data from all three files made the property button for the script work correctly. I autofilled the actor value but wasn't able to save the esp. It was locked for some reason, perhaps an aftereffect of using QAC. I closed all of my open programs, restarted my computer, and was able to repeat the process to autofill the actor value and save the esp. Unfortunately, my script function still doesn't work in the game. Edited March 10, 2021 by GrimGrim31 Link to comment Share on other sites More sharing options...
dylbill Posted March 10, 2021 Share Posted March 10, 2021 If the function still isn't working, make sure you're testing on a save that hasn't had your mod loaded yet, or try testing on a new save. Script data can get baked into saves. You can also try stopping and starting your quest again with a console command to test. Link to comment Share on other sites More sharing options...
SKKmods Posted March 10, 2021 Share Posted March 10, 2021 To avoid the save/load cycle for simple script changes, a shortcut is to console [ ReloadScript ScriptName ] restarting restartable quests does not reload scripts. If the script is actively running and the runtime line number offset or variable pointers are affected a consistency error wil be reported in the log so you know a new game is needed. If you want to use ReloadScript as a workflow accelerator keep an eye on the debug log. This can not be used for external script property changes though, only internal script variables. Link to comment Share on other sites More sharing options...
PJMail Posted March 10, 2021 Share Posted March 10, 2021 Sorry for the hijack but SKK - something I have always wanted to know - what tolerance does the game have for internal variable changes in running scripts?"reload scriptname" is new to me! Previously it seems to be quite tolerant of external (property) changes (as long as you allow for them becoming Null) but re-arranging the order of internal variables (on running scripts) seems to cause wierd corruption issues. Never removing old internal variables, and adding new ones to the end, seems to be ok (in my limited experience) - but are you saying "reload" will sort all that out? Link to comment Share on other sites More sharing options...
Recommended Posts