I've found a suitable replacement!! (Thanks, KV)

XanMag
24 Mar 2018, 21:22

So... Jay Nabonne helped set up a few functions for me when I first started this game. He was awesome. Turned out just how I wanted.

But... in my incontinence incompetence, I am getting a continuation of a message that I do not want and I don't know how to make it stop! This is a LOT of code in a LOT of places so I don't really want to ask anyone to sift through it all. I will try to post relevant snippets here so some kind soul MIGHT be able to help.

In short... I (I with lots of Jay) have set up a time of day script. Every 15 turns the time of day cycles (morning, noon, afternoon, etc) and resets after a full day has happened. Depending on the time of day, certain NPCs and Bats come and go and certain events happen. Also, messages are set to print as the time of day changes. For example: "It is uncomfortably cold now and the only light you can use to travel by is supplied by the moon and the faint stars overhead" prints when it is midnight. All is GREAT for all of these when I am in the first third of my game, which is basically outdoors or in old buildings.

The problem: The second third of my game takes place basically inside a mountain. There should be no random bat messages and no random time of day messages. I found the turnscript for random bats and did this in the first mountain room which seems to have worked.

DisableTurnScript (Random Bats TS)

I cannot, however, for the life of me figure out how Jay has the Time of Day messages set to trigger. I do have a changedHoursCount attribute that keeps track of all the changing that takes place.

I played the game and waited for a change script to fire and copy-pasted it in the code-view. This is a sufficient enough snippet I think.

    <object name="dawn">
      <isdawn />
      <dirtpathdescription>There seems to be a bit of a small crowd gathered to the east.</dirtpathdescription>
      <bats type="object">dawn bats</bats>
      <startinside type="script">
        MsgWithBr ("The room brightens a bit and warmth begins to return to the air.")
      </startinside>
      <startoutside type="script">
        MsgWithBr ("Thankfully, the stars have become invisible, the winds subsided, and the air has warmed.")
      </startoutside>
    </object>

I cannot find that in the GUI however and I am too nooby to poke around there for fear of screwing things up. The line that I don't understand here is the MsgWithBr thing. What is that? It's a function and the function looks like this:

msg ("<br/>" + text)

So... there is a enter line followed by the + text but what and where is the +text referring to?!?

And what might the <startoutside type="script"> thing be/do?

Essentially I am lost inside the GUI!! lol

I know this is a mess, but I need help. And who else to dump it on other than you helpful folks? =)


K.V.
24 Mar 2018, 23:16

It looks like MsgWithBr() is the same thing as msg(), only it adds a line break before the text.

In code view, I'd wager the function looks just like this:

<function name="MsgWithBr" parameters="text"><![CDATA[
  msg("<br/>" + text)
]]></function>

I be there's also a script which calls startinside or startoutside, depending on some attribute (either on the game.pov object, the parent, or the parent's parent).

...or...

Something else.

Send me the game and stuff if you'd like me to investigate.


XanMag
25 Mar 2018, 03:46

Seems like with the help of KV here, I'm making headway. I'll leave this post here "just in case" I need to revisit it with more questions! =)


K.V.
25 Mar 2018, 04:25

I would like to state, just for the record, that I am nowhere near Jay's level.