How To: Make a Sign You Can Talk To

LightPhoenix

First Post
Okay, I haven't has as much time this weekend as I thought, but I figured I'd post something now. While playing on Lazybones' server (which was a blast! Even if my computer crashed :( ) I noticed that in order to read the sign, you had to "Examine" it. While it's a viable option, it's not one I chose to go with designing my soon to be playable module. I like the conversation GUI better, so I learned a simple trick that I thought I'd pass on to you.

This trick is two-fold, and it gets a little bit into scripting.

First, on placeable properties. Every placeable (tables, signs, etc) in the game has a set of scripts that are attached to it. Most of these are either left blank or assigned to a default script by the editor when you put the chest down. On of the most useful, IMO, is "OnUsed".

If you haven't guessed already, if there is a script in the OnUsed line, it will be run when the object is used. Since we want the sign to start a conversation when it is used, this is where we're going to put our script.

First, write the conversation. The Conversation Editor is decently documented, so I'm not going to go over the how-to of that. Name the converstaion con_bboard (or whatever you want).

Open up the Script Editor and input the following code. Note that this is case-sensative:

Code:
void main()
{
     object oUser = GetLastUsedBy();
     BeginConverstaion("con_bboard", oUser);
}

The first line declares an object and names it oUser. GetLastUsedBy gets whatever last triggered the OnUsed event. In this example, it would be whatever player last clicked on the sign to read it.

The next function, BeginConversation, simply starts the conversation engine. The first parameter is the name of the conversation you wrote earlier and that you want to be displayed when you click on the sign. The second parameter is the player that we want to display it to. In this case, we get whatever triggered the script and show the conversation to him/her.

Feel free to ask any questions. I'll post another installment (making a Potion of Heroism) tonight.
 

log in or register to remove this ad

Thanks for the info, LightPhoenix. Although it does seem, from the player's perspective, as complicated as doing an examine action. Does the text pop up in a conversation window, or in white text above the object? Does everyone else see it?

Look forward to seeing your project,
LB
 

It's just like initiating a conversation with an NPC... Aribeth, sign, it makes no difference :) There's nothing wrong with Examine, I just like the layout of the conversation gui better. One click, you get any information you need. Call me lazy ;)
 

Heh, easier to make it useable and list it as having inventory and then name it whatever you want it to say. That way all you have to do is just scroll your cursor over it. Works pretty good unless it's a real length sign.
 

Actually, you don't even need an inventory, just make is useable - I've done that a lot with some placards.

This is more for things like bulletin boards, where you have a lot of text. Or objects where you can pick and choose what to read - for example, a player might choose to take on one quest out of seven or eight options on a board.
 
Last edited:

Yeah it confused me as well as to when you would want to use this, since you can just rename the object and make it usable to have it give its name on "mouse over".

But the idea of a notice board does seem to lend itself to your conversation method.
 

Remove ads

Top