Read Object not working and Object not in room (solved)

witch wyzwurd
11 Aug 2007, 16:11
I've set up two commands in the Game Commands area: "examine #@Object#" and "read #@Object#".

When a player types in "examine 'object'" a procedure is ran.
When a player types in "read 'object'" another procedure runs.

For the examine procedure and read procedure, I set a condition that if #quest.lastobject# is not in the current room 'and' the player doesn't have #quest.lastobject# then to print a message. But the 'standard default message for an object that doesn't exist' prints. Obviously the object exists, but just not in a room the player is in or in the player's possession. Why does this message print, and even override my condition?

I should mention that I've set up other conditions in both procedures that execute correctly; therefore, Quest does know my object exists, but only when it's in the current room or when I have it.

paul_one
12 Aug 2007, 00:08
you describe what you've done very vaguely.

Without any code, all I can think of is that one of your if's are wrong, or a typo or you could be calling an exec <;normal>..

witch wyzwurd
12 Aug 2007, 01:08
As far as exec; normal goes: I haven't commanded any such script.

Ok, here's the code for each part... conditional between ***'s is inept ASL... obviously I've dumbed up the message areas, flag name, and object name, for quicker viewing... also keep in mind that any other conditions in the Examine_Procedure execute perfectly....


(in Game Command)
command <examine #@Object#> do <Examine_Procedure>


(in Procedure)
define procedure <Examine_Procedure>
***if not here <#quest.lastobject#> and not got <#quest.lastobject#> then msg <Text here!>***
if here <#quest.lastobject#> or got <#quest.lastobject#> then {
if ( #quest.lastobject# = Object_Name ) and not got <Object_Name> then msg <Text here!>
if ( #quest.lastobject# = Object_Name ) and got <Object_Name> and not flag <Flag_Name> then msg <Text here!>
if ( #quest.lastobject# = Object_Name ) and got <Object_Name> and flag <Flag_Name> then msg <Text here!> }
end define


The message, which is only used for badthing, I get when I try to examine object that I don't have and is in another room...


error <badthing; Text here!>

Alex
12 Aug 2007, 09:34
When you set up your command "examine #@Object#", Quest takes care of processing the player's input and, it's trying to resolve the "object" variable in the same way as the built-in Quest commands - i.e. the object has to be visible and in the current room or inventory.

If you want to use some different behaviour, you will need to take care of processing the object name yourself.

To do this, remove the "@" symbol from your command. Your script will then need to check whether the contents of the "object" variable correspond to a valid object name.

witch wyzwurd
12 Aug 2007, 12:53
Ok. That crossed my mind, but I couldn't find that rule is the Quest Documentation. Thanks for clearing that up. I'll move on and figure out how to process the player's command according to what I want done then.

P.s: The QDK Editor does have a much easier set up than Quest 3.53.

witch wyzwurd
13 Aug 2007, 02:33
Hmmmm, I need a hint how to do this.

I've changed my phrase in the Game Command to "examine #Object_Name#.

I've looked through built in variables and tried conditionals like "if an object is defined in the game' but this is new territory for me. And I'm starting to notice the amount of time spent on this is disappointing me. I'll still be trying, but some more help would be nice.

Still trying: I'm going to do this for all of my objects, so I don't want to say... if #Object_Name# is equal to "real name" or "alias names", then... for every object. I'm guessing there's a way to say if #Object_Name# equals a "game's object (real name and alias names", then... (but I don't see a conditional command to do this).

I got my script to execute correctly if I only use the "real name" of the object, but I need to check for aliases... ?

witch wyzwurd
14 Aug 2007, 03:19
Ok I got it working one way... I'm not sure if there's an easier way but what I do is...

1. game-command: examine #Object#
1a. set examine flag on
1b. run object procedure

2. object procedure:
2a. Set string variable name: start name
2b. If #Object# equals "real name" and "aliases" then change string variable to "this name"
2c. If examine flag on then run examine procedure

3. examine procedure:
3a. If string variable equals "this name" then (script for certain object)
3b. set examine flag off

I actually like this method since I'll have full control over the "examine" of all objects and non-objects in one place... if there's a simpler way, please let me know... thanks again!

paul_one
14 Aug 2007, 15:34
Be careful of people typing "examine the object_name" .

You should have:
command <examine the #object#;examine #object#>

witch wyzwurd
14 Aug 2007, 18:56
That's a help. Thanks Tron.