Jump to content

Mods Sharing a Script


Recommended Posts

So I am wondering if it will create any conflicts that my mods I've created share the same script. Both mods add teleportation spells and use the same script, but use different references/effects/locations etc. Would this create any problems down the line at all? Or would it just be better to have Mod A with Teleport Script A, and Mod B with Teleport Script B?

Link to comment
Share on other sites

The only issue that can occur is that:

If you are using my A script and tomorrow i decide to update my mod and change the A script, this will F*** UP your mod in any of the possible players that have both mods in their load order.


It's always better to not share the same scripts with other mods, except of course if both mods are yours or they share a script on purpose.

Link to comment
Share on other sites

Both mods are mine. One is for a player house mod with a teleport, the other is just for teleport to Major Holds and Raven Rock. I'm leaning towards just making them separate scripts. The code is the same, but i figured I'd just make separate scripts for each mod. Have 'Mod A' script named aaaTeleportHome and 'Mod B' named aaaTeleportHolds, or something like that but they'll use the same coding for both.

Link to comment
Share on other sites

Well after changing somethings in my teleport mod, it seems the scripts just stopped working, even on new game saves. I can no longer teleport anywhere. The spells fire off but do nothing. I changed the teleport locations in the script properties to match the carriage destinations instead of the old x markers i had them set to, and now nothing seems to happen. I'm guessing I'll have to delete the .psc and .pex files, remove the script from the magic effect, save and start over by making the script again, recompiling and then editing properties? Or can i update the script/mod somehow without completely back tracking?

Link to comment
Share on other sites

When testing scripts never use 'Save Files', always 'COC' to a Test Cell or if you don't have one to any other vanilla cell.

You don't need to delete your scripts, you can fix the issue on your existing one, post it and someone could help you.


But, if you edit / fix your current script and you want that script to be use on your current "Save File" (the one you play the game with) that has seen the script, your teleport spell will malfunction.


In this case you will need to make everything new and especially the script with a new different name.

Once you do that, then you run the game > you make a new save > and you load that save. This is for avoiding the CTD when you use your teleport spell and the game will search for a script that dosen't exists anymore.

Link to comment
Share on other sites

 

When testing scripts never use 'Save Files', always 'COC' to a Test Cell or if you don't have one to any other vanilla cell.
You don't need to delete your scripts, you can fix the issue on your existing one, post it and someone could help you.
But, if you edit / fix your current script and you want that script to be use on your current "Save File" (the one you play the game with) that has seen the script, your teleport spell will malfunction.
In this case you will need to make everything new and especially the script with a new different name.
Once you do that, then you run the game > you make a new save > and you load that save. This is for avoiding the CTD when you use your teleport spell and the game will search for a script that dosen't exists anymore.

 

 

Then the script properties and source MUST be permanent and FINAL before making a dedicated save? I thought that scripts source and properties could be updated throughout gameplay.

 

Essentially I had all the walled Holds spells teleport inside the city. But I realized, at least to me, it'd make more sense if they tele'd to the carriage destinations like the other Holds that have no walls like Whiterun. All i did was change the ObjectReferences of the script properties of the effect aaaWhiterunTeleEffect and others from Cell: A to Cell: B and Reference A: to Reference: B. After that the teleport spells go dead lol.

ObjectReference Property Loc01 Auto
Event OnEffectStart(Actor akTarget, Actor akCaster)
    Utility.Wait(1.0)
    Game.FadeOutGame(False, True, 2.0, 1.0)
    Game.GetPlayer().MoveTo(Loc01)
    Game.EnableFastTravel()

EndEvent

 

 

Link to comment
Share on other sites

In your case, because the script is on a magic effect that in all likelihood won't be active when the game is saved, you can change the script itself to your hearts content as much as you want and it should be reflected every time. However, property values remain with the plugin and once loaded their status remains unchanged.

 

You could add a new property, leaving the old one in place, and change the script to use the new property. Before releasing to the public though, remove the old property from the script and the record in the plugin.

 

For example:

 

 

ObjectReference Property Loc01 Auto ;old property
ObjectReference Property Loc01A Auto ;new property

Event OnEffectStart(Actor akTarget, Actor akCaster)
  Utility.Wait(1.0)
  Game.FadeOutGame(False, True, 2.0, 1.0)
  Game.GetPlayer().MoveTo(Loc01A) ;change property used
  Game.EnableFastTravel()
EndEvent 

 

When ready to test on a new game (and / or release to the public), comment out or remove entirely the old property from the script itself. Then open the record(s) holding the script in the CK, open the properties window for that script and close it again. The list of properties will automatically be updated for that record.

Link to comment
Share on other sites

Off topic but, I am trying to find a way to increase perk points per X amount of levels. Basically my own version of Enai's 20/50 pct perk point mods. How would I begin to go about that? I've tried searching tutorials and the CK site but can't seem to find anything to what I am looking for to get me started

Link to comment
Share on other sites

  • Recently Browsing   0 members

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