ThePix / QuestJS

A major re-write of Quest that is written in JavaScript and will run in the browser.
MIT License
74 stars 15 forks source link

Look Up, Down, N/S/E/W #81

Closed thaskef closed 2 years ago

thaskef commented 2 years ago

Usually I look in certain directions when playing text adventures. My Quest 5 games had descriptions for each direction someone might look to find something of interest.

Is there a way to implement that in QuestJS?

ThePix commented 2 years ago

Short answer: yes

It is worth adding to the library. Give me a few days and I will see what I can do. The attributes on the room objects will (almost certainly) be "look_east", "look_up", etc.

ThePix commented 2 years ago

I have added up update to github. You will need to update lang/lang-en.js and lib/_commands.js.

Docs are here: https://github.com/ThePix/QuestJS/wiki/Attributes-for-rooms#look-directions

I will leave this open a couple of days in case you hit any issues.

thaskef commented 2 years ago

Ok great it's working now as long as I create it as a function with a msg(). (It doesn't work with just a string unless if it's an unlocked exit as you mention.)

The only things to tidy up now are:

ThePix commented 2 years ago

Thanks, I have updated lib/_commands.js

thaskef commented 2 years ago

I was able to modify lang/lang-en.js as follows: no_look_that_way:"{nv:char:can't:true} see anything of interest {show:dir}.",

This resolved the second issue above.