#.GetSpawnedObjects()

15 messages · Page 1 of 1 (latest)

junior jolt
#

This function would return a table of every ModGameObject spawned.

Use Case:
Having certain things happen related to how many or where ModObjects are spawned.
Would make it possible to acces Mod Objects spawned by different mods

floral canopy
#

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?

junior jolt
#

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

floral canopy
#

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

junior jolt
#

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.

teal forge
#

We definitely need the ability to reference content within other installed mods

#

So many scenarios that it would benefit

floral canopy
#

(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

junior jolt
#

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??

deft igloo
floral canopy
teal forge
#

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

junior jolt
floral canopy
#

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