ThePix / QuestJS

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

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

Closed thaskef closed 1 year ago

thaskef commented 1 year 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 1 year 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 1 year 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 1 year 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 1 year ago

Thanks, I have updated lib/_commands.js

thaskef commented 1 year 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.