Hello,
I have recreated some doors with the code from the demo room2
and it seem to work, but on one case I have a door that goes to the left instead of up, the problem here is, when you open the door and then click it, to walk through, the player goes up a bit and then changes the room. But he should go to the left, into this door, instead of up. Is that somehow "hardcoded" in the engine / template or how can I fix this?
The help section on tumbleweed-doors does not mention the walk-through-animation before the room is changed.
Another problem regarding this topic:
As far as I know it is supposed to work like this:
you design your backgrounds with the doors closed, and then add the opened door as an object, that gets hidden or unhidden in the script..
In my case when the door is open, the open-door-sprite is rendered in the foreground (over the player in z-order), and therefore the player walks behind it, it looks weird and is immersion killing, it should be on a layer under the player, is this possible or am I doing something wrong?
edit: regarding first post, Ive fiddled around with scripts and hotspot extensions and now cant recreate the issue, not sure really what I did
Each object has a baseline used to determine the drawing order. You can move it further up so the open door sprite appears behind the player.
It works, :grin:
Thank you @Khris, this was an easy fix
Another thing that bugs me with doors at the moment is this:
open/close is working fine, but if you Look at it, the player always says "a solid door", I would like to define my own sentence when the player looks at a door, and not let him use the same predefined speech from the unhandled-event strings for every door. When I use this code the player says my text but still also says the "solid door" sentence
Spoiler
function hDoor3_AnyClick()
{
if(Doors.AnyClick(40, oDoor3.ID, 192, 91, eDirectionUp, 8, 213, 127, eDirectionUp) == 0 ) Verbs.Unhandled();
// OPEN
if(Verbs.UsedAction(eGA_Open))
{ player.Say("Event Anyclick Open works");
}
// LOOK AT
if(Verbs.UsedAction(eGA_LookAt))
{ player.Say("Event Anyclick Look works.");
}
}
What is wrong with it or how do I get rid of it?
Well, you are telling it check if it's anyclick and run "Verbs.Unhandled()", which of course it is.
Then you check if it's Open, it'll be true if you used Open, and then you check for Look, which will be true if you use Look.
What you want is:
{
If Open ... do this
else if Look ... do that
else ... do Verbs.Unhandled()
}
Which translates in: Check if it's open, run if it is and end the block. If it's not Open check if it's Look, run the code if it is and end the block. If it's not Open nor Look, then run the Verbs.Unhandled() and end the block.
You can use Doors.SetDoorStrings(...); to change the text, but that's rather supposed to be used to change the default messages and less to implement individual door descriptions.
However you can probably use something like this:
function hDoor3_AnyClick()
{
// LOOK AT
if(Verbs.UsedAction(eGA_LookAt)) {
player.Say("A custom description of the door."); // just a regular "look at hotspot" interaction so far
}
// all other verbs
else if (Doors.AnyClick(40, oDoor3.ID, 192, 91, eDirectionUp, 8, 213, 127, eDirectionUp) == 0) Verbs.Unhandled();
}
Your code works perfect :grin:
Thanks again, very good job, much appreciated!