So this past week I have been helping a server with simple bugs and such and something dawned on me. I don't use the base packs you all do. So I installed the packs that have apparently been modded a good bit since I left the last time... and lo and behold... a lot of issues. Okay, so the biggest part of this could come down to something I am fiddling with at the moment. Sphere loads with an Order of Operations. This is called from SphereTables.scp. Now, the person who messed up this order won't be called out, but things are not loading in the proper order as the hard code would like it. This in turn could be causing possible exceptions.
People do not realize how important it is to have this table right. Even where they tell you to add custom code is wrong. You need to do it in proper orders, which I am still fiddling with. Since some things have dependencies on things people don't expect.
Anyone willing to help try to give this some rational sense, please pipe in and let me know if this order is making issues for you. So far it is working a lot better on two servers for people. The old SphereTables.scp from Pre-Releases is similar to this structure, whereas Nightlies ARE NOT. If you use Nightlies, try to match this.
You can see where things SHOULD be. So if you have relational code, please place it UNDER the core code for that type of code
This is what I have come up with so far with no current issues at the moment. Please note I added in all the missing [TEMPLATE] scripts at the end. They were loading with 'Scripts/' which severely breaks their loading operations.
Code:
[RESOURCES]
// sphere.ini and spheretable.scp are automatic.
// All the other scripts we want to load.
scripts/sphere_defs.scp // SHOULD LOAD FIRST.
scripts/sphere_types.scp // SECOND. Terrain types are important.
scripts/sphere_events_human.scp // We process Event triggers here. Please put custom event/typedef triggers in this area.
scripts/sphere_events_npcs.scp
scripts/sphere_backward_compatibility.scp // We should process this after types and defs just in case.
scripts/sphere_admin.scp // Elevate or decrease importance? Hierarchy needed?
scripts/sphere_dialog.scp // Elevate or decrease importance? Hierarchy needed?
scripts/sphere_menu.scp // Elevate or decrease importance? Hierarchy needed?
scripts/sphere_serv_triggers.scp // Server dependent functions. This probably should be a priority script.
scripts/sphere_add_sqlite.scp // Dependency if you are using it.
scripts/sphere_skills.scp // Definitions with no Items attached. (Move up?)
scripts/sphere_skillmenu.scp // This should follow skills honesty.
scripts/sphere_newb.scp // Technically a resource.
scripts/sphere_book.scp // Only top if using the MOD/Scroll blocks. (Sounds right.)
scripts/sphere_name.scp // Might be able to move this to the bottom of operations.
scripts/sphere_speech.scp // Might be able to move this to the bottom of operations.
// Items And Npcs. NPC's loaded after items due to Dependencies.
// Must be loaded in this order. Please place your custom items after the scripts/items/
// Follow the same logics for scripts/npcs/
scripts/items/
scripts/npcs/
// Maps //
// Make sure regions are loaded before any map.
// Note: Still some odd issues defining [RegionType]; This needs to be looked into. Moving sphere_Defs.scp NEEDSTOFIX r_* t_Junk caused some odd errors
// with r_civilization and such. It was issues with Npcs though. Maybe NPC's actually should load AFTER maps? Need to double check now the order of
// operations is (hopefully) set in the right order. If not, new defines being called by creatures should give consideration to move down Mobiles in hierarchy.
scripts/sphere_region.scp
scripts/maps/sphere_map0.scp
scripts/maps/sphere_map0_ml.scp
scripts/maps/sphere_map1.scp
scripts/maps/sphere_map2.scp
scripts/maps/sphere_map3.scp
scripts/maps/sphere_map4.scp
scripts/maps/sphere_map5.scp
scripts/maps/sphere_map_points0.scp
scripts/maps/sphere_map_points0_ml.scp
scripts/maps/sphere_map_points1.scp
scripts/maps/sphere_map_points2.scp
scripts/maps/sphere_map_points3.scp
scripts/maps/sphere_map_points4.scp
scripts/maps/sphere_map_points5.scp
// Dependent on CharDef and ItemDef being loaded prior. So load these aafter those files.
scripts/sphere_spells.scp
scripts/sphere_spawns.scp
scripts/stones/
scripts/stones/guilds/
scripts/stones/towns/
// Speech Files
scripts/speech/
// These are getting changed. Most of these were not even put in here and they NEED to be.
// If you add any [TEMPLATE ] files through a custom script, put them in these files or a custom one and PUT IT IN THIS BLOCK.
// It was missing 5 of these, which will load when scripts/ loads. Breaking order of operations/Hierarchy/dependencies.
// Templates //
scripts/sphere_template.scp
scripts/sphere_template_loot.scp
scripts/sphere_template_vend.scp
scripts/sphere_template_armor.scp
scripts/sphere_template_weapons.scp
scripts/sphere_template_sets.scp
scripts/sphere_template_misc.scp
scripts/sphere_template_magic.scp
Note: With backwards compat. If you do not need it, remove it. It is memory consuming and as heavily edited as it is, if you are not using the definitions from changes, you should do that as soon as possible. This is only supplied for a temp fix. The bigger this file gets, the more memory it consumes. Change it all as soon as possible.