Clickable text.[solved]

I'm creating an adult game involving transformation and so the description of the player and NPC's can be very long and I don't want to make a mess of the page every time the player looks at himself or an NPC.

If possible, when the look at command is triggered, I want to put a basic description but with clickable text that pops a window with a further description that can be closed when the player needs or something similar to help keep the page tidy.

I know almost nothing about coding so thanks to keep it simple if possible:)

edit1: I use the downloadable version.


What you're looking for is command.

It takes the form of this:

{command:COMMANDTEXT}, and when you run the game you see COMMANDTEXT as clickable. And when you do click it, a command that requires that triggers.

You can also make it appear differently. So if you have command that requires you to write '4546', but you want the player to see 'Click this to progress', then you do this:

{command:4546:Click This To Progress} - The player will see a clickable 'Click This To Progress' and when they do, command 4546 will trigger.

I created a command and gave it a name, then I made a simple script to test it out.


When I go in the game the "name" is clickable but it says it doesn't understand the command. Do I need to put something in the pattern box for it to execute the script or something?

ok, nevermind I just needed to switch it to a regular expression.

Thanks a lot:)

ok, it works but how do I get it to pop a closable window? I know its possible for a menu but I can't seem to find any script for that.

sorry if all those are noob and stupid question btw.


That, I'm afraid, I do not know. You could, conceivably, do some sneaky stuff with the 'Clear Previous Turn' and 'Print Without Newline' blocks, but more than likely you'd need JSS sorcery.

What you want is probably a jquery Dialog.

You want to output your description inside a div which can then be turned into a dialog. For example, you might do:

msg("<div id=\"description_john\">Here's the full description for the NPC named John.</div>")

You only want to do this once for each NPC who can be viewed in this way; but you need to do it again if a saved game is loaded. For this reason, I'd suggest going through all the NPCs in your UI initialisation script; creating hidden popups for them all.

Then for each one you will want to do:


which turns it into a popup and makes all those description boxes not appear on the screen.

Then later in the game you can create a link like this:

msg ("To look at John's description, <a onclick=\"$('#description_john').dialog('toggle');\">click here</a>.")

And if you change John's description, you can do something like:

JS.eval("$('#description_john').html('Here is John's new and improved description!');")

that will update the description in the popup, whether or not it is currently displayed, ensuring that the next time the player clicks a description link they get the updated one.

Hope that's understandable, and hope I've not made any dumb mistakes. Just putting something together off the top of my head, so haven't put that much thought into it.

since I have quite a lot of different combinations to custom the player that may be a real pain to set up. I thought about it and I was wondering if there is a way to trigger a room description?

It would need to be working in any rooms so I could just clean the screen and recall the room description. I thought about making a hidden (description room) but I'm not sure it would be possible to work for every room.

I'll keep your idea in mind tho, just one thing where do I find the UI initialisation script?

This topic is now closed. Topics are closed after 60 days of inactivity.