Docs Cookbook
NPC who says something new the second time
Place the NPC (a Villager). In Properties, What is it? ▸ Character, then click Write what they say….
#Without code
- Place the NPC (a Villager). In Properties, What is it? ▸ Character, then click
Write what they say…. The Dialogue tab opens with a Start wired to a Say.
Type the first greeting in the Say:
Hello, stranger! The bridge is out. - Drag from the Start's right dot to empty space and add a Condition node. Set it to
Variable is: Whose Global, Variable
met_villager, Is at least, Value1. - From its Yes dot, add a Say:
Back again? The bridge is still out. - Wire its No dot to the first Say, then from that Say add an Action node:
Set variable, Whose Global, Variable
met_villager, How set, Value1. - Try it: press ▶ Play, talk to the villager (E), walk away and talk again.
#Quick code
Where it goes: on the NPC, Event: *Player presses E (the use key.
*):
if self.met then
self.say("Back again? The bridge is still out.")
else
self.say("Hello, stranger! The bridge is out.")
self.met = true
end
Get an email when Voxel Game Maker launches
It's coming to Steam with a launch discount. One email on launch day, the odd progress update, nothing else.