ref walking in skyrim

Post » Sat Aug 06, 2016 10:01 am

Between the standard papyrus functions and SKSE, is ref walking still a viable approach to filling a form list of NPC's in a certain area? I did some scripting for NV and want to work on a simple bug fix. Apparently when the engine detects an NPC with a non existent formid (like a combat package for instance), it crashes. I would like to work with the guy who made skyrim crash plugins and write a relatively simple refwalking script that can be called by his SKSE plugin that will scan the area for NPCs and fill a formlist with combat packages, then go through these packages and run a check to confirm all combat packages are valid. If they are not I would like to dynamically assign a combat package based on NPC type, area, level, etc. I'm hoping that if this is done correctly it can avoid CTD causes by non existent formids.


Does anyone have a relatively simple refwalking script example currently in use in skyrim, or can point me in the right direction?


thanks!

User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am

Post » Sat Aug 06, 2016 10:35 am

Technically walking reference in a cell using SKSE script functions can work in Skyrim, but you don't want to do it. It's slow and inefficient. Papyrus doesn't work like the previous scripting system. With Skyrim it would be better to create a quest with a set of Aliases set to fill with nearby NPCs on startup. Then have the story manager fire off the quest on location change or some other condition of your choosing. In the quest script's OnInit function you can cycle through its aliases.



But there are no script functions to get or set combat packages. In fact, dynamically assigning AI packages of any type can't be done other than overriding it with one using an alias. So to do this you need an SKSE plugin and if you're going to do that you probably want to just duplicate the logic that does the NPC ref walking, look for bad packages, and fix them up all in the plugin without Papyrus being involved.



More importantly the only reason a combat package would be invalid is that someone edited a plugin using something other than the CK and broke the packages. Frankly identifying the broken mods and getting them fixed would be a much better and easier solution to this problem.

User avatar
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Post » Sat Aug 06, 2016 4:02 am

this is the error I get from the crash fix plugin which works wonders btw:


31 Jul 00:55:19 Game has crashed due to actor missing TESCombatStyle form. The actor reference ID was 0x5400F63A and base ID was 0xFF003888.


Now people discouraged me from using a ref walking script in NV for the same reason, it would be inefficient and present possible memory leak issues, yet when I wrote the script for playable fallout mech I used a pretty standard ref walking script with a few custom functions I wrote, and when I turned log mode on I noticed nothing to suggest it was inefficient or causing slowdown or excessive strain on the engine.


Thanks for the informative reply cdcooley, I'll definitely look into your approach. I'm surprised that SKSE doesn't have a explicit function to get, dynamically create/assign combat packages to NPCs. If the framework is as extensive as NVSE I can't help but hope their is a creative work around possible.

User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm

Post » Sat Aug 06, 2016 9:41 am

With Skyrim they changed the approach to managing packages. You now add packages to NPCs by assigning the packages to an alias and then filling the alias with the NPC. If multiple aliases hold the same character the Quest priorities will determine which packages get used. Overall it's a very elegant system but when they added it they also completely removed any ability to manipulate the package list and NPC uses from script like we could do in the earlier games. And when I say ref walking in Skyrim is inefficient I mean even more so than the scripting for earlier games. Papyrus is a whole new beast and trying to port over old scripting solutions has proven to be a bad idea in more than one case.

User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm


Return to V - Skyrim