#.GetSpawnedObjects()
15 messages · Page 1 of 1 (latest)
For objects spawned by the current mod, you can store them in a table yourself. For objects spawned by other mods, it wouldn't work because mods are run on separate sandboxes and have no knowledge of eachother. What's your usecase for wanting that?
I want to make a mod that looks for certain invisible "checkpoint" objects that i can spawn with my trailmappers map.
The reason why i want it to be seperate from the trailmappers mod is so i can edit and export the map without having to worry about the checkpoint logic being lost
That sounds like an issue on trailmappers' side, it would be better if trailmappers allowed bundling arbitrary code with the loader. Having it as separate mods as detected by the game would mean also having to install and activate 2 separate mods for it to work because there is currently no automatic dependency management, which is bad UX.
Another option would be to write your code on a separate file you add to the data_static folder, and manually modifying the main.lua file to execute your file as well with tm.os.DoFile(). This would only require adding 1-2 lines to the generated loader each time, and trailmappers should never delete the main logic you added
Well the idea was to have the mod be on the workshop. And be seperate so it can be used by anyone on any map(aslong as it spawns the checkpoints) it would be way less user friendly to have to change something on how trailmappers exports your map file for each map you want it to work on, instead of just spawning a few checkpoints in trailmappers.
We definitely need the ability to reference content within other installed mods
So many scenarios that it would benefit
(aslong as it spawns the checkpoints)
then it would break if both mods aren't loaded, it's just better to have it bundled with the mod. Ideally the game would have dependency management and you could just include the mod without having to manually copy paste the code, but that's not a thing atm
it would be way less user friendly to have to change something on how trailmappers exports your map file for each map you want it to work on, instead of just spawning a few checkpoints in trailmappers.
that depends on how it was allowed in trailmappers. If it had a plugin system with support for it, it might be just as easy as installing the "plugin", toggling it on for your map, and spawning the checkpoints
So the solution to trailmakers laking modding api is to hope for other people to improve their way around it? Instead of improving the api??
Our general philosophy has been that mods are not allowed to interact and touch each others things as otherwise weird things can happens when objects are not where you expct them to be and whatnot.
no, even if dependency management was a thing trailmappers would still need to support it to let you add dependencies to your map to extend the code. Having a mod be split as 2 completely independent mods would be a mess in all cases
We do need some way of mods interacting with each other or dependencies or something
Even if it’s for example the ability to save data to the trailmakers documents folder that then all mods can access
I still want the map to completely work without the mod, i just want to be able to acces the mod objects that the map spawns from my seperate mod which can be enabled when you want to race on the map
ideally you should be able to source other installed mods with something similar to tm.os.dofile(), which would make everything be treated as a single mod by the game and avoid issues, but that's a different suggestion