Jump to content

Recommended Posts

I've made a mod for DST that adds purely cosmetic recolours to certain prefabs (for example, several different coloured frog builds, which the game randomly selects). It works fine in DST, but in DS singleplayer I can't omit copies of any of the assets in the anim folder like I could with DST.

Code example:

local assets=
{
	Asset("ANIM", "anim/frog.zip"),
	Asset("ANIM", "anim/frog_build.zip"),
	Asset("ANIM", "anim/frog_2.zip"),
	Asset("ANIM", "anim/frog_3.zip"),
	Asset("ANIM", "anim/frog_4.zip"),
	Asset("ANIM", "anim/frog_5.zip"),
	Asset("ANIM", "anim/frog_yellow_build.zip"),
	Asset("SOUND", "anim/frog.fsb"),
}

Can I change the path of frog, frog_build, frog_yellow_build and frog.fsb to call upon the original assets rather than copies in the mod folder, as these ones haven't been changed?

On 08/11/2016 at 8:19 PM, Mobbstar said:

To load two different assets, to my knowledge, they have to have different names. After all, you are just telling the game to load these.

I don't think you understand my question. I'll try to be clearer.

Say, the frog.lua has these local assets:

    Asset("ANIM", "anim/frog.zip"),
    Asset("ANIM", "anim/frog_build.zip"),
    Asset("ANIM", "anim/frog_yellow_build.zip"),
    Asset("SOUND", "anim/frog.fsb"),

I'm creating texture changes. If I have a modded copy frog.lua and of in the mod folder and some new builds. In DST the game applies the new builds in the modded lua and defaults to reading the game's version of the other files, meaning I don't need to have duplicates in the mod folder.

In single player DS, I get an error if I don't copy the other assets over to the mod folder, even though I've made no changes to them.

I'd like to know if there's a way to change the code in the modded frog.lua to point it to use the game's version of frog.fsb, frog_yellow_build etc instead of unedited copies in the mod's anim folder.

TheSim:GetGameID() == "DST"

This line of code returns true only if the game in question is DST and not DS, so you can then do something like:

if TheSim:GetGameID() == "DST" then
	table.insert( assets, Asset("ANIM", "anim/frog_yellow_build.zip") )
end

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