Is it possible to populate the prompt?

Greetings! I know that it is possible to replace or modify an Inform 7 input and have that execute.

Is it possible to populate the prompt without executing, IE, leave a live cursor? Thus allowing the player to hit enter or change the command if they like.

2 Likes

I think this would be possible via Vorple. With that said, I don’t have the technical understanding to know for sure.

1 Like

This is possible in Glulx, but I’m not sure what extensions give you access to the feature.

1 Like

ah, nice. I’m doing glulx, so hopefully someone has come across it.

1 Like

I can imagine how to do it if you put the input line in a grid window. Would it be possible while leaving the input line in a text buffer window?

2 Likes

You want the extension Command Preloading by Daniel Stelzer. I have a version that works in Inform 10, but I haven’t gone through the process to put it in the repo yet. I can send it here if you need it imminently, though.

(Writing this IFComp entry has involved updating a bunch of my old extensions to Inform 10, but I haven’t bothered to upload any of them yet.)

3 Likes

Yep, there’s an optional argument to the line input request that says what text to preload into the prompt. The extension just modifies the VM_ReadKeyboard function to expose this argument.

3 Likes

Sure, if it’s no trouble, I’ll take it. I want to make reader/walkthrough/story mode to be a core feature of my WIP, so it’d be nice to have it working from the beginning (I’ll also allow for empty commands, but this seems like a nice, friendly presentation)

2 Likes

Enjoy! It’ll be in the repo once September 28 passes and I can switch to handling a different set of logistics.

Command Preloading-v1.i7x (3.0 KB)

4 Likes

thanks! much appreciated

1 Like

By the way, when I say stuff like this, it’s not because I’m dissing Daniel’s extensions. It’s just that there are Too Many Extensions. I decided years ago that if I was going to be the guy who knew all the Glk and Glulx and I6 architecture stuff, I couldn’t also be the guy who knew all the I7 extensions. Brain would explode.

7 Likes

I can probably extract the guide mode code from my WIP with a little elbow grease. It’s a (simple) system with a table holding a queue of commands that will be supplied by the game in guide mode.

Commands appear to the left of the prompt, and hitting RETURN accepts the displayed command. There’s the slight advantage that if you want to type something else, you just start typing. You don’t have to erase a preloaded command first.

At the moment, it exits the guide mode as soon as you type a command yourself that doesn’t match the suggested one. In future I plan to try adding something like deviating being set as an UNDO point, so the player could jump back on the rails after experimenting. For now, you stay on the rails until you want to get off.

@kamineko, let me know if you’re interested. I understand time’s running short to prep an IFComp entry, and I might not have this ready for 24 hours. If you’re already running with Daniel’s mechanic, let me know. If you’d like to try my thing, say that too, otherwise I might leave the extraction for a later date.

-Wade

2 Likes

Hi Wade. Thanks, your mode sounds pretty cool. I’ve been thinking that a single undo point while the player goes off road would be best, too. My game is for IFComp 2024 (I know, I know), so there’s no rush now that I have something to play with and think about. I would love to see it once it’s convenient to share.

2 Likes

Haha. No, I’m all about this pace. I can’t believe how many times @mathbrush has lapped me in volume while we’re both making big sci-fi games. But the process is the process and for each of us it takes what it takes :slight_smile: Okay, so the pressure to extract this system in haste is off.

-Wade

3 Likes

You may want Hidden Prompt by Daniel Stelzer, which is meant as an easy way to do just that! (Though if your own code already works, no need for an extension.)

Which is in fact the reason I updated Command Preloading for the new version. Hidden Prompt needs to intercept the first keypress to see if it’s a space or enter, and if it’s not, it preloads it into the input buffer so that the player doesn’t need to type it again.

3 Likes