Jump to content

[LE] Script that changes the values of another script


methodkid

Recommended Posts

I made a mod the other day that basically just involved changing a few values of one of Skyrim's scripts. After publishing it though I learned that this script is more or less run directly when you create your character. So no one that had already started a character could use my mod without making a new character. So my question is how do I make a script that goes back and changes those determined values of the first script? I assume it would involve importing that script somehow. I'm just not sure how to link this new script to the original one.

 

The idea is that this new script should be run once, and change the values of the old script, so the users don't have to create new characters to use the mod.

Link to comment
Share on other sites

Depends on the specific situation but here an example that might help:

 

Say I have a quest (QuestWithStuff) with the following script:

Scriptname ScriptWithStuff extends Quest

Int Property SomeStuff Auto
Int OtherStuff

I can change SomeStuff's value from another script because it's a property, I cannot change OtherStuff though. You'd something like this:

Scriptname StuffChangingScript extends Quest

ScriptWithStuff Property QuestWithStuff Auto ;autofill in ck, this basically points to the quest above
Int NewValue

Function DoIt()
  QuestWithStuff.SomeStuff = NewValue
EndFunction

I believe you could also do this, whatever is clearer.

Scriptname StuffChangingScript extends Quest

Quest Property QuestWithStuff Auto
Int NewValue

Function DoIt()
  (QuestWithStuff as ScriptWithStuff).SomeStuff = NewValue
EndFunction
Edited by FrankFamily
Link to comment
Share on other sites

  • Recently Browsing   0 members

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