You are here

Talk with a door

14 posts / 0 new
Last post
andgalf
Talk with a door

I've been researching this for a few hours, watched a youtube video on the subject, but didn't get what I really need.

So here is the situation: I want a conversation to start when you click on a door. It is an Illefarn door. I've opened the Properties and set Conversation under Basics to tomb_door, which is the name of the conversation I want to trigger. Then I've gone to Scripts and On Used Script I am using gp_talk_door. I thought that should be enough...but appearently not.

I read on the nexus forums this that Tchos wrote:

"It's a little late, but there is a standard script (actually several of them) that will allow you to talk to placeables.  The one I usually use is called gp_talk_object.  There's another one for doors, called gp_talk_door.

The placeable must not be static, and it must be usable, and the script must go into the On Used slot, and it must have a working conversation in the placeable's Conversation slot, and it must have more than 0 hit points.  It must not be an environmental object."

Is there something I'm missing? I mean the door is not static as it is stated under Behaviour that Static is False. And it is usable, at least I think so because when you click the door in game it opens, but I can't find anynthing about it being usable or not under Properties, so maybe I'm wrong...To my knowledge it's not an environmental object and it has 15 hit points. So, what should I do differently?

Thanks!

  • up
    50%
  • down
    50%
kevL's

did some testing and can't get door-event(s) to fire [eg. OnClick, OnUsed, OnOpen] if the door is going to animate instead.

But if the door is given a fake transition event, that doesn't go anywhere, the door will open first, and it stays open when clicked again, allowing the OnClick (eg.) event to fire okay.

better, if the door is locked (and rendered unpickable..) it stays closed and fires up a dialog as Tchos described.


so you'd have to experiment with variations to see what works in a situation,

 

 

oh, IMPORTANT* I put the script in the OnFailedToOpen event ...

*maybe, other events might work also.

Then (and only then) 'gp_talk_door' ought work

  • up
    50%
  • down
    50%
Shallina

If you want to do something complex, you ll have to script it. On open the door or click door events you put in a script and that script does the job.

 

Depending on the condition, you may want to launch a conversation to an ipoint speaker, or triggering a transition.

  • up
    50%
  • down
    50%
andgalf

Thanks for the replies!

I thought this was a simple thing, not a complex thing, since it sounded like that when Tchos described it, but appearently not. I think I will instead do a speak trigger in front of the door, or something like that, even though that is not optimal since I have a fight in that area, and I wouldn't want the trigger to trigger during the fight. Or maybe the door could be closed and unpickable as one of you suggested...I'll see what I can do...

  • up
    50%
  • down
    50%
kevL's

for example, if you toolset the door locked, with key required but no key IG so that it can't be picked or opened (or just set the DC so high that a pick can't be successful),

a script in the OnFailedToOpen event can

- check if the party is in combat
- unlock the door
- open the door
- start a dialog (or do a transition)

if you want to learn more about scripting it'd be a good lil project, i figure. doors can be frustrating, iirc ...

  • up
    50%
  • down
    50%
kamal

Make the door static. Place a invisible object over the door. Player talks with the invisible object (helpfully named "special door"), not the door itself. When player meets whatever condition to get the door open, the invisible object is destroyed and the door set to non-static.

  • up
    50%
  • down
    50%
andgalf

Thank you KevL's and kamal for your great replies!

I suck at scripiting. I've tried to grasp how it works but I always get a head ache and I'm a very impatient sadly. I'll guess I'll have to really learn some day. Some few things I understand but gets complicated so quickly that I can't get my head around it. I wish there was a crash course or tutorial or something where you could try and make different scripts and have a teacher explain to you how it works....Maybe there is. The big irony is that my brother works as a programmer, and I showed him the toolset and a script the other day, and he just said "Hey, that is very similar to actual programming". He is not that great at teaching though, and would probably be frustrated with my stupid questions.

So, how do I do an invisible object? Do I go to Blueprints and make a door that's somehow invisible?

The only thing I really need is a conversation to start between the door and the player (it is actually just information about the door: that the lock has been broken and that there are some runes on it) and then it is supposed to open  right after. Or that you first click and see this conversation and then can click the door again and make it open...So, I guess first the invisible object starts a conversation, I think I might be able to do that if I know how to make an invisible object, but then to get it to be destroyed...maybe there is some script already that can destroy the object at the end of the conversation? That you can place in the last node of the conversation with the invisible object? Can one be sure that the player clicks on the object and not the door behind though?

  • up
    50%
  • down
    50%
kamal
The "collision box" or collision sphere or something (I'm not in front of my pc) is invisible. If the door is static, the player cant click on it. Place the collision box where the door is so it's what the players click on. When the players meet whatever conditions for opening the door, you destroy the collision box and set the door to not be static via script. Iirc thats DestroyObject (tag of collision box) and SetStatic (False, "tag of door"). Make sure you set the door to be usable before you destroy the collision box.
  • up
    50%
  • down
    50%
andgalf

You're a genious, kamal! This solved the problem. Although, I couldn't make the new "special door" on top of the other invisible (I tried with Appearance and None but that just made the object dissapear somehow altogether), I copied the blueprint of the exact door, gave it the tag special_door, made it locked and and with the conversation on it. On the last node on the conversation I used ga_destroy and that made the special door go away, and underneath it I had my standard door that was not locked.

The only tiny thing, and that I don't care about, is that when you click on the special door the text "locked" pops up like a bark word (or what is it called) when the conversation starts, but I don't think anybody cares about that.

By the way, I just saw your reply. We must have posted almost at the same time. smiley

  • up
    50%
  • down
    50%
Lance Botelle

Hi,

Both of these methods ensure the door stays closed until the builder wants the player to be able to proceed ... after a conversation/action.

I have approached this a number of ways, but one of the simplest (on a non-locked door) is to use the OnOpen hook, and have the script close the door (itself) before starting the conversation. By default there is a very brief open/close of the door animation that may not even be noticeable. And there is a workaround for this if you have the module open/close all doors in an area before the player does it: then the animation does not fire again when they try to open the door. NB: This is best not used if the door opens onto the same area, but only when opening to a new area, as the "room" beyond would be mapped due to the brief opening. However, if it is the entrance to a new area (or just a interactive door), then this works fine.

Second approach: If door is "locked", use gb_talk_object on the "failtoopen"hook.

Cheers, Lance.

The World of Althéa Blog: http://worldofalthea.blogspot.co.uk/

  • up
    50%
  • down
    50%
Trinital

You can't modify the static setting of objects in-game via script AFAIK..

  • up
    50%
  • down
    50%
Molior Rs

What I do is with placeables;

Usable - "OnUsed = nw_g0_convplac"



With doors I use;

Locked door, key required

"OnFailedToOpen = nw_g0_convdoor"

  • up
    50%
  • down
    50%
andgalf

Since last I posted in this thread I modified the talk door stuff. I did it in a much simpler way that I don't know why I didn't think of before.

I just did gp_talk_door on Failed To Open Script on the door, set Locked to True and Plot to True and in the end of the conversation I used the script ga_door_unlock.

I guess it's kind of the same way you did Molior Rs.

  • up
    50%
  • down
    50%
MERP UK

nw_g0_convdoor is your friend. I have created a number of "talking doors" over the years, first time was fiddly as door behaviour is... well, fiddly!

Attach above script file to OnFailToOpen event for the door. Make the door plot and locked (key only). Write and attach the necessary conversation to the door. Once the conversation reaches the point you wish for the player to pass the door, if at all, use the actions tab in the conversation ending to unplot the door and unlock it.

  • up
    50%
  • down
    50%