Scripting assistance for Increased Spawns

Post » Mon Jun 18, 2012 3:49 pm

So, this new language has me quite confused after all the programming I've been doing in java.. Much less user-friendly.

Anyways, so my goals are as follows;

Prep) Use a java program to scan and duplicate specific NPC's, and attach the script to the original NPC's in order to avoid a feedback loop on the spawns.
1) Access the NPC OnLoad()
2) Calculate probabilities (I can do this part fine)
2) Do a placeatme on the original NPC of the duplicated NPC

The problem being not so much the code (though I must say I'm confused by the code and could benefit from some examples), but how can I work the code to be less specific? I don't want to define a specific property for every NPC, as this should ideally be done dynamically when the patch is ran. How can I use the properties for this? In Oblivion, I would have defined the duplicated NPC with a name based on data from the original - the name being the formID, for example, and then linking the script in to the formID name.

For the record, I can edit any of the duplicated NPC's if they should be edited in any way (including editor ID, name, factions, etc).

Any help with this? Any ideas on how to link the two NPC's?
User avatar
Je suis
 
Posts: 3350
Joined: Sat Mar 17, 2007 7:44 pm

Post » Mon Jun 18, 2012 10:40 am

Heh, I'm still learning the language too (though I'm trying not to mod *shakes first at tasty new features*)

I'm not sure properties can be dynamically allocated after runtime, I presume it's saving how the properties are filled in the .esp, and they will always be linking to records already.

However, at least it does seem this can be solved without hundreds of scripts like with FO3. For eg, if it's not too much work to populate a form list, you can use a script with a while loop to walk through the list, retrieve the record and place the alternative spawn. Could be a nice short script, just need the form list of, well, every NPC and/or creature record in it. But this could at least be easily appended to add records from other mods (like CorePC's creatures). I'm sure there's other options, though, haven't given it that much thought.

When SkyProc is used to duplicate NPCs, how are the new reocords stored? Haven't read up on Skyproc yet.
User avatar
Monika Fiolek
 
Posts: 3472
Joined: Tue Jun 20, 2006 6:57 pm

Post » Mon Jun 18, 2012 4:20 pm

http://www.uesp.net/wiki/Tes5Mod:SkyProc

Here's a link to SkyProc. The VMAD subrecord is here -> http://www.uesp.net/wiki/Tes5Mod:Mod_File_Format/VMAD_Field

SkyProc reads in the binary data of the plugins, parses it, and passes it along to functions to use and manipulate. So it parses in an NPC, then the data could be manipulated inside SkyProc - can easily change the float for size, add a spell form, perks, anything that's needed, and then it'll export the NPC. In this case, since the VMAD has properties stored, if it's possible to change the script reference inside the compiled script, that approach could be taken inside SkyProc.

Using the form list could be an approach, skyproc could be used to run through and assign creatures to a form list automatically, but it'd take a lot of basic checks against names, which starts getting unreliable as more get added (generally because modders may not keep to a certain naming pattern, like Bethesda).

Regarding a form list - would it be possible to have a form list with every creature on it, have the script link to that form list, and then include checks inside the script to only spawn those relating to the original spawn? An example:

Form list contains every creature.
Creature spawns, increased spawns script activates.
Increased spawns list takes some unique property, loops through the form list until a form matches that property.
Spawn is placed.

My gut feeling is that while that may be possible, it'd be too intensive on the loop even if only the entries with 'Lvl' were included (hundreds of those). Then again, modern processing power has surprised me, too. Not sure what unique property could be used, either.

Off-topic: You're not going to be able to entirely give up modding. ;) I don't think it quite works that way. One of those things that gets ingrained in you.. Reminds me of Inception and how manipulating a world can be addictive.
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Mon Jun 18, 2012 2:41 pm

This ended up -way- down on the pages, so I'll give it a bump to see if anyone has some input.
User avatar
Sasha Brown
 
Posts: 3426
Joined: Sat Jan 20, 2007 4:46 pm

Post » Mon Jun 18, 2012 3:24 pm

Man. :( Guess I'm gonna be figuring this one out on my lonesome? Figures. :P
User avatar
Joie Perez
 
Posts: 3410
Joined: Fri Sep 15, 2006 3:25 pm


Return to V - Skyrim