nofawkingasianservers Posted December 31, 2020 Author Share Posted December 31, 2020 What I meant is to make a new faction that's only used for that purpose, with only one rank and no relationship data.Oh I see, sorry. Aight, I'll look into it. It can't be too hard. I'm trying out the global variable way but I can't seem to get the SetValue() function to work. Do you have any suggestion on that? Link to comment Share on other sites More sharing options...
dylbill Posted December 31, 2020 Share Posted December 31, 2020 Hmmm I'm not sure, looks like that should be working. Make sure you save your esp after setting the property. Link to comment Share on other sites More sharing options...
RichWebster Posted December 31, 2020 Share Posted December 31, 2020 So when the initial value is set to 0.0 on load, and you cast the spell, the normal behaviour works fine. But it will allow you to cast it again because SetValue(1.0) isn't working? But setting it to 1.0 via console beforehand makes the if statement return true? Link to comment Share on other sites More sharing options...
nofawkingasianservers Posted December 31, 2020 Author Share Posted December 31, 2020 (edited) So when the initial value is set to 0.0 on load, and you cast the spell, the normal behaviour works fine. But it will allow you to cast it again because SetValue(1.0) isn't working? But setting it to 1.0 via console beforehand makes the if statement return true?The initial value is set to 0.0 on load, yes. When I cast the spell, all the statements/functions after the Sprigged.SetValue()don't work (no 'immersion lines' on the top left like "The woods give you power" and no spriggan armor equipped on the PC). The reason why I came to that conclusion is that if I manually set the value of 'sprigganstate' to 1 via the in game console, I'll get the "You're already tapping into the power of the woods"line the next time I cast the spell.I'm trying to implement this condition check in the first place not to stop the player from casting the spell repeatedly, but to not give/equip the player with the spriggan armor every time they cast the spell. Edited December 31, 2020 by nofawkingasianservers Link to comment Share on other sites More sharing options...
RichWebster Posted December 31, 2020 Share Posted December 31, 2020 Super strange that SetValue() isn't working. Are you testing this on a clean save? Link to comment Share on other sites More sharing options...
nofawkingasianservers Posted December 31, 2020 Author Share Posted December 31, 2020 Super strange that SetValue() isn't working. Are you testing this on a clean save?I coc to qasmoke from the menu, the game gave me a basic level 1 character and then I tried on that. Once. Didn't seem to work so I tested on my current lvl 27 char save ever since. Link to comment Share on other sites More sharing options...
nofawkingasianservers Posted December 31, 2020 Author Share Posted December 31, 2020 I wonder if the ModValue() will work if I use a negative number? Maybe I could try using that function instead of SetValue(). Link to comment Share on other sites More sharing options...
nofawkingasianservers Posted December 31, 2020 Author Share Posted December 31, 2020 Okay I've found out the culprit, it's the save game (Dammit! Who wouldda thought?) I loaded my most recent save game (prior to this, I'd been testing on a save 4 hrs back, before I'd got the spell that I'm building in the CK) and now the global variable is updated properly now. :> Oh and Happy New Year to anyone passing through this topic! Link to comment Share on other sites More sharing options...
RichWebster Posted December 31, 2020 Share Posted December 31, 2020 Good stuff :) Happy new year! Link to comment Share on other sites More sharing options...
RichWebster Posted January 1, 2021 Share Posted January 1, 2021 Also for the purpose of knowledge I'll explain why the save was the problem. The script object while active is essentially baked into the save. You're able to change the script and have those changes take effect, but if you add new properties and fill them, those changes won't work on the save. Unless you manually set the properties via script, or the object resets (like stopping and starting a quest back up). You'll find in your script logs that when it was calling GetValue and SetValue, a papyrus error was generating advising that the object your calling is a none value. Edit Pro tip for script developers. Have the Papyrus log file open when running the game to test. The file that represents the current/most recent game launch is Papyrus.0 I recommend a program like MTail to keep it open, and when you're testing in-game you'll see any papyrus errors from your script in real-time. Also handy to have debug.trace calls, since those don't get delayed like debug.notification. Link to comment Share on other sites More sharing options...
Recommended Posts