How to best make intraction with NPC only after anothering condition is met?

So I'm imagining a situation where Player enters a room but can't properly interact with NPC X until they've executed a "Climb to" action. How is the best way to execute this?


I'm fairly new, so my work-around might be silly and clunky compared to something like mrangel or the pix could make.

I'm imagining that NPC x is either too high to hear, or giant. and that the climbing "to" is up to a place from which they can hear you better?

You could do something like making the place they're climbing to a surface that the player would then be "on" and make the "talk to" verb in the room for that NPC check to see if the character is on that surface.

Or you maybe could do something like set a flag or counter on the player when they execute the "climb to" which the "talk to" would check for?

Those would be my first two things to try. But again, I've only been here a couple of months.


I'm assuming you want the person to still be visible even if you can't talk to them, in which case you can set a flag or variable to True during the script for your "Climb to" action, then have the "Talk to" Script check if it's true via a simle if statement.

aka

this.HasClimbed = True

for climbing and

if([Object].HasClimbed){msg("Talking Range")}
else{msg("Not in Talking Range")}

for talking to your character. Or use flags, I should prolly do that more myself...

If you want to be slightly more advanced and not even show the Talk To verb to the player until they climbed up, you could delete the verb from the displayverb list in the editior and then add

list add([ObjectName]).displayverbs, "Talk To")

to the climb script. Of course you should still keep the check in this case, lest a sneaky player might just type the command in manually, even if it's not shown.


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

Support

Forums