dakko Posted March 4, 2023 Report Posted March 4, 2023 (edited) I'd like to update my macros using the new 1.18 waypoint icons. Does anyone know the new icon names?. EDIT 3/6/23: Although I did find the file names, using them to create a waypoint only produces the default circle on the map. I'm not able to unmark 'solution' -- this problem is not solved. The files are in ...assets/survival/textures/icons/worldmap The default .svg file names (as of 1.18-pre3): 0-circle 01-turnip 02-grain 03-apple 04-berries 05-mushroom bee cave Gear gravestone home ladder pick rocks ruins skull_and_crossbones spiral star1 star2 trader tree tree2 vessel x Edited March 6, 2023 by dakko not solved after all
BenLi Posted March 4, 2023 Report Posted March 4, 2023 Possible Waypoints icons are: Circle, Bee, Cave, Home, Ladder, Pickaxe, Rocks, Ruins, Spiral, Star1, Star2, Trader and Vessel. Generally speaking: the names can be used from here, waypoint section, if stripped the wp prefix from the icon name: https://wiki.vintagestory.at/index.php/VTML#Waypoint_Icons 1
dakko Posted March 4, 2023 Author Report Posted March 4, 2023 Thank you, BenLi. I meant the new icons in 1.18. I'll edit my question to be more accurate. Sorry about that!
BenLi Posted March 4, 2023 Report Posted March 4, 2023 Hopefully we will have the names in some json to learn about. Or the wiki will be updated.
dakko Posted March 4, 2023 Author Report Posted March 4, 2023 hmmm. You're right, there was some mention of being able to easily make your own icons by dropping individual files of some particular type into a folder... *goes to look*
Solution dakko Posted March 4, 2023 Author Solution Report Posted March 4, 2023 (edited) Found it! They are in ...assets/survival/textures/icons/worldmap The default .svg file names (as of 1.18-pre3): 0-circle 01-turnip 02-grain 03-apple 04-berries 05-mushroom bee cave Gear gravestone home ladder pick rocks ruins skull_and_crossbones spiral star1 star2 trader tree tree2 vessel x Edited March 4, 2023 by dakko additional details 2
BenLi Posted March 5, 2023 Report Posted March 5, 2023 just encountered this in official discord #gamedev channel: line 87 of the Systems/WorldMap/WaypointLayer/WaypointMapLayer.cs: var icons = api.Assets.GetMany("textures/icons/worldmap/", null, false); The previous code was: public List<string> WaypointIcons { get; set; } = new List<string>() { "circle", "bee", "cave", "home", "ladder", "pick", "rocks", "ruins", "spiral", "star1", "star2", "trader", "vessel" }; the default icon is still "circle" though... public string Icon = "circle";
dakko Posted March 6, 2023 Author Report Posted March 6, 2023 (edited) Thank you, BenLi!! So it looks like you cannot actually use the new icons when making macros, is that correct? That would explain why my new macros create circles instead of the new icons. Has this been discussed in the discord channel, or anyone give an example of a macro that uses the new 1.18 icons? eta: Oh! Wait a second, I misread your post. I'll give that command a try as soon as I can, later today. Edited March 6, 2023 by dakko
dakko Posted March 6, 2023 Author Report Posted March 6, 2023 15 hours ago, BenLi said: just encountered this in official discord #gamedev channel: line 87 of the Systems/WorldMap/WaypointLayer/WaypointMapLayer.cs: var icons = api.Assets.GetMany("textures/icons/worldmap/", null, false); The previous code was: public List<string> WaypointIcons { get; set; } = new List<string>() { "circle", "bee", "cave", "home", "ladder", "pick", "rocks", "ruins", "spiral", "star1", "star2", "trader", "vessel" }; the default icon is still "circle" though... public string Icon = "circle"; Apparently I don't know how to use that command. How does one use this to get the icon names? When using the file names, the macros do not work correctly. Well, at least not the grain icon. 1
BenLi Posted March 6, 2023 Report Posted March 6, 2023 (edited) var icons = api.Assets.GetMany("textures/icons/worldmap/", null, false); var capi = api as ICoreClientAPI; foreach (var icon in icons) { string name = icon.Name.Substring(0, icon.Name.IndexOf(".")); name = Regex.Replace(name, @"\d+\-", ""); look at the Replace function call replacing each name containing ENTER, backslash, - or + with empty. I am not sure but it might work for 02-grain.svg file as for "02grain" Can you please check? Can you also check for non-numbered icons such as home/star1? Upd: probably need to read svg in notepad and look for name tag in there... Edited March 6, 2023 by BenLi
dakko Posted March 6, 2023 Author Report Posted March 6, 2023 Thank you, BenLi. I'm sorry that I'm lacking the basic knowledge that would allow me to understand what you've written (for instance, I cannot find WaypointMapLayer.cs; I cannot even find the file structure that it is supposed to be in). I've tried 02grain as you have asked, but it does not work either. My old macros [for "pick", "rocks", "trader", "ladder" (I happened to use them, I was not actually testing)] do work, and their names happen to correspond to the .svg file names within textures/icons/worldmap. Their names also match what is found in line 18 of their .svg file (sodipodi:docname=) Line 18 for 02-grain.svg reads: sodipodi:docname="VS_icons_wheat_S.svg"> I see that star1 shows sodipodi:docname="star4.svg" -- I can test that one and see if the macro for it still works in 1.18 or not. I won't be able to test anything until later today though. Btw, 01-turnip, 03-apple, 04-berries, 05-mushroom, skull_and_crossbones, tree, tree2 and x have a completely different format and do not contain "docname" I appreciate your help! Thank you!
BenLi Posted March 6, 2023 Report Posted March 6, 2023 The thanks go to VS team, this time a little sarcastic Unfortunately I didn't install 1.18 yet. I will download the tarball and look into its svg files. The code I am mentioning is in https://github.com/anegostudios/vsessentialsmod/tree/master/Systems/WorldMap/WaypointLayer folder The file is WaypointMapLayer.cs in the bottom. Lines 87-93 as per 1.18.0 pre-5.
BenLi Posted March 6, 2023 Report Posted March 6, 2023 talked to few VERY smart guys in DS. They say the following: var icons = api.Assets.GetMany("textures/icons/worldmap/", null, false); this code loads all files from textures/icons/worldmap/ and adds the file name as icon name string name = icon.Name.Substring(0, icon.Name.IndexOf(".")) This code cuts .svg extension from the icon name stored after assets loading. name = Regex.Replace(name, @"\d+\-", ""); this code cuts the prefixing digits plus "-" character and replaces it with empty string. Therefore "0-circle.svg" icon name should become "circle" Need to re-check the circle grain turnip apple names. additional clue would be also to create the waypoint manually, and see its name via "/waypoint list". Probably the icon name may be mentioned there...
dakko Posted March 7, 2023 Author Report Posted March 7, 2023 You did it! (I think) Just tried the one for mushroom, leaving off the prefix digits plus "-" character and it worked! I hope to have more time to play around with it tonight. Thank you for that link too! 1
jimzawy Posted September 2, 2023 Report Posted September 2, 2023 Hey I am able to use the new icons like grain and all in the waypoint macro, but I can use the X icon, when I write X it produces a circle still, others like grain and turnip work fine
Recommended Posts