Jump to content

Recommended Posts

How should one use "TheSim:AtlasContains" function? Or how in general check if an image name exists in an atlas?

I don't add images myself, I would like to use the ones from the game, so I eg do:

_G.TheSim:AtlasContains("images/customisation.xml", "berrybush")

in modworldgenmain and also tried in modmain within AddPrefabPostInit, it always returns "false", although:
This image exists in that atlas AND I can use that image without problem when using the modutil functiion "AddCustomizeItem".

So how do I check withing modmain if an atlas image exists? I also tried
local customisation_xml = GLOBAL.resolvefilepath("images/customisation.xml")
but this did not change anything...

edit:
I it needs ".tex", so this will work:

_G.TheSim:AtlasContains("images/customisation.xml", "berrybush.tex")

I did not try that, because AddCustomizeItem does not require the ".tex"...

Edited by Serpens
added solution

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...