GetDisplayNameLink

MerchantToo
04 Mar 2012, 17:17
Is there a version of this function that I can pass in an exit? I got the exit from the a call to GetObject(GetExitByLink(CurrentRoom, DestinationRoom)). I can't figure out how to do this. It's probably really simple, but I've been scratching my head for ages. Any help greatly appreciated :)

Pertex
04 Mar 2012, 19:59
This one?

GetDisplayNameLink (object,"exit", displayverblist)

MerchantToo
05 Mar 2012, 05:56
Thanks. I was kind of trying to avoid to set up a new string list with the names of verbs in it. I was assuming that that would already exist as a list somewhere but couldn't find it. So I set up a new list as below, and this works well. My next question is: does Quest deal with junking of string lists well and will this give a performance hit down the road if I use this type of set-up multiple times? I can foresee many opportunities where I need an ad hoc stringlist. Would I be better off creating this at the game level just once, rather than every time I jump into this function?

For those wondering why I'm doing this: I want the player to be able to see along corridors and across large rooms in my game. But then only relatively large objects like monsters and NPCs, which will be moving around. In this way the player will be able to see what's coming!

  <function name="DescribeCorridorObjects" parameters="BaseRoom" type="string">
ExitVerbs = NewStringList()
list add (ExitVerbs, "go")
Printed = BaseRoom.InitialDescription
Index = 0
foreach (pointer, BaseRoom.ViewRoom) {
obj = GetObject(pointer)
Prefix = StringListItem(BaseRoom.ViewRoomPrefix,Index)
Direction = GetObject(GetExitByLink(BaseRoom, obj))
Printed = Printed + " " + Prefix + " " + GetDisplayNameLink(Direction, "exit", ExitVerbs)
+ " you can see " + DescribePeopleInRoom(obj, BaseRoom)
Index = Index + 1
}
return (Printed)
</function>


And by the way if I use Direction.displayverbs instead of ExitVerbs, I get a hyperlink on the exit, but it raises an error if I try to click it.

Pertex
05 Mar 2012, 08:01
I think this will not cause a performance problem.
I just tested Direction.displayverbs and its working in my testgame.

MerchantToo
05 Mar 2012, 09:51
Your absolutely right. It does work now. I must have been doing something else wrong at the time. Thanks all the same.