Jump to content

[LE] Global keeps resetting itself on game restart. Can't find a solution. Any help?


Recommended Posts

I put out a mod a while ago called Extended Stay, lets you book inns for longer periods of time.

http://www.nexusmods.com/skyrim/mods/79045/?

Works fine.

I pushed an update a day or two after it came out that tied prices to a global variable, so the user can customize prices using the console. I thought I had it working fine.

I got this comment on the mod shortly before the holiday season began and honestly haven't had the time to mess around with it, but can confirm it's a problem.

Ok, I have tested this further: I can set the global values with your commands, and when I use "GetGlobalValue RoomCost/RoomCost#Day", it returns the correct value. When I change cells, it still stays the same. I can reload the save, and it will stay the same. However, if I close and restart the game, it changes back to its default value when I load up that same save.


I don't even know where to begin trying to fix this. I have no scripts or fragments that should be resetting the variable, but they keep resetting anyway. I've been poking around and nothing I do seems to be affecting it one way or the other.

Anybody know what the deal is with this? Thanks very much for any help.

EDIT: I'm a big dumb who copied a constant global, and then didn't uncheck the constant setting. And then I assumed it must have been a scripting error causing this and didn't go back and look like a big ol' dumb.

Ignore this post, lol.

Edited by Robbie922004
Link to comment
Share on other sites

I already fixed it, see my edit. I was just way overthinking the problem and it was just the globals being erroneously checked as constant. I thank you for the detailed response, though.

As far as SKSE-dependency is goes, that's not correct. Refresh is the name of the function I wrote, not the papyrus function. The actual block of script is as follows:

Scriptname MODExtendedStayRefresher extends Quest  


GlobalVariable Property RoomCost3Day Auto
GlobalVariable Property RoomCost7Day Auto
GlobalVariable Property RoomCost30Day Auto

Function Refresh()
	UpdateCurrentInstanceGlobal(RoomCost3Day)
	UpdateCurrentInstanceGlobal(RoomCost7Day)
	UpdateCurrentInstanceGlobal(RoomCost30Day)
endFunction

And it does not pertain to the issue here. This script is just a tiny little one for refreshing the globals in dialogue so they parse correctly using text display in quests after being changed, and it's called from a fragment in dialogue.

SKSE is not required to use UpdateCurrentinstanceGlobal. To my knowledge, no such Refresh() function exists within SKSE.

Edited by Robbie922004
Link to comment
Share on other sites

By the way: Do you informe your mod user, that you changed a vanilla Skyrim script?

Maybe you thought it is unnecessary, because you only add three functions without changing the vanilla event content.

Of course. Fortunately only a seemingly very tiny handful of mods modify the same script so compatibility has been good so far.

 

Scriptname RentRoomScript extends Actor Conditional[/code]

A last word to you and all modders they will read my posting, it is never a good idea to upload a mod, that contains papyrus script files, without the sources.

I provide source code on request, but it's a superfluous download for 90% of end users who will never touch it, so I don't include it by default. If enough people asked to see I would just start packing it in but I can count people who have been interested in it on one hand.

 

Not to mention many of my older scripts are pretty sloppy (not functionally, but aesthetically) and I wouldn't really feel good about sharing the sources until I went back and cleaned them up.

Edited by Robbie922004
Link to comment
Share on other sites

  • Recently Browsing   0 members

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