Display tiles with text box for character portraits?

Hoping someone can help with this. I'm a complete code novice and am seeing Pulp script as a great way to learn some basics but I can't get this visual flourish to work. I'd like a nine tile portrait to display during a conversation with an NPC. I tried assigning an event to the conversation and then using the draw function with co-ordinates to make it display but am having no luck. Any advice would be appreciated.

Sounds like the right approach to me. Since you wrote, that you’re using a custom event: Are you aware, that draw can only be called from the players draw event, not from any other event?

1 Like

Great, thanks for coming back to me. So it sounds like the logic is right. I'm probably not executing it properly. This is how I've tried doing it:

Within the NPC I have this bit of code to move the text box down and another to call an event.

on interact do
say "Hello" at 2,9,19,3

tell event.start to
	call "NPC1 portrait"
end

end

Then within the player draw even I have the following to display one of the tiles I intend to use as a portrait above the text box.

tell "NPC1 portrait" to
draw "Portrait9" at 8,22
end

Pulp doesn't like that bit of code in the draw command and I can't work out where I've gone wrong. I'm sure this is simple stuff, as I say I am a novice. Any clarification would be really helpful.

1 Like

I think you may be better off with embedding times directly into your text?

See this front the docs:

say "This is an apple: {embed:apple}"

In the above, 'apple' is the name of a tile.

I only learned about this other other day myself and haven't put it into action yet.

2 Likes

quite helpful! using this very often in my new game.

1 Like