Open bbailey opened 8 years ago
I'll need to grab room environs for @QwindorRousseau to update the crowdmap for these changes, but I'll have these changes done in a bit.
Anyone know how to go about changing an environment colour? I know I've looked into this in the past, and there's a way other than setCustomEnvColor(), so it doesn't show up in that table. No bloody clue how it's done though.
Looking through the mudlet code, I can't see a way to do so. But it seems custom environment colors are exported into the map as well (no sure from which version on).
I remember having to add environments awhile back and there was something you had to do to the environments when put into the table to use the color you want. Ill have to look into it and see what i can remember but I do remember it was a pain.
@vadi2 Any input?
Howdy - as an actively contributing Mudlet Maker - I'm looking at the C++ in that area at the moment and that area of color/environment looks to be a bit convoluted!
I'd give a long winded explanation but simply put during the reading of a Xml map file from the IRE MUD servers (including Achaea) there is a table of envIds (a property of each map room) to a colorId where colors 1-15 are the ANSI standard colours that the user can tweak in the game settings and 16 upwards (I think) are what ever gets set by setCustomEnv commands. The current Achaea Xml file has:
<environments>
<environment id="2" name="Constructed underground" color="8" htmlcolor="#80735f" />
<environment id="3" name="Natural underground" color="8" htmlcolor="#765116" />
<environment id="4" name="Forest" color="2" htmlcolor="#36662e" />
<environment id="5" name="Beach" color="11" htmlcolor="#ffffcc" />
<environment id="6" name="Desert" color="11" htmlcolor="#f9fd00" />
<environment id="7" name="Grasslands" color="10" htmlcolor="#1dc713" />
<environment id="8" name="Urban" color="13" htmlcolor="#bda0cb" />
<environment id="9" name="Hills" color="3" htmlcolor="#2d7720" />
<environment id="10" name="River" color="4" htmlcolor="#00ddff" />
<environment id="11" name="Path" color="6" htmlcolor="#837766" />
<environment id="12" name="Road" color="6" htmlcolor="#7c7c7c" />
<environment id="13" name="Valley" color="5" htmlcolor="#41ab2f" />
<environment id="14" name="Mountains" color="1" htmlcolor="#584a34" />
<environment id="15" name="Swamp" color="10" htmlcolor="#76843c" />
<environment id="16" name="Tundra" color="7" htmlcolor="#c5fcff" />
<environment id="17" name="Jungle" color="10" htmlcolor="#89e14b" />
<environment id="18" name="Dwarven city" color="13" htmlcolor="#ab9e6d" />
<environment id="19" name="Tsol'aa city" color="13" htmlcolor="#56a574" />
<environment id="20" name="Ocean" color="4" htmlcolor="#0000ff" />
<environment id="21" name="Garden" color="11" htmlcolor="#94e45d" />
<environment id="22" name="Freshwater" color="4" htmlcolor="#5ff0f0" />
<environment id="23" name="Sewer" color="8" htmlcolor="#918010" />
<environment id="24" name="Deep Ocean" color="4" htmlcolor="#003366" />
<environment id="25" name="Reef" color="12" htmlcolor="#f98167" />
<environment id="27" name="Polar" color="15" htmlcolor="#ffffff" />
<environment id="28" name="Trees" color="2" htmlcolor="#00e342" />
<environment id="29" name="Blighted" color="7" htmlcolor="#990000" />
<environment id="30" name="Water" color="4" htmlcolor="#4d42d4" />
<environment id="31" name="Magma Caves" color="9" htmlcolor="#dd4400" />
<environment id="32" name="Ruins" color="7" htmlcolor="#ddba82" />
<environment id="33" name="Catacombs" color="8" htmlcolor="#837766" />
<environment id="34" name="Ocean floor" color="4" htmlcolor="#0000ff" />
<environment id="35" name="Skies" color="14" htmlcolor="#ffffff" />
<environment id="36" name="Vessel" color="3" htmlcolor="#918010" />
<environment id="39" name="Agrarian" color="7" htmlcolor="#918010" />
<environment id="41" name="Wastelands" color="7" htmlcolor="#C0C0C0" />
<environment id="42" name="Lava Fields" color="1" htmlcolor="#cf1020" />
</environments>
Mudlet only reads the "id" and "color" values at the moment and stores them ("id" as key, "color" as value) in TMap::envColors
which is NOT user accessible or changed by anything else - it is stored in the Mudlet specific map file (the .dat files in the maps sub-directory) so it then persists in the game saves.
When it comes to drawing a room it's environment value (readable with lua getRoomEnv( <roomId> )
) is looked up and if it is one in that table it is drawn in the colour given. So for example a room with an envId of 5 is drawn with colourId 11 which is the ANSI yellow colour I believe - but then so is a room with an envId of 6 as that is also mapped to colour 11 above.
If someone wishes to have different colour for those two they will currently have to never use the IRE downloaded map (I think) or ensure that they use envIds that are NOT used as a key in the TMap::envColor table (i.e. listed in the XML downloaded file that was used) so that Mudlet will use a customEnvColor entry instead. I have looked at all five (?) of the current IRE XML maps and Aetolia has the highest envId of 126 - as you can see Achaea uses up to 42 at the moment.
I think changing the colours in Mudlets options will change the colours on the map as well.
On Sun, Oct 9, 2016 at 3:54 PM Stephen Lyons notifications@github.com wrote:
Howdy - as an actively contributing Mudlet Maker - I'm looking at the C++ in that area at the moment and that area of color/environment looks to be a bit convoluted!
I'd give a long winded explanation but simply put during the reading of a Xml map file from the IRE MUD servers (including Achaea) there is a table of envIds (a property of each map room) to a colorId where colors 1-15 are the ANSI standard colours that the user can tweak in the game settings and 16 upwards (I think) are what ever gets set by setCustomEnv commands. The current Achaea Xml file has:
Mudlet only reads the "id" and "color" values at the moment and stores them ("id" as key, "color" as value) in TMap::envColors which is NOT user accessible or changed by anything else - it is stored in the Mudlet specific map file (the .dat files in the maps sub-directory) so it then persists in the game saves.
When it comes to drawing a room it's environment value (readable with lua getRoomEnv(
)) is looked up and if it is one in that table it is drawn in the colour given. So for example a room with an envId of 5 is drawn with colourId 11 which is the ANSI yellow colour I believe - but then so is a room with an envId of 6 as that is also mapped to colour 11 above. If someone wishes to have different colour for those two they will currently have to never use the IRE downloaded map (I think) or ensure that they use envIds that are NOT used as a key in the TMap::envColor table (i.e. listed in the XML downloaded file that was used) so that Mudlet will use a customEnvColor entry instead. I have looked at all five (?) of the current IRE XML maps and Aetolia has the highest envId of 126 - as you can see Achaea uses up to 42 at the moment.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/IRE-Mudlet-Mapping/ire-mapping-script/issues/16#issuecomment-252466685, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGxjDUiOni9c6-U8wH7-oSjjBKASx4qks5qyIGKgaJpZM4J5XVX .
Yeah - for ALL the envIds that are mapped to those first 16 colours - i.e. all of the ones in the Xml files - if you wanted to change the colour for just rooms with say envId 5 you'd have to change all the rooms with envId 5 to something not in the table (so greater than 42) and then set the corresponding colour via Lua (I can't recall whether existing custom colours can be tweaked from the 2D mapper "color" or was it "environment" room context menu item... at present the TMap::envColors will lock envId 5, 6 and 21 together with no means of user control of that linkage.
Assuming of course that the person who started the Achaea crowdmap file available here are using a Mudlet save file that started as an Xml file that was downloaded from the IRE site.
So the only way to push those colours to the crowdmap would be to have him re-download that map? Seems like there's a workaround in there somewhere, but I ain't gonna be the one to dig for it.
mmp.envids as populated in register_achaeas_envdata() has several terrains in the table with duplicate ids. This serves to neuter the mmp.envidsr table when it is generated, which results in rooms reporting the incorrect terrain when translating back from the map's terrain id to a terrain type.
The latter entries in mmp.envids are preserved in mmp.envidsr while the earlier entries are overwritten.
Catacombs and Mountains both share id 14, resulting in entry 14 in mmp.envidsr always returning Mountains. Thus the Azdun catacombs in the crowdmap will erroneously report as Mountains when trying to translate their terrain back from id 14. Even if you manually remap the rooms to Catacombs, it will again save as id 14 and be reported back as Mountains.
Shared ids are: Catacombs and Mountains share id 14 River and Skies share id 10 Deep Ocean floor and Water share id 30