Sarcen Posted January 12, 2015 Share Posted January 12, 2015 I've created a mod that shows all player icons across the map(http://steamcommunity.com/sharedfiles/filedetails/?id=373991022)But I've run into one issue.In order to show the icon on clients I am creating a dummy object with a MiniMapEntity that has the same icon as the player entity. I've been setting the icon likeMiniMapEntity:SetIcon(prefabname .. ".png")Which, works for all vanilla characters.But there are several mods that useMiniMapEntity:SetIcon(prefabname .. ".tex")Now the perfect solution would be to GetIcon() from the MiniMapEntity, but that function doesn't exist (would be nice if it did klei! ) So, at the moment I'm trying to determine whether or not an image is loaded, so I can just attempt both images. I could search the assets and see what is image file is loaded but that would be incorrect as I need the name specified in the atlas not the file name... Link to comment https://forums.kleientertainment.com/forums/topic/49028-is-it-possible-to-test-if-an-image-is-loaded/ Share on other sites More sharing options...
rezecib Posted January 12, 2015 Share Posted January 12, 2015 (edited) Whoa! DrawOverFogOfWar... nice. Unfortunately I do not know of a way to check if an image is loaded without crashing... But it's kind of odd that the minimap entities have names with .png, because they're actually regions of a tex. So I think a relatively safe solution would be to check if the character is a mod character, then use .tex if so. Are there any mod characters that use png? Edit: Also, I was working on a mod with global player indicators and signal fires and stuff, and I would love to merge this into that mod, just because we're doing the same sort of networking so it would make sense to have as much global positioning stuff in a single mod. I can't wait to get back from travelling on Friday so I can get it published... Edited January 12, 2015 by rezecib Link to comment https://forums.kleientertainment.com/forums/topic/49028-is-it-possible-to-test-if-an-image-is-loaded/#findComment-601078 Share on other sites More sharing options...
Sarcen Posted January 12, 2015 Author Share Posted January 12, 2015 Well, I "fixed" my problem for as far as I think I possibly can. Its done with a relatively big hack I am just reading all of the atlas files now and search for the elements,then strip the file type and make a look up dictionary to retrieve the full file name. This will work for all the mods that are just different filetypes, if they completely leave the standard of prefabname.something then it will not work. I think the only thing I can do about that is make specific GetIconName implementations per mod character. Link to comment https://forums.kleientertainment.com/forums/topic/49028-is-it-possible-to-test-if-an-image-is-loaded/#findComment-601117 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now