Code Monkey home page Code Monkey logo

Comments (19)

ChristopherA avatar ChristopherA commented on September 28, 2024

Is built in take verb being overridden by a merry-based take?

Is a take-* signal being sent to the environment?

from skotos.

shentino avatar shentino commented on September 28, 2024

Is built in take verb being overridden by a merry-based take?

Is a take-* signal being sent to the environment?

For more general context, what do you mean by "built in"? Is it like hard coded inside ~TextIF somewhere as a default implementation by the parser that can be intercepted by Merry?

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

I don't see an obvious Merry-based "take". So that's going to be something implemented in DGD.

from skotos.

shentino avatar shentino commented on September 28, 2024

I don't see an obvious Merry-based "take". So that's going to be something implemented in DGD.

That's impossible. DGD itself doesn't even have a concept of a verb, that is entirely in the LPC layer.

Not even the kernel library defines verbs as such, just commands you can use in the wiztool shell.

from skotos.

shentino avatar shentino commented on September 28, 2024

I don't see an obvious Merry-based "take". So that's going to be something implemented in DGD.

DGD is the bottom of multiple layers of software, ironically related to the layering document you accidentally deleted.

DGD defines the context of objects, callouts, and so on, and provides the baseline kfun api.
The kernel library is next, and provides basic security regime
Next is the LPC layer that is the bulk of skotoslib
Up from here is either merry or bilbo, (merry being hooked specially and compiled into a hash-named LPC file which itself is then compiled as a master object by DGD)

Any verbs that are implemented, but not present in merry, would therefore have to be in the skotoslib LPC layer somewhere.

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

I'm assuming the object of the "take" command is getting taken or Sarah wouldn't have said "no message" but rather "no effect" or "it doesn't work." That would strongly imply that the "take" action is happening, which strongly implies that the signal is being sent.

I'm not sure what should normally catch the (post?) signal and output the "Noah takes a pair of black socks"-type message.

I'm seeing the same thing on gables_game, so this isn't related to RWOT changes.

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

Also: yes, "take" is definitely happening, it's just not showing a message.

from skotos.

shentino avatar shentino commented on September 28, 2024

Sorry btw noah if I got snippy, I thought you were literally saying that the take command was part of DGD itself.

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

Sorry, yeah, I just meant it's written in LPC rather than Merry.

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

So here's something interesting. There's an LPC-based "OutputDB" that seems to have default messages for when things happen around you (e.g. you take or drop an object, or somebody around you does the same.) The message from OutputDB is turned into something you can see in /usr/TextIF/cmd/desc.c, in the function desc_output.

That function is getting called when I "get" or "take" my pipe, though I'm not seeing output in the game client. It is not getting called when I drop my pipe, suggesting that "drop" (which works) might not get its message from OutputDB.

(Edit: sorry, desc.c NOT basic.c)

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

Hm. And the message it's querying from OutputDB is coming out as nil, which is probably getting ignored when we say "emit this as SAM."

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

Hm. Maybe the XML file TextIF:OutputDB isn't getting loaded, and so we're only getting output messages for verbs with Merry code to emit the message? That might be.

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

To be clear, I'm really not sure why "drop" is properly showing a message - but it does not seem to be using this low-level LPC code to query the message from OutputDB since my debug log messages aren't being printed for "drop", but they are for "get" and "take".

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

Huh. There's two OutputDB.xml files. The one under data/vault/SID is empty. I don't think that should prevent the other one from loading, though. And because of the way the other one uses SID to call methods, I don't think loading an empty one too should cause trouble.

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

Huh. Oddly, it looks like the outputdb object does think it has a bunch of stuff loaded, including Output:Take. So why is it returning nil?

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

Ah. Okay, OutputDB does this weird thing where it accepts queries as a string which it downcases, then converts the downcased version back to case-sensitive, then returns the result. And only the patch() code ever populates its internal downcased-to-case-sensitive mapping. So this was code that was unsafe for cold-boot that was never updated to be cold-bootable, since it assumes the patch() method will fix this.

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

Okay. If I manually call "/usr/TextIF/sys/outputdb"->patch() from the wiztool, it fixes the problem. I'm going to make the smallest change that will fix this - when we add an entry to OutputDB I will update its internal lc2cs array that lets it look it up, which it currently doesn't ever update.

The right answer is to remove lc2cs and look up everything lowercase. It already has the down-sides of doing that without the up-sides, probably to avoid doing an annoying-but-entirely-possible remapping in the patch() method to maintain compatibility with pre-cold-boot SkotOS games.

Still not sure why the "drop" verb didn't have the same problem. It didn't have an entry in lc2cs either. So the drop output is presumably coming from somewhere else.

from skotos.

noahgibbs avatar noahgibbs commented on September 28, 2024

PR: #76

from skotos.

saraht45 avatar saraht45 commented on September 28, 2024

Tested the PR locally and it now works as it should. Thanks, Noah! :)

from skotos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.