Jump to content

[solved] Player map icon won't show up (Custom character mod)


Recommended Posts

So, my issue is rather simple but I can't seem to find any damn solution for it as I've tried everything possible I could think of.

After a LOT of trial and error I've finally managed to get my mod up and running like it should, all but one little thing:
My player map icon won't show up on the map.

I've tried everything; Deleted the TEX and XML files, dragged the png image to another location in the images folder before dragging it back. Yet nothing worked.

 

Hoping someone can help me out with this as it's getting on my nerves!
I just want this mod to be done so I can hand it to the person I made it for!

Edited by iMoanah
Resolved the issue (Solutions down in the comments)
Link to comment
Share on other sites

Sounds like you have an error in one of the lua files, not sure if its the modmain or the character lua file. Check for the following in the modmain:

Assets = { --reference
    Asset( "IMAGE", "images/saveslot_portraits/charactername.tex" ),
    Asset( "ATLAS", "images/saveslot_portraits/charactername.xml" ),

AddMinimapAtlas("images/map_icons/charactername.xml")

and for the character lua file:

local common_postinit = function(inst) --reference

inst.MiniMapEntity:SetIcon( "charactername.tex" )

check for capitalization and otherwise not many people can help you with only this amount of information.

Edited by K1NGT1GER609
Link to comment
Share on other sites

On 25-4-2018 at 5:11 AM, K1NGT1GER609 said:

Sounds like you have an error in one of the lua files, not sure if its the modmain or the character lua file. Check for the following in the modmain:

Assets = { --reference
    Asset( "IMAGE", "images/saveslot_portraits/charactername.tex" ),
    Asset( "ATLAS", "images/saveslot_portraits/charactername.xml" ),

AddMinimapAtlas("images/map_icons/charactername.xml")

and for the character lua file:

local common_postinit = function(inst) --reference

inst.MiniMapEntity:SetIcon( "charactername.tex" )

check for capitalization and otherwise not many people can help you with only this amount of information.

I've checked out both and they seem to be exactly like what you sugested to check. Even reverting the image to what it was before (back to the example character icon) didn't work.
I'll hand you my codes to see for yourself if you wish, cus I'm just completely lost here.


(Removed both code files for safety reasons)

Edited by iMoanah
Link to comment
Share on other sites

Strange for character there seems to be 2 common_postinit? If thats the case combine the two by having this:

local common_postinit = function(inst)
inst.MiniMapEntity:SetIcon( "warren.tex" )   
inst:WatchWorldState( "isday", function() SetNightVision(inst) end)
      inst:WatchWorldState( "isdusk", function() SetNightVision(inst) end)
      inst:WatchWorldState( "isnight", function() SetNightVision(inst)  end)
    inst:WatchWorldState( "iscaveday", function() SetNightVision(inst) end)
      inst:WatchWorldState( "iscavedusk", function() SetNightVision(inst) end)
      inst:WatchWorldState( "iscavenight", function() SetNightVision(inst)  end)   
    SetNightVision(inst)
    end
Link to comment
Share on other sites

19 hours ago, K1NGT1GER609 said:

Strange for character there seems to be 2 common_postinit? If thats the case combine the two by having this:

local common_postinit = function(inst)
inst.MiniMapEntity:SetIcon( "warren.tex" )   
inst:WatchWorldState( "isday", function() SetNightVision(inst) end)
      inst:WatchWorldState( "isdusk", function() SetNightVision(inst) end)
      inst:WatchWorldState( "isnight", function() SetNightVision(inst)  end)
    inst:WatchWorldState( "iscaveday", function() SetNightVision(inst) end)
      inst:WatchWorldState( "iscavedusk", function() SetNightVision(inst) end)
      inst:WatchWorldState( "iscavenight", function() SetNightVision(inst)  end)   
    SetNightVision(inst)
    end

I didn't even notice the local common was in there twice!
It works perfectly now!

Thank you for the help! it's much appreciated!

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...