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 = {"
<body>
Blah... \icon [src]
</body>
"}
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, 10:05 am
|
|
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 | |
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.
Then, you set up those book objects..
Now that everything is set up, we alter Bookcase/New() to create the types that are in it's Books list.
Tadaa. Done. Now you just need to make a verb or something to get books from it.
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 | |||||
Can i use HTML in the books text variable?
-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 | |
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