Okay, so…
@jnelson’s solution was partial, and handled most of the use cases, and actually cleaned up the file quite a bit (thank you!!!). However, >CLIMB UP
and >CLIMB DOWN
still had the same results (corrected to >CLIMB US
and broke, or There is no down here
).
I originally attempted to use a Doer
to handle this, but they never actually triggered. It’s like I never even added them at all. So I gutted those, and uh…did something a little cursed, but effective…
So in addition to Jim’s professional and clean fix, I managed to do the other half with some inspiration from my man Ziegler, who’s been in the verbose TADS trenches with me, lol:
What I wound up doing was poking at some Unthing
functionality, and creating an object in each room called “up/upward” and “down/downard”, respectively. Each of these two objects have a parser filter that forces them to opt out, if there’s any other possible matches available, and swapping itself out with an alternative for any actions that it should not be handling.
So, in short, if the player uses up
, upward
, down
, or downward
in a command in one of these two rooms, then the nearby object will check for the command being used. If the command isn’t something that it’s explicitly supposed to handle, then it either opts out, or passes the match onto a fallback.
The result is a hilarious abomination, and I’ve cleaned it up as well as I could. Hopefully this is useful to someone in the future.
Code page is as follows:
/*
* This entire area is completely dark, but the player is still able
* to operate in it.
* This code page is modified from the in-game version to
* avoid spoilers.
* Additionally, some properties and code that configures
* the darkness behavior has been removed for simplicity.
* As a result, a lot of the description properties are actually
* supposed to be printed when FEELing the environment,
* but have been moved around and modified here,
* so that people using vanilla Adv3Lite can test this code page.
*/
// The room that the player and Anabel arrive in, after discovering a secret easter egg elsewhere in the game.
SecretRoom: Room { 'Mysterious Realm'
"The realm seems to extend infinitely in all directions. "
floorObj = secretGround
up = mysteriousTree
doNotLeaveBehindMsg = 'I feel like we <i>really</i> do not want to leave anything here... ';
cannotGoThatWay(dir) {
switch (dir) {
case downDir:
"I can't go underground, silly! ";
return;
default:
"I travel for a ways, aimlessly jogging through the unchanging dark.\b
\"<i>Markka!</i>\" I call out.\b
\"<i>Paulla!</i>\" Anabel calls back, giving me a rough idea of direction and distance.\b
\"I don't think there's anything out here!\"\b
\"Well, <i>yeah,</i>\" Anabel shouts back. \"My lidar showed me as much! Now, come back to me, ya goof!\"\b
I smile to myself and jog back to Anabel.";
}
}
roomBeforeAction() {
if (gActionIs(Drop)) {
"<<doNotLeaveBehindMsg>>";
abort;
}
}
}
+secretGround: Floor { 'the ground;;dirt soil floor'
"The damp, freezing, soft soil resists your hand pressure, but quickly hardens. "
}
// This handles CLIMB TREE, CLIMB UP TREE, and UP
+mysteriousTree: StairwayUp { 'tree;large gnarled'
"It is an immense tree. The bark is rough, and feels like it might be petrified.
It would take three adults—hand-in-hand—to encompass the circumference of the trunk. "
destination = InMysteriousTree
travelDesc = "<<first time>>Using childhood skills I never thought I had, <<only>>I ascent the strange tree.
<<first time>>Its branches feel gnarled and lifeless, but sturdy enough to hold me. <<only>>Once I'm secure, I reach down, and
help Anabel climb up with me. "
specialDesc = "The tree dominates the space. ";
}
// This, specifically, handles CLIMB UP
+secretUpward: Decoration { 'up;;upward'
"<<secretSky.desc>>"
decorationActions = [Examine, Climb, ClimbUp, ClimbUpVague]
// This is to handle other commands that use "up", which we don't want interacting with this object
filterResolveList(np, cmd, mode) {
if(!(cmd.action == Examine || cmd.action == Climb || cmd.action == ClimbUp || cmd.action == ClimbUpVague)) {
if (np.matches.length == 1) { // The parser only found us, but it has the wrong object
np.matches[1].obj = secretSky; // Force a correction by providing a fallback object
}
else if (np.matches.length > 1) { // There are better matches
np.matches = np.matches.subset({m: m.obj != self}); // Remove us
}
}
}
dobjFor(Climb) { remap = mysteriousTree }
dobjFor(ClimbUp) asDobjFor(Climb)
dobjFor(ClimbUpVague) asDobjFor(Climb)
}
secretSky: MultiLoc, Thing { 'sky;dark black empty night nighttime;darkness blackness void moon sun stars'
"The perfect blackness is all I can see. When I look up, there are no stars to be seen, and no moon.\n
The first conclusion is that we are <i>deep</i> underground, in a cavern so vast that it does not echo.\n
The second conclusion is that we stand on a planet that is <i>so far away</i> from any galaxy, that the sky is entirely empty.\b
Now, I don't know how remote such a planet would have to be, but I'm also pretty sure that even the largest caves still echo... "
isDecoration = true
notImportantMsg = 'The black is impenetrable and infinitely far away. '
locationList = [SecretRoom, InMysteriousTree]
}
InMysteriousTree: Room { 'In the Mysterious Tree'
"I sit among the branches of the strange tree. The perfect blackness that consumes me makes the
ground below feel infinitely-far. "
floorObj = secretTreeFakeFloor
down = secretTreeBranches
out asExit(down)
roomBeforeAction() {
if (gActionIs(Drop)) {
"<<SecretRoom.doNotLeaveBehindMsg>>";
abort;
}
}
dobjFor(Feel) { remap = secretTreeBranches }
}
+secretTreeFakeFloor: Floor { 'the ground;;dirt soil floor'
"Congrats if you actually manage to read this! "
decorationActions = [Examine, TakeFrom, Feel, Smell, Taste]
groundIsTooFarMsg = 'The ground is too far below, and the total darkness exacerbates this. '
dobjFor(Examine) {
verify() {
illogical(groundIsTooFarMsg);
}
}
dobjFor(Feel) {
verify() {
illogical(groundIsTooFarMsg);
}
}
dobjFor(Smell) {
verify() {
illogical(groundIsTooFarMsg);
}
}
dobjFor(Taste) {
verify() {
illogical(groundIsTooFarMsg);
}
}
}
// This handles CLIMB OUT, GET OUT, GET OFF, CLIMB DOWN BRANCHES, and DOWN
+secretTreeBranches: StairwayDown { 'branches;surrounding gnarled dead'
"The branches are many, gnarled, and without leaves. However, they are also incredibly strong, and do not easily bend. "
destination = SecretRoom
isConnectorVisible = true
isConnectorApparent = true
isConnectorListed = nil
isClimbable = true
travelDesc = "<<first time>>The terror of falling is a lot more acute as <<only>>I climb down<<first time>>, but I make it<<only>>.
As Anabel descends, I help her keep her balance and her nerves. "
dobjFor(Climb) {
action() {
travelVia(gActor);
}
}
dobjFor(GetOutOf) asDobjFor(Climb)
dobjFor(GetOff) asDobjFor(Climb)
dobjFor(ClimbDown) asDobjFor(Climb)
dobjFor(ClimbDownVague) asDobjFor(Climb)
}
// This, specifically, handles CLIMB DOWN
+secretDownward: Decoration { 'down;;downward'
"<<secretTreeFakeFloor.groundIsTooFarMsg>>"
decorationActions = [Examine, Climb, ClimbDown, ClimbDownVague]
// This is to handle other commands that use "down", which we don't want interacting with this object
filterResolveList(np, cmd, mode) {
if(!(cmd.action == Examine || cmd.action == Climb || cmd.action == ClimbDown || cmd.action == ClimbDownVague)) {
if (np.matches.length == 1) { // The parser only found us, but it has the wrong object
np.matches[1].obj = secretTreeBranches; // Force a correction by providing a fallback object
}
else if (np.matches.length > 1) { // There are better matches
np.matches = np.matches.subset({m: m.obj != self}); // Remove us
}
}
}
dobjFor(Climb) { remap = secretTreeBranches }
dobjFor(ClimbDown) asDobjFor(Climb)
dobjFor(ClimbDownVague) asDobjFor(Climb)
}