Jump to content

(Help) How to add a custom minimap icon


Recommended Posts

Assuming you know how to convert images it's easy. The image should have 64x64 in dimension and then you'll want to add in modmain

Assets = {    Asset("IMAGE", "minimap/myicon.tex"),    Asset("ATLAS", "minimap/myicon.xml"),}AddMinimapAtlas("minimap/myicon.xml")

And in the prefab in question you'll add the follwing

local fucntion fn(Sim) --This already exists in some form    --Stuff that was already here    local minimap = inst.entity:AddMiniMapEntity()    minimap:SetIcon( "myicon.tex" )end
Link to comment
Share on other sites

Fantastic! Thanks so much. Im not at my computer and assumed the process would be about that but couldn't test it. Seeing as I wasn't going to be able to till tonight I figured it wouldn't hurt to have someone awesome who knows already confirm things for me. You're the best!

Link to comment
Share on other sites

  • Developer

 

Assuming you know how to convert images it's easy. The image should have 64x64 in dimension and then you'll want to add in modmain

Assets = {    Asset("IMAGE", "minimap/myicon.tex"),    Asset("ATLAS", "minimap/myicon.xml"),}AddMinimapAtlas("minimap/myicon.xml")

And in the prefab in question you'll add the follwing

local fucntion fn(Sim) --This already exists in some form    --Stuff that was already here    local minimap = inst.entity:AddMiniMapEntity()    minimap:SetIcon( "myicon.tex" )end

If you ever want to set one of these up as an example, I'll be happy to post it to the guides thread.

Link to comment
Share on other sites

Hey, I tried this and it gave me an error saying ')' expected near 'searchlite'

Have any idea what I did wrong?

 

I wish I could tell you, but I followed the instructions and it worked perfectly.

 

Did you create the <myicon>.tex and <myicon>.xml files in the minimap folder of your mod?

Link to comment
Share on other sites

I wish I could tell you, but I followed the instructions and it worked perfectly.

 

Did you create the <myicon>.tex and <myicon>.xml files in the minimap folder of your mod?

my post was feb 6th... I've learned alot since then! XD

(in other words I now have a character that has 2 different minimap icons and switches between them when he puts his hat on!!!)

Link to comment
Share on other sites

 

Assuming you know how to convert images it's easy. The image should have 64x64 in dimension and then you'll want to add in modmain

Assets = {    Asset("IMAGE", "minimap/myicon.tex"),    Asset("ATLAS", "minimap/myicon.xml"),}AddMinimapAtlas("minimap/myicon.xml")

And in the prefab in question you'll add the follwing

local fucntion fn(Sim) --This already exists in some form    --Stuff that was already here    local minimap = inst.entity:AddMiniMapEntity()    minimap:SetIcon( "myicon.tex" )end

I did this, but it crashes whenever I select my mod! Can you tell me what I'm doing wrong?

Assets = {

    Asset( "ATLAS", "images/saveslot_portraits/ebsol.xml" ),

    Asset( "IMAGE", "images/saveslot_portraits/ebsol.tex" ),

    

    Asset( "ATLAS", "images/selectscreen_portraits/ebsol.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/ebsol.tex" ),

    

    Asset( "ATLAS", "images/selectscreen_portraits/ebsol_silho.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/ebsol_silho.tex" ),

    

    Asset( "ATLAS", "bigportraits/ebsol.xml" ),

    Asset( "IMAGE", "bigportraits/ebsol.tex" ),

    Asset("IMAGE", "minimap/ebsolicon.tex"),

    Asset("ATLAS", "minimap/ebsolicon.xml"),

    

    AddMinimapAtlas("minimap/ebsolicon.xml")

}

Link to comment
Share on other sites

I did this, but it crashes whenever I select my mod! Can you tell me what I'm doing wrong?

Assets = {

    Asset( "ATLAS", "images/saveslot_portraits/ebsol.xml" ),

    Asset( "IMAGE", "images/saveslot_portraits/ebsol.tex" ),

    

    Asset( "ATLAS", "images/selectscreen_portraits/ebsol.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/ebsol.tex" ),

    

    Asset( "ATLAS", "images/selectscreen_portraits/ebsol_silho.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/ebsol_silho.tex" ),

    

    Asset( "ATLAS", "bigportraits/ebsol.xml" ),

    Asset( "IMAGE", "bigportraits/ebsol.tex" ),

    Asset("IMAGE", "minimap/ebsolicon.tex"),

    Asset("ATLAS", "minimap/ebsolicon.xml"),

   

    AddMinimapAtlas("minimap/ebsolicon.xml")

}

 

