In my game theres this bit of code (For a book):
(BN and T are vars..)
BN = "The Lands of Unknown.. A begginers guide"
T = {"
Blah... \icon [src]
"}
when the player Click()'s the book the following is executed:
usr << browse(src.T,"window=help")
Most of the above code was lifted from the help file and reconfigured, the \icon [src] turns up:
world.dm:133:error:src:undefined var
world.dm:133:error::expected a constant expression
Could anyone tell me how to fix this?, Where to look?, Who to pay?
Thanks in advance-
Thorg
ID:173365
Jan 13 2004, 7:05 am
|
|
In response to Volte
|
|
the BN and T variables belong to a turf called Bookcase, when a player searches a bookcase it spawns a new obj/book in there inventory changes the Books name to BN and the text in the book to T when the player clicks the book it displays T.
EDIT: I've also tried to put <head><title>[BN]</head></title> instead of <head><title>The Lands of Unknown.. A begginers guide:</title></head> world.dm:133:error:BN:invalid variable world.dm:133:error::expected a constant expression Thanks Volte for the browse_rsc proc help. Thanks in advance.. -Thorg |
In response to Thorg
|
|
Thorg wrote:
the BN and T variables belong to a turf called Bookcase, when a player searches a bookcase it spawns a new obj/book in there inventory changes the Books name to BN and the text in the book to T when the player clicks the book it displays T. Here's a better way of doing it (if you're interested). First, make a list variable in the bookcase, containing the paths of the books you want stored in it. turf/Bookcase Then, you set up those book objects.. obj Now that everything is set up, we alter Bookcase/New() to create the types that are in it's Books list. turf/Bookcase Tadaa. Done. Now you just need to make a verb or something to get books from it. turf/Bookcase That should make handling books a lot easier. If you want to reference the book's variables in the text of the book, you need to set the variable in the book's New() procedure. ~>Volte |
In response to Volte
|
|
Can i use HTML in the books text variable?
-Thorg |
In response to Thorg
|
|
Thorg wrote:
Can i use HTML in the books text variable? Yup. I use the normal browser window, so you can change it to a pop-up window if you want. ~>Volte |
In response to Volte
|
|
Thanks a trillion Volte!
-Thorg |
Well, normally you could just place variables in it like normal text, but since you want to put an icon in there, you need to use browse_rsc(). Also, where are you setting the T and BN variables? It seems there is no source.
~>Volte