Room Description - Run a Script
steve the gaming guy
21 Nov 2006, 20:13I discovered this option last year:
It works great for the most part. When you select this option for a room, it breaks the room into two sections; one for the description of the room and one for the script to be run in the room. When you add the #quest.lookdesc# variable to the script part, it will cause the gamer to see only the description that you wrote in the description window. It will not show the name of the room nor the available exits nor any objects in the room.
As far as not showing the exits, that's fine. That was sort of my intention. But instead of me having to use a conditional statement to display objects in the room, I was trying to get one of the other variables to work. For instance, in the past I did something like "if rock is in the room, print message "A rock is in the room"
I don't want to do that.
I tried doing the following:
and
and
just to try to get some response or output but all I keep getting is the room description only. Any suggestions? Keep in mind, I was using QDK. I don't think it matters that it was the beta 4.0 version.
Run script allows you to specify a script to run, useful if you want to manually generate a more complex room description than the Standard style. When this option is selected, you need to specify a script, and you can optionally specify some description text, which you can print within your script by printing the #quest.lookdesc# variable.
It works great for the most part. When you select this option for a room, it breaks the room into two sections; one for the description of the room and one for the script to be run in the room. When you add the #quest.lookdesc# variable to the script part, it will cause the gamer to see only the description that you wrote in the description window. It will not show the name of the room nor the available exits nor any objects in the room.
As far as not showing the exits, that's fine. That was sort of my intention. But instead of me having to use a conditional statement to display objects in the room, I was trying to get one of the other variables to work. For instance, in the past I did something like "if rock is in the room, print message "A rock is in the room"
I don't want to do that.
I tried doing the following:
#quest.lookdesc#
#quest.objects#
and
#quest.lookdesc#
#quest.formatobjects#
and
#quest.lookdesc#
#quest.lastobject#
just to try to get some response or output but all I keep getting is the room description only. Any suggestions? Keep in mind, I was using QDK. I don't think it matters that it was the beta 4.0 version.
witch wyzwurd
21 Nov 2006, 21:25Hey Steve, are you a dad again yet? Congratz either way.
I'm going to run you thru a simple exercise so you can see different options that exist concerning your question...
1. Create a room with only one object
2. Print a room description in "script edit" box
3. Write #quest.lookdesc# in bottom box.
....okay, now room description should show in game-window....
4. In "script edit" box, goto Print command and type in #quest.objects#.
....in game-window you'll see room description and object....
5. Create a second object and re-run the game.
....in game-window you'll see room description but no object....
6. In "script edit" box, goto Game Control, click Run a script for each object in room, (select room), push edit script, push add command, click Print and type in #quest.thing#, ok everything and save game and re-run.
....in game-window you'll see room description and both objects....
Note: Works for 2 or more objects.
Why? Because you have to account for each item, which is what the run script for each item handles. The quest.objects/quest.thing part is something Alex taught me, but I am not confident enough in my understanding of it to be a mentor for.
I'm going to run you thru a simple exercise so you can see different options that exist concerning your question...
1. Create a room with only one object
2. Print a room description in "script edit" box
3. Write #quest.lookdesc# in bottom box.
....okay, now room description should show in game-window....
4. In "script edit" box, goto Print command and type in #quest.objects#.
....in game-window you'll see room description and object....
5. Create a second object and re-run the game.
....in game-window you'll see room description but no object....
6. In "script edit" box, goto Game Control, click Run a script for each object in room, (select room), push edit script, push add command, click Print and type in #quest.thing#, ok everything and save game and re-run.
....in game-window you'll see room description and both objects....
Note: Works for 2 or more objects.
Why? Because you have to account for each item, which is what the run script for each item handles. The quest.objects/quest.thing part is something Alex taught me, but I am not confident enough in my understanding of it to be a mentor for.
steve the gaming guy
22 Nov 2006, 21:19Hey there,
Yes, I'm a new dad again. Thanks.
If I understand what you're saying... one object should be #quest.thing# and two or more should be #quest.objects#
I already had two in the room when I tried #quest.objects# and it does not show anything other than the room description. I guess I will fiddle around with it more and temproarily take out the second item and put it back in to see if that does anything. ??
Thanks for the tip though.
Yes, I'm a new dad again. Thanks.
If I understand what you're saying... one object should be #quest.thing# and two or more should be #quest.objects#
I already had two in the room when I tried #quest.objects# and it does not show anything other than the room description. I guess I will fiddle around with it more and temproarily take out the second item and put it back in to see if that does anything. ??
Thanks for the tip though.
witch wyzwurd
24 Nov 2006, 20:495. Create a second object and re-run the game.
....in game-window you'll see room description but no object....
6. In "script edit" box, goto Game Control, click Run a script for each object in room, (select room), push edit script, push add command, click Print and type in #quest.thing#, ok everything and save game and re-run.
Steve, I took the time to give you step-by-step instructions for a learning process, you could at least go thru the steps. You'll have no questions if you do.