How to Temporarily Disable Player Input Without Letting The Player Know?

chellkafka
The idea is, whilst having a conversation, you can choose a hyperlink(a dialogue choice), which will offend a NPC, and that should be punctuated by 5 seconds of "silence", so, no reply for 5 seconds. The problem is, that I would like it if the player would be able to choose other dialogue choices without the NPC replying and also no new dialogue choices appearing, before the tension is resolved.
I know, that I could achieve that with a variable and a lot of if-scripts, but I was wondering if there was a more elegant or efficient or time-consuming way.

HegemonKhan
there's always: Timers, and maybe you can use also:

http://docs.textadventures.co.uk/quest/ ... riter.html
http://docs.textadventures.co.uk/quest/ ... amble.html

also, you can use Integer Attributes too (you 'decrease~count down or increase~count up' it after each later script, or if able outside of a script block, via internal turns via through using Turnscripts and~or the special 'changed' Script Attribute, but it'll require more scripting~coding design work than using a Timer

chellkafka
Ok, so I fixed the title because I realised it wasn't at all what I was looking for.
So, what I want is this situation:
-----------------------------------
NPC: "That was funny, right?"

PC: 1."Sure."<--(chosen)
2."Haha."
3."Where am I?"

(5 second pause)
NPC:"Then why didn't you laugh?"

PC: 1."What?"
2."Where am I?"<--(chosen)

NPC: (nothing)

PC:1."What?"
---------------------------------------
So, when "Sure." is chosen, you piss the NPC off and there is "tension". While there is "tension", I want the player to be able to say anything, it enabled by that point, but I want the NPC to not reply to anything but the things that potentially will resolve the "tension". So, I know I could make a variable "room.tension" and I could put an if script "if (room.tension=true)" into all the commands, to make this work, but I want the player to have a lot of dialogue choices and that would be a lot of work, so I was just wondering if there is a more simple or elegant way to go about this.
Is it clear at all?

chellkafka
Alright, so I think I figured out a way how to do it. I bring the player to another room, paste the turn script that shows the dialogue choices into the room without pasting the commands that are addressed by the hyperlinks and then use a getinput-script for the dialogue choices that will bring him back to the other room. It worked so far in playtesting.
If anyone finds a flaw in that plan, please, write.

TinFoilMkIV
So assuming you don't wan't the player to be able to do anything outside your scripted responses (ie: no walking away, looking in their inventory or any number of things the player could freely do if they weren't talking to an npc), then I believe I have a solution for you.

I'm not sure how your scripting your npc dialogue, but for this case you'll want to use a get input. Basically it creates a temporary 'result' variable that stores whatever the player enters next, and doesn't consider that text for any other actions. This allows you to make a completely controlled situation where the player cannot enter any commands that you don't specifically allow.

The second part is using a switch to set up some scripted responses to the players options. You can use a series of if/elses here as well but I prefer switches in this case personally. Now something you will need to account for is that the get input will only check the first input, so you will need a method of restarting the input section of the script when the player doesn't choose an acceptable option, which will also be used to prevent the player from leaving the conversation during the tension period, only allowing them to attempt different responses until it is resolved.

To create a loop in the conversation I would recommend creating the looping section as its own function or script separate from the rest of the related script. While it may take a little bit to figure out and get used to, I would say using a script type attribute on the npc would be the best option I know of to keep things organized. Fortunately it's not actually that hard, you will just need to create an appropriately named attribute on the npc, set the type to script, then you can activate it with the do script. This will then allow you to restart the code that keeps the conversation going until you want it to end.

So time for some examples of how this actually looks put together

//whatever happens that starts the npc interraction

msg ("That was funny, right?")
msg ("")

do(NPC, "ConvoLoop")

/.........
//this is what goes in the ConvoLoop attribute of the npc

if (npc.tension = 0) {
msg("{command:1:1."Sure." ")}
msg("{command:2:2."Haha." ")
msg("{command:3:3."Where am I?" ")

get input {
if (npc.tension < 5){
//when tension reaches desired level for npc response, ignore player input and have npc continue the conversation
switch(result)
case (1) {
npc.tension = 1
do(NPC, "ConvoLoop")
}

case (2) {
if (npc.tension = 0)
//default response
else
do(NPC, "ConvoLoop")
}

case (3) {
do(NPC, "ConvoLoop"
}
}
else
//continue conversation from here after npc finally responds
}

This isn't by any means complete, more of an outline of how I would get the results your looking for, there will likely be quite a bit more too it depending on how you want the conversation to be able to play out, but hopefully this helps some. Important to note that in this script the tension timer never actually increases, that will have to be done separately depending on how you decide to control it.

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

Support

Forums