Demo | Ask-like function w/ full keyboard

Pulp-importable JSON:
text-input-demo.zip (15.2 KB)

When I first starting working in Pulp, I tried to think of what features I would like to have on hand when I finally sit down to script the game I have in my head. There are a couple more that I'm going to start working on soon. The first to mind was an player name input screen... but if I was going to do the work that would entail I was going to want to be able to use it more than just once.

text-input-demo_01

So I made something that could be called (almost) as easily as the built in "ask" function. Once you have everything set up, you can call it simply by setting a variable for the question copy, and then calling the game function.

		tell event.game to
			askQ1 = "What is" // initialize question
			askQ2 = "your name?"
			call "askText"
		end

And then, when the player returns to the original screen, set an enter event to check that the question has been answered and catch the returned variable.

on enter do
	if answersGiven==1 then // if question has been answered set
		playerName = queryAnswer
	end
end

And that's it! I could talk about this for awhile, because frankly it was fun to set up the custom room, Character Set tiles, and menu navigation. However, I made an attempt to document everything pretty thoroughly in the code itself so it's probably just best to jump in.

Thank you to everyone on the Discord for answering my questions as they came up! Especially when the answer was "no you can't do that." :grinning_face_with_smiling_eyes:

9 Likes