Take the AddMiniMapAtlas line out of the brackets

 

eg

Assets = {

    Asset( "ATLAS", "images/saveslot_portraits/ebsol.xml" ),

    Asset( "IMAGE", "images/saveslot_portraits/ebsol.tex" ),

    

    Asset( "ATLAS", "images/selectscreen_portraits/ebsol.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/ebsol.tex" ),

    

    Asset( "ATLAS", "images/selectscreen_portraits/ebsol_silho.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/ebsol_silho.tex" ),

    

    Asset( "ATLAS", "bigportraits/ebsol.xml" ),

    Asset( "IMAGE", "bigportraits/ebsol.tex" ),

    Asset("IMAGE", "minimap/ebsolicon.tex"),

    Asset("ATLAS", "minimap/ebsolicon.xml"),

}  

 

    AddMinimapAtlas("minimap/ebsolicon.xml")

 

And then make sure the following line is in your <character>.lua

 

inst.MiniMapEntity:SetIcon( "ebsolicon.png" )

 

it should be placed somewhere within local fn = function(inst)

 

eg

local fn = function(inst)

 

-- [other items may be in this area as well]

 

inst.MiniMapEntity:SetIcon( "ebsolicon.png" )

 

end

 

 

Link to comment
Share on other sites

Ok, ok. I'm doing what you told me to do, but the minimap icon is just blank. I'm not sure what the problem is. Does it have something to do with where I'm placing the files. At the moment, they're in the images folder. I'll also show you what I've got in terms of what you told me to do.

In the Modmain:

Assets = {
    Asset( "ATLAS", "images/saveslot_portraits/ebsol.xml" ),
    Asset( "IMAGE", "images/saveslot_portraits/ebsol.tex" ),
    
    Asset( "ATLAS", "images/selectscreen_portraits/ebsol.xml" ),
    Asset( "IMAGE", "images/selectscreen_portraits/ebsol.tex" ),
    
    Asset( "ATLAS", "images/selectscreen_portraits/ebsol_silho.xml" ),
    Asset( "IMAGE", "images/selectscreen_portraits/ebsol_silho.tex" ),
    
    Asset( "ATLAS", "bigportraits/ebsol.xml" ),
    Asset( "IMAGE", "bigportraits/ebsol.tex" ),

    Asset("IMAGE", "minimap/ebsolicon.tex"),
    Asset("ATLAS", "minimap/ebsolicon.xml"),
 

    AddMinimapAtlas("minimap/ebsolicon.xml")
}

 

In the Prefab file:

local fn = function(inst)
    
    -- choose which sounds this character will play
    inst.soundsname = "wilson"

    -- a minimap icon must be specified    
    inst.entity:AddMiniMapEntity()
    inst.MiniMapEntity:SetIcon("ebsolicon.png")

 

Somehow, it still refuses to work. This is so frustrating!! :(

Link to comment
Share on other sites

Ok, ok. I'm doing what you told me to do, but the minimap icon is just blank. I'm not sure what the problem is. Does it have something to do with where I'm placing the files. At the moment, they're in the images folder. I'll also show you what I've got in terms of what you told me to do.

In the Modmain:

Assets = {

    Asset( "ATLAS", "images/saveslot_portraits/ebsol.xml" ),

    Asset( "IMAGE", "images/saveslot_portraits/ebsol.tex" ),

    

    Asset( "ATLAS", "images/selectscreen_portraits/ebsol.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/ebsol.tex" ),

    

    Asset( "ATLAS", "images/selectscreen_portraits/ebsol_silho.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/ebsol_silho.tex" ),

    

    Asset( "ATLAS", "bigportraits/ebsol.xml" ),

    Asset( "IMAGE", "bigportraits/ebsol.tex" ),

    Asset("IMAGE", "minimap/ebsolicon.tex"),

    Asset("ATLAS", "minimap/ebsolicon.xml"),

 

    AddMinimapAtlas("minimap/ebsolicon.xml")

}

 

In the Prefab file:

local fn = function(inst)

    

    -- choose which sounds this character will play

    inst.soundsname = "wilson"

    -- a minimap icon must be specified    

    inst.entity:AddMiniMapEntity()

    inst.MiniMapEntity:SetIcon("ebsolicon.png")

 

Somehow, it still refuses to work. This is so frustrating!! :(

Change png to tex.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...