Jump to content

Help With Editing a Mod for Compatibility


Recommended Posts

I've been trying to edit an SE port of the Shadow Merchant mod for compatibility with the Skyrim Souls RE mod. The former summons a merchant to you and the latter keeps the menus from pausing the game. However, on entering the trade menu with the merchant his OnEffectFinish function triggers because (and I'm speculating a bit here) it senses that you're done trading. It's worth noting that I tested these two mods on both Enderal SE and Skyrim SE without any other mods active. Shadow Merchant works fine if the menu pauses like normal in both and he only ends the effect and teleports away when you enter the Barter menu specifically with him (holding on the dialogue menu won't get rid of him and entering any other menu with other NPCs won't either). I even tried with clean installs of both mods (not applying any changes I made to his duration and inventory and got the exact same issue. I've been trying to fix this but unfortunately it's scripted in. I had to unpack the .bsa and then extracted the .psc files from the .pex files so I could edit the source. I placed the files where they needed to go, updated the CK .ini to target the correct directories, but I'm running into an issue with both of my potential solutions. This is the code:

 

 

;-- Properties --------------------------------------
idle property tIdleFly auto
globalvariable property tTeleportation auto
visualeffect property tEffectVisual auto
sound property tEffectSound2 auto
actor property tSelfRef auto
objectreference property tMarkerPosition auto
actor property tPlayerRef auto
objectreference property tCont02Ref auto
objectreference property tMarkerBase auto
sound property tEffectSound auto
visualeffect property tEffectVisual2 auto
objectreference property tCont01Ref auto

;-- Variables ---------------------------------------

;-- Functions ---------------------------------------

function OnEffectStart(actor Target, actor Caster)

	Float aRotation = tPlayerRef.GetAngleZ()
	Float dist = 128.000
	Float x = dist * math.sin(aRotation)
	Float y = dist * math.cos(aRotation)
	tMarkerPosition.MoveTo(tPlayerRef as objectreference, 0.000000, 0.000000, 0.000000, true)
	tMarkerPosition.SetPosition(tPlayerRef.GetPositionX() + x, tPlayerRef.GetPositionY() + y, tPlayerRef.GetPositionZ())
	tTeleportation.SetValue(1 as Float)
	tSelfRef.MoveTo(tMarkerPosition, 0.000000, 0.000000, 0.000000, true)
	tSelfRef.Enable(true)
endFunction

; Skipped compiler generated GetState

; Skipped compiler generated GotoState

function OnEffectFinish(actor Target, actor Caster)

	While (Utility.IsInMenuMode())
        	Utility.Wait(0.1)
	EndWhile
	tEffectVisual2.Play(tSelfRef as objectreference, -1.00000, none)
	tEffectSound2.Play(tSelfRef as objectreference)
	utility.Wait(0.500000)
	tSelfRef.Disable(false)
	tSelfRef.MoveTo(tMarkerBase, 0.000000, 0.000000, 0.000000, true)
	tEffectVisual2.Stop(tSelfRef as objectreference)
	tTeleportation.SetValue(0 as Float)
endFunction

 

 

 

My first thought was to edit the script in the source file, adding the "While...EndWhile" code but that didn't have any effect on its own since clearly I'd need to repackage the .bsa with the updated code (assuming of course that the code even does the trick). Pulling it up in CK I can 'Edit Source' for it but can't actually save edits I make within that (only when I edit it using Notepad). Even if I 'Edit Source' and make no changes and just try to 'Save' it spits this back at me in the Compiler Output:

 

 

 

Starting 1 compile threads for 1 files...
Compiling "t_SummSCR"...
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Location.psc(7,50): unknown type locationreftype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Location.psc(10,49): unknown type locationreftype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Location.psc(16,41): unknown type locationreftype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(27,49): unknown type globalvariable
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(28,34): globalvariable is not a known user-defined type
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(28,1): type mismatch on parameter 1 (did you forget a cast?)
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ActorBase.psc(4,15): unknown type class
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(12,66): unknown type globalvariable
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(13,12): globalvariable is not a known user-defined type
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(18,34): globalvariable is not a known user-defined type
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(18,40): cannot compare a none to a float (cast missing or types unrelated)
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(18,40): cannot relatively compare variables to None
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(18,90): globalvariable is not a known user-defined type
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(18,96): cannot compare a none to a float (cast missing or types unrelated)
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(18,96): cannot relatively compare variables to None
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Quest.psc(135,58): unknown type globalvariable
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\LeveledItem.psc(13,24): unknown type globalvariable
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\LeveledItem.psc(14,40): unknown type globalvariable
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(48,15): unknown type light
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(49,24): unknown type light
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(51,22): unknown type effectshader
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(52,35): unknown type effectshader
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(54,22): unknown type effectshader
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(55,39): unknown type effectshader
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(57,20): unknown type projectile
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(58,34): unknown type projectile
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(60,19): unknown type explosion
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(61,32): unknown type explosion
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(72,23): unknown type impactdataset
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(73,40): unknown type impactdataset
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(78,28): unknown type imagespacemodifier
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\MagicEffect.psc(79,45): unknown type imagespacemodifier
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Race.psc(20,19): unknown type voicetype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Race.psc(23,52): unknown type voicetype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ActorBase.psc(55,24): unknown type class
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ActorBase.psc(104,19): unknown type voicetype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ActorBase.psc(105,32): unknown type voicetype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Shout.psc(4,21): unknown type wordofpower
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Shout.psc(8,46): unknown type wordofpower
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(187,17): unknown type package
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Ammo.psc(9,20): unknown type projectile
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Weapon.psc(54,16): unknown type static
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Weapon.psc(55,33): unknown type static
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(307,45): unknown type associationtype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(471,28): unknown type idle
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(474,38): unknown type idle
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(760,29): unknown type package
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(764,30): unknown type package
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Actor.psc(768,27): unknown type package
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Game.psc(176,41): unknown type wordofpower
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Game.psc(251,57): unknown type imagespacemodifier
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Game.psc(257,31): unknown type wordofpower
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\Game.psc(263,32): unknown type wordofpower
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(110,5): unknown type key
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(112,5): type mismatch on parameter 1 (did you forget a cast?)
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(112,29): cannot compare a none to a int (cast missing or types unrelated)
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(113,3): type mismatch on parameter 1 (did you forget a cast?)
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(245,15): unknown type scene
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(269,13): unknown type key
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(368,19): unknown type voicetype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(374,20): unknown type worldspace
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(388,41): unknown type locationreftype
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(465,90): unknown type encounterzone
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(477,45): unknown type impactdataset
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(517,19): unknown type topic
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(670,67): unknown type projectile
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(827,24): unknown type referencealias
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ObjectReference.psc(839,26): unknown type referencealias[]
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ActiveMagicEffect.psc(188,67): unknown type projectile
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ActiveMagicEffect.psc(324,29): unknown type package
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ActiveMagicEffect.psc(328,30): unknown type package
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\ActiveMagicEffect.psc(332,27): unknown type package
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\temp\t_summscr.psc(11,14): unknown type idle
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\temp\t_summscr.psc(12,24): unknown type globalvariable
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\temp\t_summscr.psc(13,22): unknown type visualeffect
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\temp\t_summscr.psc(21,22): unknown type visualeffect
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\temp\t_summscr.psc(36,16): globalvariable is not a known user-defined type
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\temp\t_summscr.psc(50,16): visualeffect is not a known user-defined type
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\temp\t_summscr.psc(55,16): visualeffect is not a known user-defined type
D:\Program Files\Steam Library\steamapps\common\Enderal Special Edition\Data\Scripts\Source\temp\t_summscr.psc(56,16): globalvariable is not a known user-defined type
No output generated for t_SummSCR, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on t_SummSCR


I'm extremely new to this and I'm very much out of my depth, but I've been able to feel my way through so far, but now? I genuinely have no idea what to try next. Unless someone can help me with this (or better yet, apply the fix) I'll probably try to use a third-party compiler to recompile the .bsa using the edited source file and pray it works.

 

Update: On recompiling with the edited code the merchant spawned in missing most of his body and any time I attempted to enter the Barter menu on talking to him I got met with the line "Processing..." before returning to the dialogue menu. I'm at a loss on how adding 3 lines of code in an unrelated script had such drastic results. Back to the drawing board I guess.

 

Update #2: Using the 'placeatme' command on the NPC does not have him teleport away so I attempted to modify the spell to be a Summon Creature spell and not go off the Script, but that didn't work. It must be a script that's causing this but I don't understand what the language means so deducing which script is causing the issue is difficult, to say the least. Names and IDs don't seem to correlate to the effects they're referencing. It's extremely confusing.

Edited by XxDemonSpawnxX
Link to comment
Share on other sites

Update #3: Decided to attempt to inject an if-endIf into the pre-made code and would like to know if I should make any modifications and if so what to change. I'm really hoping this compiles fine and works but it may just be another dead end.

 

 

 

function OnEffectFinish(actor Target, actor Caster)
	if(game.getPlayer().IsInMenuMode())
		;Don't go anywhere until I'm actually done trading with you.
	else
		tEffectVisual2.Play(tSelfRef as objectreference, -1.00000, none)
		tEffectSound2.Play(tSelfRef as objectreference)
		utility.Wait(0.500000)
		tSelfRef.Disable(false)
		tSelfRef.MoveTo(tMarkerBase, 0.000000, 0.000000, 0.000000, true)
		tEffectVisual2.Stop(tSelfRef as objectreference)
		tTeleportation.SetValue(0 as Float)
	endIf
endFunction

 

 

 

Update #4: Thought I could get away with decompiling the .bsa and then adding it back as strictly a Data folder instead of having to recompile, since I ran into issues before doing that. Turns out nope, Even as a Data folder managed by Vortex it still has issues once loaded into the game. Fun.

 

Update #5: Had an 'aha' moment for a split-second. He doesn't disappear on me anymore...or ever. Now the spell won't summon him and it won't get rid of him and when I try opening the script in CK it claims I don't have the source file, even though I saved the source file in the source folder and recompiled it with the .bsa. I feel like I'm running in circles trying to position 2 puzzle pieces that aren't supposed to fit together.

Edited by XxDemonSpawnxX
Link to comment
Share on other sites

Final Update (#6): I did it. I sorted out my CK files. I poured over the script effects. It took a couple days but I managed to do it. Before all this I literally had never so much as glanced at any of this stuff and I basically just jumped into the deep end so I'm taking this win. For anyone who might somehow benefit from my days of misery and frustration, here's what I did that ended up working:

  • I extracted the contents of the .bsa folder using the program BAE.
  • I converted the .pex files into .psc files using the program Champollion (drag the actual .pex file(s) onto the Champollion.exe application).
  • I opened all the .psc files in Notepad++ and searched them for relevant keywords (in my case, my issue was with menus and wait times for utilities, so I searched "menu" and "wait").
  • Once I identified the source of the issue through process of elimination I applied a code fix using a 'While/EndWhile' statement to keep the script waiting as long as I was counted as using a menu.
  • In order to make sure the code saved properly I put both the .pex and the .psc files into the proper places :\Data\Source\Scripts for the .psc and :\Data\Scripts for the .pex (your folders might be different than mine, I don't know).
  • With those files in place I could Edit Source on the code from the Creation Kit using a correctly placed (:\Data) .esp file and was able to compile it and save, then I went and grabbed the code and put them back into the archive that BAE had extracted (be sure to name it Data).
  • Then I used the program Archive in the root folder for SSE (might show up in a Tools folder) to stitch all of the extracted .bsa file parts back together again.
  • I put the new .bsa and the saved .esp back into the folder being managed by Vortex, redeployed the mod, and BAM! It worked!

What an incredible pain. Goodbye people. Thanks for...well, thanks for keeping posts on record for reference.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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