Jump to content
  • entries
  • comments
  • views

Script question

Storms of Superior


I've been toying with a possibility. The possibility includes a fix for the issue that causes the PC to get permanently added to the enemy faction when SD+ or Defeat go wrong (looping bleedout or repeated bleedout without either mod fully engaing).


I have had this problem with both SD+ and defeat when used in separate games, but never with DA (which both mods use), and I've concluded that the use of DA by mods, when adding the PC to enemy factions, never complete the the handoff to those enemy factions, leaves the game in the sorry state of nearly every enemy NPC being friendly toward the player.


This issue has been reported multiple times, at least on the SD+ support topic, but there never has been a clearly defined solution, as far as I can see.


This brings me to a few questions about the possibility of using a script to fix the issue when it occurs. The idea is to use a script that can be bound to a hotkey, or be used in the MCM like a debugging option. The script would check the enemy factions to find out if the player is in any of them, and if it finds that the player is in them, it removes the player from those factions. If the player isn't found to be in any of those factions, it skips the operation used to remove the player from that particular faction.


Now for the actual questions:


1. Is this even possible? It seems very possible.


2. Is it even wise to do this? When dealing with scripts, things can get ugly very quickly.


Thanks for reading, folks.


Recommended Comments

1: Sure, why not? You can definitely bind scripts to hotkeys, so just bind a reset-factions script to a hotkey and you're good.


2: Maybe, maybe not... if your script is put together well, it should have minimal impact on the game - a one-shot script that fires only when you press a key (or activate an option in the MCM would probably prevent accidental presses).


Of course, a script has no real way of knowing what factions the player is supposed to belong to by itself... if you, for example, write down all the factions the player belongs to and doesn't belong to at the start of the game, then reset to that, it'll remove the Companions for example. And you don't want to just not remove from a playable faction, because what if a story-based mod has some reason for making that faction an enemy or a friend?


I suppose you could make it very complex, and check the status of active and completed quests for all factions and see where the player's supposed to be, then reset faction presence based on that. You'd have to keep it updated constantly - whenever a mod author updates a mod, you'll have to check the update to see if it changes anything you'll need to fix.




All in all, the potential for breaking things more is definitely there. I tend to think that it's more up to the player to use addfac/removefromfac as a solution, or possibly for the modders in question to fix it on their end... though I'm not sure if it's possible to stop Skyrim from being Skyrim, honestly. :)


It'd probably not be very much work to make a reset-all-factions-to-vanilla-status mod, but that's sort of the nuclear option. It probably would be a lot of work to make an adaptive faction detector and reset mod, and even then it might conceivably break things worse than they already are.


My suggestion would be to just let it lie. Yes, several people have problems with faction-altering mods, but the numbers are actually quite small (just comparing complaints to downloads, for example). If you do make a mod like this, make sure people know it really is a last resort. Just remember - any time a modder tries to push the engine to do something the designers didn't account for (i.e. depth and complexity), there are going to be problems.

Link to comment

Right. A total reset mod wouldn't be a good idea; that would definitely break the game.


However, to check individual factions such as bandit, necromancer, vampire, etc. wouldn't be nearly so dangerous.

Link to comment

Aye... but I'm picturing a mod - there may or may not already be one like this, I dunno - that is a story-based one, adding you into the Bandit faction.


Actually, now that I think about it, what about Alternate Start? If you pick the "start as a bandit" option, you're added in to a bandit-friendly faction so they don't attack you when you start the game. Let's say I wanted to roleplay that, and stay a bandit. Arguably impossible to get very far in the game like that, but certainly possible to be a bandit and get enslaved to a warlock, for example. If SD+ suddenly glitches out and now I'm stuck as a friend to all warlocks forever, having a mod that resets that would be great... but if it also sets my bandit status to not-friendly, that'd be bad.


You could try to make it individual - EDIT: Derp, that's exactly what you were saying. Yep. like have an MCM with different options for each faction, so I can reset warlock faction status but not bandit faction status - but then that might also interfere with other mods. Say there's a mod where part of the storyline makes you friendly to warlocks. You also want to stay friendly to bandits for role-play purposes. Then you're stuck.


