markyrocks Posted October 4, 2018 Share Posted October 4, 2018 So I've been working on a mod for awhile as some of you probably know. Due to various reasons I was forced to make alot of forms. Around 750. B4 I did this I looked into plugin file size limits ect. I wasn't able to find a conclusive answer so let's start there. Is there a limit to the number of forms in a plugin? I only ask bc un the ck wiki it says something about 8bit limit, I'm not sure what that means exactly but it also says that light master files circumvent that limit and allow up to 2000 forms.The 2 things could be completely unrelated I'm not sure but it led me to believe there must be some type of limits. Long story short I made 750 forms on a separate plugin than my main mod. I loaded that plugin and my main mod (as active) declared the forms as variables on a script. I added the plugin with all the forms to my mod load order. Doesn't seem to work. What I mean by that is simply connecting a terminal button to a quest script that just placeactoratme(ActorOnFormPlugin) ect. So I know it should work if it has access to the forms. This is kinda a side question but is there a limit to the length of an if elseif statement? Bc again due to limitations I was forced to make a 2000 line long if elseif statement....gawd, and no I'm not kidding. Ok so I thought maybe I had exceeded the plugin size and maybe it wasn't loading? So I compressed it, and created a .esl from it. I loaded the .esl with my main mod in the ck I reconnected the script I'm using to the .esl so it "sees" the forms, they're all declared ect. Then I added the .esl to my plugin load order for the game and started the game...once I did that its acting like my mod doesn't exist. Smh. So why would this happen? Last but not least, now my mod is dependent on the .esl... that for whatever reason is preventing it from working. I then disconnected the forms from my main mod script. So it had no attachment to the .esl, but it's still dependent. Can someone give me some insight as to what I need to do here? I have backups of my main mod without the dependency on the .esl so I can revert. I'll lose some work but it can reasonably be done. If the issue is using forms from another plugin I can remake the forms on my main mod plugin if necessary.. I dont want to bc it takes some time. Incase anyone is wondering these ridiculous amounts of forms and 2000 line if statements are being done by other programs I wrote so I push a button and it does it by itself. Link to comment Share on other sites More sharing options...
JonathanOstrus Posted October 4, 2018 Share Posted October 4, 2018 I think you might be confusing the terms that are used. The 8bit thing you read is the slot load FormID prefix. The plugin files themselves have a limit of FormID's from 0x800 - 0xFFFFFF (theoretically) That's more than 16M records (or new forms). It's unlikely the game would be able to actually handle that, let alone CreationKit to make it. Though plugins have been known and proven to have more than 200,000 records and work fine. There's a limit on the number of form prefixes, also sometimes called load order slots. Each plugin file (including the base game .esm) takes one. These are the first 2 HEX values you'll see from time to time on the 8 character FormIDs. The main game file takes 00, then DLCs fit in 01-however many DLC there are. Then the rest of your mod .esm, then .esl files (Light Masters - special exceptions), followed by your .esp files. With Fallout 4 and Skyrim SE the FE slot is reserved for Light Masters. The FF slot has always been reserved for dynamic spawn references. So all the plugins have to fit within the 01-FD, or 01-253 slots for the decimal preferred notation. Since Skyrim has an Update.esm that leaves 02-253 for DLC and 3rd party mods on that game. Light Masters (.esl files), or .esp files flagged with the ESL header, will fit into the FE load slot. These files require fitting a special criteria. They must have no more than 2048 new form records within the plugin file. The new record FormIDs must be between 0x800 and 0xFFF. If you make override forms within your plugin, these do not count towards the 2048 new form limit. If the file is named with a .esl it will forcibly be loaded with the ESM block before any .esp files. The game treats it as a file flagged with ESM even if the file on disk does not have it. These files should never have a .esp as a master. You can use a .esp with the ESL flag in the file header, provided that it meets the Light Master criteria. This has a benefit of allowing you to sort the .esp in the load order to facilitate proper overrides or master it to .esp files if you're so inclined to jump through the necessary hoops for that. This assumes you have a mod manager that knows how to deal with that correctly. Now, that said so hopefully the confusion around Light Masters is out of the way. I'm having trouble understanding what it is you did, or were trying to do. I get that you have a main mod. Is it a .esp or a .esm?You made a second plugin that used your main file as a master? Again, the main plugin a .esp or .esm? If it was a .esp, when you saved your second file the master that was a .esp would have been removed. This is a known bug in Fallout 4 CK v1.10.15 (the one that supports Light Masters) where .esp masters are removed upon save. Even if they have an ESM flag in the file. That version of the CK doesn't care and will remove it period. The work around is a pain. If you have a backup copy of an earlier CreationKit.exe file you can use it to do your editing with a .esp master as long as it has the proper ESM header flag. You made a mention of loading both plugin files and setting your main mod as active? This makes me presume the main file was a .esp. From the sound of it so was the secondary file. Which leads me back to the issue I just mentioned. After saving that any references to the other .esp will be removed and corrupted as "Null" values on your newly saved active file. To help any more on this you'd need to post the plugin files so experienced people can look at the internals and see what's going on there. Preferably a pack of the before you tried to link them and the attempt with the .esl one. It sounds like the .esl method might be the best end result. But we'd need to look at what it is you're trying to do. The whole idea of this 2000 line if/elseif chain horrifies me. Are you absolutely sure there's no other way to do whatever it is you're trying to do? Link to comment Share on other sites More sharing options...
pra Posted October 4, 2018 Share Posted October 4, 2018 (edited) Okay, what the hell are you even trying to do?? I'm not sure I understood everything, but I try to answer what I understood. First of all, 750 forms are well below any limit. This shouldn't cause a problem in any case.Why are you separating this into two plugins? Second: an ESP cannot be made dependent on another ESP by using the CK. That means, if you are editing a.esp and want it to refer to forms from b.esp, it won't work. ESPs can depend on ESLs and ESMs, though.It can be done using xEdit, though, but it's somewhat tricky. Third: this thing with 750 forms and if/elses sounds like a horrible idea in any case. There must be a better way to do, whatever you are trying to accomplish. Can't you make a formlist where you just put all those records into, and then just loop through that in any other plugin which needs it? Edit: you can also obtain a form from another plugin script-wise:https://www.creationkit.com/fallout4/index.php?title=GetFormFromFile_-_Game Edited October 4, 2018 by pra Link to comment Share on other sites More sharing options...
markyrocks Posted October 4, 2018 Author Share Posted October 4, 2018 (edited) My main mod is just a .esp literally all that is on the other file is forms. I'm probably going to just remake all the forms onto my main mod plugin. If everyone is saying that's legit then why make it overly complicated. The point of all this is I'm attempting to mimic the robot workbench in vr and apparently the creation of custom handy type robots is handled by native code. Since I have no access to that and no other reasonable way to do what I want this is the brute force method. I was looking at like 5000 forms originally but narrowed it down to 750. I feel like that's enough variety. I have it setup with 3 quests. You select a button in a terminal it sets a quest stage. Those stages correspond to a selected group of parts, paint or weapons. They also correspond with the naming scheme of my forms. I've tried using a formlist. Other methods ect. The main problem is converting the information I have to the relevant result. I didn't spend a whole lot of time fighting it bc I knew I could easily make my 2000 line if statement. I'd love to give Actorbase property handyAT0P0WLWR0 auto constInt pstage=quest.getstage()Int wstage= ectInt astage= ectString="handyAT" + astage + "P" + pstage + "WLWR" + wstage Game.getplayer().placeactoratme(string) That says type mismatch ect... if you try to cast as a actorbase it says they're incompatible...I understand why. Edit. I'm thinking maybe if I put the form variables in a struct could I access them by. Struct mystructhandyAT0P0WLWR0endstruct ;use the above method to get string Game.getplayer().placeactoratme(mystruct.string) ? Edited October 4, 2018 by markyrocks Link to comment Share on other sites More sharing options...
pra Posted October 4, 2018 Share Posted October 4, 2018 Are you trying to construct an editorID, and then use that to summon the object which has that editorID? Yeah, that won't work.The Editor IDs don't really matter once the game is running, it's all formIDs. If I understand it correctly, you just made 750 different robots, and want to spawn them depending on what the player selects? I'm sure there are better ways of emulating the robot workbench. It should be possible to attach the OMODs to the robot via script:https://www.creationkit.com/fallout4/index.php?title=AttachMod_-_ObjectReferenceThis even uses attaching mods to robots as an example. I would do something like:Make the player select the race first. That is, Protectron, Mr. Handy, Sentry Bot, Robobrain. Have for each of these 4 have a base bot.Then make the player select the OMODs somehow. Not sure what the best way would be. Save the OMODs to an array.Then do:ObjectReference newRobot = Game.GetPlayer().placeAtMe(theSelectedBasebotType)int i=0while(i<arrayOfMods.length)newRobot.attachMod(arrayOfMods)i++endwhile Link to comment Share on other sites More sharing options...
markyrocks Posted October 4, 2018 Author Share Posted October 4, 2018 (edited) I appreciate the input but 3 arm handy robots dont work that way. At least not in the vr version of the game. Any modification to a 3 arm handy for whatever reason breaks it. Trust me I've explored many avenues to get to this point. That's the most frustrating part is I have all the other robot types working in a similar way that you describe. The 3 arm handy specifically when any mod is attached to it in game it automatically loses left and right eyes and arms. Basically like its expecting arms other robot type arms in the eye sockets. Edit this is all kinda the reason I remained vague when talking about all this initially bc I didn't really want to get into the why of what I'm trying to do bc I wanted to focus on the file related issues. I've spent 100s of hours working on this so again if there was any other way I would have found it by now. Edited October 4, 2018 by markyrocks Link to comment Share on other sites More sharing options...
markyrocks Posted October 4, 2018 Author Share Posted October 4, 2018 (edited) Ok so moving on. So imagine I have a plugin with just files that i wanted another plugin to be able to access. What would be the procedure to make the .esl and have the other plugin access the forms? I realize there is the one function call that was already mentioned that was like getformfromfile or something. Can I not just use those forms like I would from any other master? Edit. I was able to remove the dependency from the .esl I had made. Everything works as it did b4. Which is great but now I guess I have to make these forms again... Edited October 4, 2018 by markyrocks Link to comment Share on other sites More sharing options...
markyrocks Posted October 5, 2018 Author Share Posted October 5, 2018 Just to update this. I have a sneaking suspicion fo4vr probably doesn't support .esl. it's not even supported by the ck for that matter. When I had tried using the .esl it actually for whatever weird reason made it so when I was trying to load a game it added an extra step. Normally I'd hit load, find the save select it then confirm. With the esl I'd have to do all that and click again...weird. I've found all kinds of broken stuff in regards to the automatron dlc and fo4vr so none of this is surprising Link to comment Share on other sites More sharing options...
Recommended Posts