Jump to content

Recommended Posts

Q1. What are the difference/rules about specifying assets in modmain.lua

 

Assets = {

Asset("IMAGE", "images/saveslot_portraits/mychar.text"),

...

}

 

and mychar.lua

 

local assets = {

Asset("ANIM", "anim/player_basic.zip"),

...

Asset("ANIM", "anim/mychar.zip"),

Asset("ANIM", "anim/ghost_mychar_build.zip"),

}

 

and mysword.lua

 

local assets = {

Asset("ANIM", "anim/mysword.zip"),

Asset("ANIM", "anim/swap_mysword.zip"),

Asset("IMAGE", "images/inventoryimages/mysword.tex"),

Asset("ATLAS", "images/inventoryimages/mysword.xml"),

}

 

?

 

Q2. What is "ANIM", what is "IMAGE" and what is "ATLAS"?

Q3. To be visible in minimap as minimap icon, do we put that asset in modmain.lua?

A3: Yes, put both .tex and .xml... and also don't forget AddMinimapAtlas("images/map_icons/mysword.xml")

 

Thanks.

Edited by SenL

@SenL, Assets that you need to have loaded before the entity is created should be in the modmain. You may need to load your inventoryitem assets in the modmain if you're using them for the recipe tile, for example. Bigportrait and saveslot portraits need to be loaded before the character is created, as well, so those should be in the modmain. Most other things you can have in the prefabs.

 

ANIM = an anim zip

IMAGE = a tex

ATLAS = xml

Technically an atlas specifies a list of images, which may be regions of a single tex (that's how inventoryitems.xml and inventoryitems.tex work). The regions are referred to by new tex names that are specified in the atlas, but don't actually exist as separate tex files.

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