Vorple by Juhana Leinonen

Thanks, but I’m still getting an error, even with “place an inline element”. I get the following two errors;


You wrote ‘place an inline element called “rucksack-open” reading “rucksack”’ : but this is a phrase which I don’t recognise, possibly because it is one you meant to define but never got round to, or because the wording is wrong (see the Phrasebook section of the Index to check). Alternatively, it may be that the text immediately previous to this was a definition whose ending, normally a full stop, is missing?

Problem. In the sentence ‘display a tooltip “You’ll need something to carry your stuff in” on the element “rucksack-open” in 2 seconds’ , I was expecting to read a figure name, but instead found some text that I couldn’t understand - ‘a tooltip “You’ll need something to carry your stuff in” on the element “rucksack-open” in 2 seconds’.

This works for me:

Include Vorple Tooltips by Juhana Leinonen. 
Release along with the "Vorple" interpreter.

The Wilderness is a room. The player is carrying a rucksack. The rucksack is an open container.

Instead of examining the rucksack when the rucksack is open:
	say "Inside the ";
	place an inline element called "rucksack-open" reading "rucksack";
	say " is an old flask which is filled to the brim with water.";
	display a tooltip "You'll need something to carry your stuff in" on the element called "rucksack-open" in 2 seconds.

I’ve been working with Vorple the last couple of days and curious if it will be able to do the kind of HTML/CSS formatting I want. I’d like to have 3 story elements: environment text (look), narrative text (other action results), and the command list & prompt (inform responses).

The way forward seems to be to create my own html elements and pass the text to them. This is fine except one thing I haven’t figured out yet, which is how to send the previous command&prompt strings somewhere. By default Vorple copies them from the #lineinput form into a .lineinput div inside of .turn previous. I’m gessing there is no hook avilable to intercept this behavior?

(I assumed this was the only way forward because it seems the user is intended to create html elements only inside of the .turn previous > .turn structure rather than to mess with that structure. With all the swapping from #lineinput to .turn previous and then to .turn, I don’t think it’s otherwise possible to use HTML/CSS alone to move the pieces of text where I want them.)

I would probably also be happy not having the previous command text at all, and having the prompt just be still in one place on the page. I can use the action “change the text of the user’s previous command” to blank text, but that doesn’t affect the prompt string itself or the extra carriage return that appears after the above conversion takes place. I’ve also tried to hide and then show the prompt again, but that doesn’t seem to solve this particular problem, or I haven’t figured out exactly when to hide and show it again.

If anyone has any ideas on how to look at this problem differently it would be appreciated. It feels like this should be doable but not seeing it yet.

Edit: It occurred to me that I might be able to find a hook to "remove the element called ‘previous’ " and always remove the previous turn since it should hypothetically never contain any information I care about (after the first turn), but I’m going to try Juhana’s suggestion about listeners/filters first. Thanks!

Have you seen the documentation articles about event listeners and filters? At a glance it seems like this example could be adapted to this use case (except with .html() instead of .text() to capture the full HTML.)

I would do this with listeners/filters so that every turn Inform sends a message to the JavaScript side telling what the type of the current turn is. Then at the end of the turn get the HTML from the turn output (like in the example) and move it into the corresponding HTML element. That way you get full control of what happens to the output.

1 Like