Detecting Skill Levelup

Post » Mon Aug 03, 2015 3:07 pm

I need this for my (pretty lean) MWSE alternative leveling mod. While my current system (grabbing all of the player's base attributes every 60 frames, comparing them to ones in an array and ignoring increases of over two) works, it's rather unwieldy and cannot be ran every frame because that'd mean running a god-knows-many step while loop every frame. I was thinking of instead triggering the system with GetSoundPlaying "skillraise" but I haven't had any luck with it. I heard that Hrnchamd apparently made a MCP fix that let GetSoundPlaying pick up interface sounds but I haven't seen it anywhere.

Does anyone have some helpful information or alternative methods?

User avatar
Sun of Sammy
 
Posts: 3442
Joined: Mon Oct 22, 2007 3:38 pm

Post » Mon Aug 03, 2015 6:36 pm

You won't be able to detect skillraise as it doesn't originate from the player. MCP fixed a couple of those sounds, but not this one, so that's out of the question. I think this usually ends up being the issue with "lightweight" character systems in MW, there's not really any "lightweight" way to do it other than just settling for GMST alterations. So by the time the modder implements a system that can handle all the various skills it no longer qualifies as "lightweight" anymore. :D

If you're just worried about performance, you shouldn't need to constantly monitor all of the skills. Many of them require specific (detectable) menus/states/etc to be in progress, so that should let you filter out some of the excess. I guess in the end if you really want the mod to run as smoothly as possible you'll need to go in and examine each skill and figure out how and when its best to monitor each one.

I haven't really tinkered with the new character functions all that much though. sveng might know of some better alternatives as he's been working on a character developement mod for awhile now.

User avatar
Sammie LM
 
Posts: 3424
Joined: Thu Nov 30, 2006 1:59 pm

Post » Mon Aug 03, 2015 2:44 pm

Well, the xGetBaseSkill function made a whole truckload of the coding to deal with fortified/drained skills unnecessary, and MCP's uncappers made ModStat an elegant solution too so you don't have to worry about those same issues when using setstat. i'd say it's pretty lean considering it runs in 3 scripts and a savegame load detector.

Unfortunately I don't think it is possible to achieve any real FPS gain because it's not possible to detect the player paying a trainer - the skill gain happens in Menumode 0 and the only way to detect players using the training service to begin with is by MCP's new capabilities for filtering training refusal. I did look into skills trained specially (my system would otherwise nullify your alchemy, speechcraft, mercantile or armorer gains if you got more than 2 levels in the interface) so I could add exceptions but the vast majority of skills are combat, movement and magic skills trained in the overworld so an optimization wouldn't even be that effective.

User avatar
Jonathan Windmon
 
Posts: 3410
Joined: Wed Oct 10, 2007 12:23 pm

Post » Mon Aug 03, 2015 8:36 pm

Well I guess there are some small optimization possiblities. You can't level a weapon skill without GetWeaponDrawn or any of the magic schools without the approriate xGetMagic. Sneak only needs to be monitored while GetPCSneaking, etc. You could probably detect training via MenuMode, xGetPCTarget, xIsTrainer, xGetGold. The service refusal filters also open a lot of possiblities.

User avatar
chirsty aggas
 
Posts: 3396
Joined: Wed Oct 04, 2006 9:23 am


Return to III - Morrowind