Combat Library 3.0 breaks Quest's map system, apparently.

Pykrete
26 Feb 2018, 04:03

Without combat library, as seen in the file 'Map without Combat Library Works', we have 3 connected rooms, the map loads immediately and you can travel between them.

With the exact same setup, except now Combat Library has been added (as has the CombatInitialise function in the start script, though this happens regardless of whether or not it's in play), as seen in the file 'Map with Combat Library Broken', we get... nothing. It's completely blank.

https://drive.google.com/open?id=10NUR208mM33678uAeoHbT8GSHm4nFPff

Issue seems to be the case on 5.7.1 and 5.7.2. Apologies if this is known, not seen it mentioned anywhere. Is there a fix for this or am I buggered? (Or is there something else I've somehow overlooked that is the real cause?)


K.V.
26 Feb 2018, 04:21

Hrmm...

The map breaks when including the library. You don't even have to put that line in the start script to break it.

You can delete the start script: still no map.

If you delete the line including CombatLib: the map works.

Same thing in Quest 5.6.3, too.

(Still investigating.)


Pykrete
26 Feb 2018, 04:50

Yeeeeah, spent most of today learning the library and coming up with all sorts of uses for it; WHOOP, no map. I wonder how long this has been an issue, given Pixie's decision to forgo Quest's map system with one of their own for Deeper. (Apologies if I'm seeing a link where there is none, there.)

I was considering an alternate map system myself, so it's not the end of the world, but... it's definitely irritating not to have the option.


K.V.
26 Feb 2018, 05:10

It's something in this:

  <function name="OnEnterRoom" parameters="oldRoom"><![CDATA[
    game.displayroomdescriptiononstart = false
    if (IsDefined("oldRoom")) {
      if (oldRoom <> null) {
        if (HasScript(oldRoom, "onexit")) {
          do (oldRoom, "onexit")
        }
      }
    }
    on ready {
      if ((not GetBoolean(game.pov.parent, "visited")) and HasScript(game.pov.parent, "beforefirstenter")) {
        do (game.pov.parent, "beforefirstenter")
      }
      on ready {
        if (HasScript(game.pov.parent, "beforeenter")) {
          do (game.pov.parent, "beforeenter")
        }
        on ready {
          if (IsDefined("oldRoom")) {
            if (oldRoom <> null and game.changeroom_newline and not game.command_newline) {
              msg ("")
            }
          }
          //st = DisplayName(game.pov.parent)
          //request (UpdateLocation, "- " + st + " -")
          //Title (st, 14)
          roomFrameExists = false
          if (game.showdescriptiononenter) {
            ShowRoomDescription
          }
          if (HasScript( game, "roomenter")) {
            do (game, "roomenter")
          }
          on ready {
            if ((not GetBoolean(game.pov.parent, "visited")) and HasScript(game.pov.parent, "firstenter")) {
              do (game.pov.parent, "firstenter")
            }
            on ready {
              if (HasScript(game.pov.parent, "enter")) {
                do (game.pov.parent, "enter")
              }
            }
            set (game.pov.parent, "visited", true)
          }
        }
      }
    }
  ]]></function>

Pykrete
26 Feb 2018, 05:13

Ah? You've narrowed it down? What does that section do?


K.V.
26 Feb 2018, 05:13

This part isn't in the function:

if (game.gridmap) {
  Grid_CalculateMapCoordinates (game.pov.parent, game.pov)
  Grid_DrawPlayerInRoom (game.pov.parent)
}

The map needs that.


In the CombatStuff.xml file, starting at line 384, replace the existing OnEnterRoom() with this:

  <function name="OnEnterRoom" parameters="oldRoom"><![CDATA[
    game.displayroomdescriptiononstart = false
    if (IsDefined("oldRoom")) {
      if (oldRoom <> null) {
        if (HasScript(oldRoom, "onexit")) {
          do (oldRoom, "onexit")
        }
      }
    }
    on ready {
      if ((not GetBoolean(game.pov.parent, "visited")) and HasScript(game.pov.parent, "beforefirstenter")) {
        do (game.pov.parent, "beforefirstenter")
      }
      on ready {
        if (HasScript(game.pov.parent, "beforeenter")) {
          do (game.pov.parent, "beforeenter")
        }
        on ready {
	  if (game.gridmap) {
            Grid_CalculateMapCoordinates (game.pov.parent, game.pov)
            Grid_DrawPlayerInRoom (game.pov.parent)
          }
          if (IsDefined("oldRoom")) {
            if (oldRoom <> null and game.changeroom_newline and not game.command_newline) {
              msg ("")
            }
          }
          //st = DisplayName(game.pov.parent)
          //request (UpdateLocation, "- " + st + " -")
          //Title (st, 14)
          roomFrameExists = false
          if (game.showdescriptiononenter) {
            ShowRoomDescription
          }
          if (HasScript( game, "roomenter")) {
            do (game, "roomenter")
          }
          on ready {
            if ((not GetBoolean(game.pov.parent, "visited")) and HasScript(game.pov.parent, "firstenter")) {
              do (game.pov.parent, "firstenter")
            }
            on ready {
              if (HasScript(game.pov.parent, "enter")) {
                do (game.pov.parent, "enter")
              }
            }
            set (game.pov.parent, "visited", true)
          }
        }
      }
    }
  ]]></function>

Pykrete
26 Feb 2018, 05:25

Well I'll be blown! That's fixed it, so far as I can see! Thanks a ton, K.V.


K.V.
26 Feb 2018, 05:38

No problem!

Glad to help!

(You probably helped out countless people by pointing this out, too, by the way.)


I'm still trying to wrap my mind around the fact that no one else using CombatLib has ever enabled the map.


The Pixie
26 Feb 2018, 08:32

Thanks for pointing this out. I think OnRoomEnter used to do something, but no longer does, and meanwhile the original Quest version has changed to do stuff - not just the map but other things. I have deleted the function altogether from CombatLib, and uploaded a new version. You can delete it from CombatStuff.xml or downloads the updated version.


Pykrete
26 Feb 2018, 15:46

Understood and done. Though, I have also noticed something else about the Combat Library - you've got it commented that it requires Shoplib and Clothinglib to also be installed and loaded before it, but if I try and do that I get this error message;

"For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method."

Can't open up the game at all until I go into notepad ++ and remove BOTH other libraries from the code. Everything seems to work fine without them regardless, so is this an old requirement to begin with?


The Pixie
26 Feb 2018, 16:01

Yes, that was an old requirement. I updated the docs on my Github, but obviously forgot that. I will update at some point..


hegemonkhan
27 Feb 2018, 04:26

Pixie's newest combat library includes the spell and equipment content/code/libraries (they: combat, spell, and equipment, were separate libraries originally), so that's why you're getting an error, as you're trying to load the same code again.