ZeroCore Posted March 17, 2017 Share Posted March 17, 2017 What I'm trying to do is this; I'm trying to write a spell script that gets a character's race and then stores it in something, be it a quest script/alias, form list, or something else that will persist between game sessions, which can then be accessed by another script later on to pull the race data out of it. I recently read over a tutorial that shows how werewolf transformations work in this game, but I'm trying to streamline it so that it doesn't require the Companion's quest to be active. The current mods that I've seen that let you transform into other races only work if the Companion's quest storyline is active, and will fail if it's not. I'm trying to find a work-around to this that's not as complex. It works like this; turning into a werewolf stores your character's race in a quest alias. The transformation spells just change your character's race using the "setRace" command. When the spell wears off, in the case of the werewolf, or when you choose to transform back as in the case of the Vampire Lord (which has its own quest), the "return to normal" part of the script (werewolf) or spell (vampire lord), just pulls that stored race data from the quest alias and sets your character's race to it, only that in the case of the Vampire Lord, when you transform back, it makes sure to give your character the Vampirism ability, as if you had just turned into a Vampire for the first time, which makes sure that your character still looks like a Vampire when you turn back to your usual form. What I'm trying to do here can be summed up as this: I'm trying to make a public variable that can store a character's race, and this variable MUST be able to persist between game sessions. I know quest aliases DO persist between game sessions. Form lists, I think, can store data about characters, including a character's race if you're using the data pulled from the actor base, but I don't know if they can persist between game sessions. That said, does anyone here happen to know exactly how to do this? I'm hoping that it's possible to make a persistent public variable that can store race that does not involve a quest alias, in case I decide to give this spell to someone else besides the player, like a follower. Link to comment Share on other sites More sharing options...
lofgren Posted March 18, 2017 Share Posted March 18, 2017 Quest aliases are for object references and locations, nothing else. You can simply do what the Companions questline does and store the race as a property on a quest script. If you really want to store it some way independent of a script for some reason, you could use GetID and store it in a global variable. Just remember it will be stored in decimal format so it will have to be converted back to hex when you want to access it as a race instead of an integer. That said, the quest script used by the werewolf transformation is attached to the quest C00 which is always running. There is no reason that transformation mods should fail if the Companions questline isn't active. Link to comment Share on other sites More sharing options...
ZeroCore Posted March 21, 2017 Author Share Posted March 21, 2017 Quest aliases are for object references and locations, nothing else. You can simply do what the Companions questline does and store the race as a property on a quest script. If you really want to store it some way independent of a script for some reason, you could use GetID and store it in a global variable. Just remember it will be stored in decimal format so it will have to be converted back to hex when you want to access it as a race instead of an integer. That said, the quest script used by the werewolf transformation is attached to the quest C00 which is always running. There is no reason that transformation mods should fail if the Companions questline isn't active. Is there a way to have the spell's script create a new property in the quest script? The idea is that the spell could be taught to many individuals, or possibly every single NPC in the game that could cast spells, and then afterward give that NPC, and/or the player, their own property that the spell's script would reference from that point onward. I know that variables can be declared and filled mid-script, such as during a conditional statement. Is the same true for properties in a quest script, even if the script that's trying to add the property is another script that's attached to a spell rather than part of the quest script itself? Link to comment Share on other sites More sharing options...
Recommended Posts