Its a derived class inheriting from Subworld. You create one by inheriting from it in normal C# fashionApologies for my lack of understanding, but I can't even begin to grasp what's being said here.
What's a subclass? Where do I find or create a subclass? What does SubworldName.<subworld class name> mean?
I'm not very technical minded so all of this soars way past my understanding, and while I see valiant attempts to document and describe the mod here, I think it needs to be clarified and dumbed down so the less technical minded like us have a chance at using this mod
If someone has the time, making a video covering this and how to set up a Subworld would help tremendously! I'm more of a visual learner so watching someone go step by step would make the process a breeze
Where do I define or specify or create the Subworlds? In which file or folder?Its a derived class inheriting from Subworld. You create one by inheriting from it in normal C# fashion
Then its specified that the localization key is SubworldName.<subworld class name>, so a hell subworld; Hell.HellSubworld, its most likely automatic.
I'm running a medium sized public server and this would be an amazing mod! Being able to run multiple server instances on different ports and switch between them seamlessly in game is a dream. Would allow servers to make use of more of its cores.Have you thought about switching the IL for spooled TCP instances to handle seamless client travel?
Seems like a nice mod for 1 or 2 players but for a grander application it'd be more ideal to have map servers (MMO architecture) and persistency is saved per map instance, say you have a server of like 6 people - this number is somewhat possible with friends so switching worlds might be an agreed vote but for some randoms in a public server people may decline the vote somewhat ruining the experience for the other people, so 3/6 can travel to 7778 for example and the rest can stay on 7777, or even more they might even go to like 7780 for a different world.
For the enemy spawns, i've attempted every combination possible to disable the spawn pool and enable a custom, but still can't figure it out. Any pointers?Damn, I loved this library. I made this mod create a Tungsten Brick world, and managed to enter and leave It without problems.
I'll try seeing if I can play more with this. Thanks John for such an amazing mod.
Edit:. Oh yeah, It will be a good idea to allow modifying the spawns from the subworld, directly from their class.
That way people can even set custom npc spawns inside the world file, instead of specifying if the subworld is active on the GlobalNpc script, before changing the spawns.
Edit2:. And I found a little bug after entering and leaving the world several times, where my character returned to the original world, falling from the upper left part of the world
Custom ModWorld comes to mind. Or create some kind of hook on your mod's modworld to change the custom spawns based on whatever the subworld you are.For the enemy spawns, i've attempted every combination possible to disable the spawn pool and enable a custom, but still can't figure it out. Any pointers?
Can't simply clear the list before adding the custom monsters?I would suggest how I did it, but mine involves a delegate field that allowed easy random npc customization so... Not a good example.
You need to use EditSpawnPool and set EVERY npc's (loop through all existing npc types, I like to use an array that will be resized to match this count, like Main.NPCTexture.length) spawn chance to 0, then set the NPCs you want to spawn.
you do, by running a forloop with EVERY npc type. Yeah this part of TML (and Terraria) is pretty gross in how it works if you want to override the entire spawn pool.Can't simply clear the list before adding the custom monsters?
that works.Or, could use pool.Clear();
I used It on my leveling mod's graveyard biome, It actually works.
View attachment 328490
I actually don't play tModLoader with mods that adds new npcs and stuffs, so I didn't noticed that problem yet of monsters falling from the sky, but the tModLoader devs could have at least added a flag to check if there's ground under the monster. Beside the modders could check themselves if there's floor under the spawn tile (If the spawn tile isn't actually the solid tile).
Beside, I found this variable here on NPCSpawnInfo: "spawnTileType", I have no idea what is It for, though. Maybe It tells if the tile is solid or not?