Or, how about OBIS? Doesn't OBIS (caveat - I haven't played it) add in several different bandit factions? And if you're enslaved to an OBIS master with SD+, hitting the "bandit" reset button won't fix that, because it's not actually a vanilla bandit faction. So you'll have to make a version of your mod that depends on OBIS, so you can reset those factions.


It might be easier to make an SD+ plugin, actually. Make it so that whenever the player is enslaved, you add in a script that remembers what faction the player is enslaved to, and then your reset button will only remove from that faction. It's not much different from using console commands, but it's certainly easier on the player, and it automatically takes care of things like getting enslaved to non-vanilla factions.


I'm not sure how easy such a thing would be to do, or how well it would work, but it's an idea...

Link to comment

It is unfortunately not that easy.


When you are enslaved by SD+, you are not enslaved to 'a faction' - you are enslaved to 'all the factions your master is part of'. There is no way to tell which faction is more relevant between BanditFaction and CrimeEastmarch faction for example.


One thing I am considering  adding to SD+ is to rewrite the faction system and keep a list of differences between the player factions and the master factions - new faction to the player in fact.


That would make it easier to 1) list new factions the player joined during enslavement, 2) clear them individually if needed 3) select which faction to actually join at the end and 4) add some timer to make joined factions expire after a while.


If you want to take a stab at it while I am finishing the Sisterhood of Dibella, the code to change is here:




I am thinking of keeping the current functions as the main API if possible and just rewrite the guts of these functions for a start.


Edit: What makes things difficult is that you end up joining all factions from your master when you are enslaved.


That means one would have to sort out new factions joined as opposed to factions the player is already part of (especially when enslaved by a friendly follower).


And then there is the problem of what to do when the player joins a new faction from enslavement and while still enslaved, joins that faction again as part of a quest.


For example, if you are enslaved by someone from the Legion and then become a Legionnaire yourself while still enslaved.


I think it would have to be a whole new MCM panel, which lists all NEW factions you joined during enslavement, with a 'leave faction' button for each one of them (and possibly a timer value too).

Link to comment

Ugh. Certainly doable, I guess, but a lot of work.


Hmm... also, I wonder if you'd run out of space on the MCM page. I think you can only have 128 entries (?might be 256, can't recall) on a single menu? That means you're limited to 64 actual entries (64 factions and 64 buttons).


Now, 64 is a sizeable number when you think about all the playable factions you can join... but how many factions is the player actually a member of? Or can join, either through quests or through mods like SD+? So if I'm a member of, say, 4 playable factions, and maybe a half-dozen hidden factions (wild guess) and another half-dozen factions my master belongs to, that'd be perfectly fine... but some NPCs are members of a whole bunch of factions.


Just looked up a random NPC - Aela is a member of ten hidden factions on her own. Now add in a bandit friendly faction for SD+, plus player factions, their associated factions, and all mod-added or mod-altered factions, and it's distantly possible to run up against that 64 limit. Probably not, and even there I'm not sure if it'd be a problem at all... but I'm not sure how the MCM API would handle trying to add in more options than there is space.


A minor possible issue...

Link to comment


Aren't you sorry you asked? :)


CK editor is such a fun journey...


I began reading your source script that you shared. I understand what it does by reading it, but I don't understand the structure (no script experience). I fail to understand the use of things like spaces, parentheses, underscores, periods, etc. I also can't keep track of what kinds of "terms" to use for each situation.


It seems like there are no sources to "define" each of these terms and give a short explanation of how to use each of them for even basic purposes.

Link to comment

Ok. I need to revisit this. I have two things happening (three, if you count the third thing): number one, I went back and read skyrimll's scripts that he shared earlier in this blog discussion. As a result, something just clicked, and suddenly I found myself somewhat understanding how to put scripts together. Second, as soon as I go to sleep shortly, I'll forget, and several months will pass before I bigin to understand again, and then I'll forget again, and third, fuck! I forgot! i hate being me.


Oh yeah! about ta script that fixes the possible faction issues... Why not write a script that writes to Jcontainers the information regarding which factions the player joins during a DA or Defeat encounter. Another script then can be executed, probably in the MCM, to run a check of the stored information and in turn, can remove the player from all of those factions. At the end of this script execution, the Jcontainer information regarding those factions can be "erased."


Is this realistic? Am I going for a swim in a desert here?

Link to comment
  • Create New...