View Single Post
  #7  
Old 05-30-2020, 02:15 PM
loramin loramin is offline
Planar Protector

loramin's Avatar

Join Date: Jul 2013
Posts: 10,522
Default

Quote:
Originally Posted by Sabin76 [You must be logged in to view images. Log in or Register.]
Next question: For maps with multiple levels (like Najena) the mob /loc is incorrectly displayed if it's not on the main level. A good example is the Dark-Boned skeleton, which I thought was in the room with next to the TTs near the entrance to the dungeon proper when it's actually downstairs near Officer Grush, or in the Jail with Moosh. Would it be better to have the correct /loc, but incorrect placement on the map, or incorrect /loc but actually reflect where the mobs are on the map?

Personally, I'd rather have the latter as I don't use the locs to try and actually locate the mobs, but I wanted to see before making those kinds of edits.
So, there's two issues. First, in order for any level of any zone to show an X on the map, that zone/level has to be "loc mapped". Not every zone is, and for the multi-level zones, not every level is. If you'd like to "loc map" a zone/level, the wiki has instructions.

But then even if a zone/level is mapped, if it's a multi-level zone, and the mob is not on the first/ground floor, the mob's loc needs to say what level it's on: otherwise the wiki will assume the mob is on the first floor. I tried to write the code to be as accommodating as possible and work with any reasonable language wiki editors might use, so (for instance) you can say "0th level" or "basement" or "underground":

Code:
      if (containsAnyNumber(text, 0, 'th') || containsAny(text, 'basement', 'underground', 'tunnel')) return levels[0];
      if (containsAnyNumber(text, 1, 'st') || containsAny(text, 'one', 'first', 'ground')) return levels[1];
      if (containsAnyNumber(text, 2, 'nd') || containsAny(text, 'two', 'second')) return levels[2];
      if (containsAnyNumber(text, 3, 'rd') || containsAny(text, 'three', 'third')) return levels[3];
      if (containsAnyNumber(text, 4, 'th') || containsAny(text, 'four', 'fourth')) return levels[4];
      if (containsAnyNumber(text, 5, 'th') || containsAny(text, 'five', 'fifth')) return levels[5];
      if (containsAnyNumber(text, 6, 'th') || containsAny(text, 'six', 'sixth')) return levels[6];
      if (containsAnyNumber(text, 7, 'th') || containsAny(text, 'seven', 'seventh')) return levels[7];
      if (containsAnyNumber(text, 8, 'th') || containsAny(text, 'eight', 'eighth')) return levels[8];
      if (containsAnyNumber(text, 9, 'th') || containsAny(text, 'nine', 'ninth')) return levels[9];
But that still leaves the question: for a multi-level zone, if a mob has no level specified, what's the best thing to do? We could just show an error, but then any mob on the first level (which tends to be the most populated level) wouldn't work even though it could.

Instead, I opted to assume every mob was on the first level, but then that leaves mobs on 2nd+ floor showing up wrong ... until someone adds their level to their loc.

Since the ultimate goal is to get every mob's level in their loc, so that you can see where every mob is, and since defaulting to level 1 lets lots of mobs work without extra editing, I figured that was worth the cost of some 2nd+ level mobs showing a misleading "X" (in a way that's a "feature" that encourages wiki editors to add levels to mob's locs [You must be logged in to view images. Log in or Register.]).

But it does have a cost (of some mobs showing up wrong), so I admit it's not perfect and I'm open to suggestions.
__________________

Loramin Frostseer, Oracle of the Tribunal <Anonymous> and Fan of the "Where To Go For XP/For Treasure?" Guides
Anyone can improve the wiki! If you are new to the Blue or Green servers, you can improve the wiki to earn a "welcome package" of platinum and/or gear! Send me a forum message for details.