msg ("This is a test room. There is a man called Tom here.<br/>")
SetTimeout (3) {
msg ("Tom turns to look at you. \"I sincerely hope you've got some information for me,\" he says. \"Who sent you?\"<br/>")
}
get input {
if (result="terry jones") {
msg ("The man leans forward and grins menacingly. \"Good, good. And did he give you the number?\"<br/>")
}
else if (result="n") {
msg ("\"Whooa!!\" Tom jumps from his chair and grabs you by the chest. \"Where d'you think you're going? Answer the God-damn question first!\"<br/>")
if (result="terry jones") {
msg ("The man leans forward and grins menacingly. \"Good, good. And did he give you the number?\"<br/>")
if (result="1068") {
msg ("He studies you for a while, giving no clue as to if you've told him what he wanted to hear. Eventually he relaxes back in his chair and waves you through to the back room with a nod of his head.<br/>")
}
}
}
else {
msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"<br/>")
}
get input {
if (result="1068") {
msg ("He studies you for a while, giving no clue as to if you've told him what he wanted to hear. Eventually he relaxes back in his chair and waves you through to the back room with a nod of his head.<br/>")
}
else {
msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"")
}
}
}
msg ("This is a test room. There is a man called Tom here.<br/>")
SetTimeoutID (3, "timer_1") {
DisableTimer (timer_1) // if the Timer's following scripts don't run, this code line needs to go at the end of the scripting
msg ("Tom turns to look at you. \"I sincerely hope you've got some information for me,\" he says. \"Who sent you?\"<br/>")
get input {
if (result="terry jones") {
msg ("The man leans forward and grins menacingly. \"Good, good. And did he give you the number?\"<br/>")
get input {
if (result="1068") {
msg ("He studies you for a while, giving no clue as to if you've told him what he wanted to hear. Eventually he relaxes back in his chair and waves you through to the back room with a nod of his head.<br/>")
} else {
msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"")
}
}
} else if (result="n") {
msg ("\"Whooa!!\" Tom jumps from his chair and grabs you by the chest. \"Where d'you think you're going? Answer the God-damn question first!\"<br/>")
get input {
if (result="terry jones") {
msg ("The man leans forward and grins menacingly. \"Good, good. And did he give you the number?\"<br/>")
get input {
if (result="1068") {
msg ("He studies you for a while, giving no clue as to if you've told him what he wanted to hear. Eventually he relaxes back in his chair and waves you through to the back room with a nod of his head.<br/>")
} else {
msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"<br/>")
}
}
}
}
}
}
}I. msg ("This is a test room. There is a man called Tom here.<br/>")
II. SetTimeout (3) {
A. msg ("Tom turns to look at you. \"I sincerely hope you've got some information for me,\" he says. \"Who sent you?\"<br/>")
III. }
// your 'get input' below is going to execute as you wait for the 3 seconds to pass for the display of the 'msg' Script (and it'll be displaying that 'msg' EVERY 3 seconds too): big issues!
IV. get input {
A. if (result="terry jones") {
1. msg ("The man leans forward and grins menacingly. \"Good, good. And did he give you the number?\"<br/>")
// this never gets to your 'if (result = 1068)', as there's no logic-order-heirarchy connection~path to it, as 'B.' is in the way, ending A.).
B. } else if (result="n") {
1. msg ("\"Whooa!!\" Tom jumps from his chair and grabs you by the chest. \"Where d'you think you're going? Answer the God-damn question first!\"<br/>")
// you got no 'get input' for your below (2.) checking of an input. As it stands without the 'get input', this is the il-logic that you got:
// if (not result = "terry jones"), then... yet if (result = "terry jones"), then do 'msg' [ '1)' ]. That makes no sense: if "no", yet if "yes", then do X. "No" is not "yes".
2. if (result="terry jones") {
a. msg ("The man leans forward and grins menacingly. \"Good, good. And did he give you the number?\"<br/>")
// no 'get input' for the checking of an input below (b.)
b. if (result="1068") {
1) msg ("He studies you for a while, giving no clue as to if you've told him what he wanted to hear. Eventually he relaxes back in his chair and waves you through to the back room with a nod of his head.<br/>")
c. }
3. }
C. } else {
1. msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"<br/>")
D. }
// the below (E.) is not connected to it's beginning part (A.) in any way what-so-ever.
E. get input {
1. if (result="1068") {
a. msg ("He studies you for a while, giving no clue as to if you've told him what he wanted to hear. Eventually he relaxes back in his chair and waves you through to the back room with a nod of his head.<br/>")
2. } else {
a. msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"")
3. }
F. }
V. }SetTimeout (3) {
if (player.parent = room5) {
msg ("Tom shoots you")
finish
}
}
msg ("This is a test room. There is a man called Tom here.<br/>")
msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"")if (this.blocked) {
msg ("\"Whooa!!\" Tom jumps from his chair and grabs you by the chest. \"Where d'you think you're going? Answer the God-damn question first!\"<br/>")
}
else {
player.parent = this.to
}
msg ("Tom turns to look at you. \"I sincerely hope you've got some information for me,\" he says. \"Who sent you?\"<br/>")
get input {
if (LCase(result)="terry jones") {
msg ("The man leans forward and grins menacingly. \"Good, good. And did he give you the number?\"<br/>")
get input {
if (result="1068") {
msg ("He studies you for a while, giving no clue as to if you've told him what he wanted to hear. Eventually he relaxes back in his chair and waves you through to the back room with a nod of his head.<br/>")
}
else {
SetTimeout (3) {
if (player.parent = room5) {
msg ("Tom shoots you")
finish
}
}
msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"")
}
}
}
else {
SetTimeout (3) {
if (player.parent = room5) {
msg ("Tom shoots you")
finish
}
}
msg ("The man grabs his gun and points it at your head. \"In three seconds time I'm going to pull the trigger. Get out of here now!\"")
}
}jaynabonne wrote:I personally would not conflate answering the questions with trying to move north. It would either be in the "question has been asked and waiting an answer" state, using "get input" or in the "I'm letting Quest parse things as usual" outside the "get input". If Tom asks a question and you respond "n", it should be the same as any other wrong answer. It seems like it would be less confusing for the player as well.
Just my take.
enemy = GetObject (text)
if (enemy = null) {
foreach (object_x,AllObjects()) {
if (object_x.alias=text) {
enemy = object_x
}
}
}
if (enemy = null) {
msg ("There is no " + text + " here.")
}
else if (not Doesinherit (enemy,"npc")) {
msg ("You can not battle that!")
}
else if (not npc_reachable (enemy)) {
msg ("There is no " + enemy.alias + " in your vicinity.")
}
else if (GetBoolean (enemy,"dead") = true) {
msg (enemy.alias + " is already dead.")
}
else if (GetBoolean (enemy,"hostile") = false) {
msg (enemy.alias + " is not hostile.")
}
else if (battle_sequence (self,enemy) = true) {
msg ("The battle is over.")
} else {
// fight~combat scripting blocks
}
// and:
switch (result) {
case ("Attack") {
value_x = false
if (RandomChance (GetInt (enemy,"agi") - GetInt (self,"spd")) = true) {
msg (enemy.alias + "evaded your attack!")
value_x = true
}
else if (RandomChance (GetInt (enemy,"Dex") - GetInt (self,"agi")) = true) {
msg (enemy.alias + "parried your attack!")
value_x = true
}
else if (RandomChance (GetInt (enemy,"agi") - GetInt (self,"dex")) = true) {
msg (enemy.alias + "blocked your attack!")
value_x = true
}
else if (RandomChance (GetInt (self,"dex") - GetInt (enemy,"spd")) = false) {
msg ("Your attack missed " + enemy.alias +"!")
value_x = true
}
else if (RandomChance (GetInt (enemy,"physical_resistance") - GetInt (self,"hit_chance")) = true) {
msg ("Your attack got resisted by " + enemy.alias +"!")
value_x = true
}
if (value_x = false) {
// you damaging the enemy scripting blocks
} else if (value_x = true) {
// the enemy's combat~fight turn scripting blocks
}jaynabonne wrote:Well, I wasn't going so much on traditions as much as I just felt a cringe seeing the "n" comparison in there - because it opens up a whole bunch of additional cases. What if they type "l"? What if they try to look at the Tom (x tom)? Stuff like that. If you intend it to look like a standard prompt, then it puts a larger burden on you to make it real.
Also, and I forgot to mention this earlier. when does this script happen? Is it as soon as you enter the room, or does the player kick it off with some command? If it's the former, then disregard the rest. If it's the latter, then you'd have to deal with the case of someone typing "n" outside the conversation anyway.
Probably just babbling on my part. I hope that didn't confuse things.
jaynabonne wrote:I suppose it depends on where you want it to go! You can move an object to any room simply by setting its parent (or by using the "move object" script command).
Silver wrote:both of the games I'm writing fall under the dystopia umbrella.
if you're the only person suffering the nightmare then there's no NPCs to worry about. Well there is, but not in the complex human sense.