ID:268747
 
obj
paper
icon = 'paper.dmi'
var/words
var/title
var/makername
var/makerkey
var/paper={"<HTML>
<h2>
[src.title]</h2>
<body>
[src.words]
--------------------------
Made by --
[src.makername]([src.makerkey]
</HTML>
</BODY>
"}

Click()
src.title = input("What would you like to name the paper?","Paper Name","name") as text
src.words = input("What would you like the paper to contain?","Paper Contents","text") as message
src.paper(src)
src.icon_state = "r"
proc
paper()
src.paper = src.words
src.name = src.title
src.makerkey = usr.key
src.makername = usr

Hmm... how would you go about doing that?
It gets undefined vars and a constant expression. :(
You can't set compile time variables to include anything that can change. In your example, at compile time, [src.title] doesn't exist. Set the paper variable's value inside some runtime code, like in your Click() procedure.
In response to Jon88
I have a question about that. I made a browser kinda thing, that has a var that you can set to what you want everyone to see in the game...isn't that the same as what you said?
In response to N1ghtW1ng
No, when you define a variable in code, you cannot put a variable that can change. You CAN build the page as the procedures are called, which is probably what you did, Wing, but what Jon was saying was pretty much to the effect of the examples below.

You can't do this:

mob
var
height = 216
weight = 0.8*src.height //error is here! BAD!


Instead, you would need to do something to the effect of this.

mob
var
height = 216
weight
New()
..()
spawn()
src.weight = 0.8*src.height
In response to Ter13
Oh, well this is what I have
mob
Admin
verb
Browser(mob/PC/M,title as message, blah as message)
set category = "Admin"
var/Title1={"
<HTML>
<BODY bgcolor=blue text=red>
<center><h1>
[title]</h1></center>
<br><br>
[blah]
</BODY>
</HTML>"}

ABrows = 1
world << browse(Title1)

Isn't this defining a variable that can change?
In response to N1ghtW1ng
N1ghtW1ng wrote:
Oh, well this is what I have
> mob
> Admin
> verb
> Browser(mob/PC/M,title as message, blah as message)
> set category = "Admin"
> var/Title1={"
> <HTML>
> <BODY bgcolor=blue text=red>
> <center><h1>
[title]</h1></center>
> <br><br>
>
[blah]
> </BODY>
> </HTML>"}

> ABrows = 1
> world << browse(Title1)

Isn't this defining a variable that can change?

Yes it is. You're doing it the proper way(and the only way that works), at runtime. You can't have var/Title1 be set to that at compile time, outside the procedure.
In response to Jon88
Ah ok I understand now. Thanks for clearing that up.
In response to N1ghtW1ng
_>
How would you make a pop up window?
obj
paper
icon = 'paper.dmi'
var/words
var/title
var/makername
var/makerkey
var/made
var/paper
Click()
if(!src.made)
src.title = input("What would you like to name the paper?","Paper Name","name") as text
src.words = input("What would you like the paper to contain?","Paper Contents","text") as message
src.paper(src)
src.paper={"<HTML>
<h2>
[src.title]</h2>
<body>
[src.words]
<BR>
--------------------------
</BR>
Made by --
[src.makername]([src.makerkey])
</HTML>
</BODY>
"}

src.made = 1
src.icon_state = "r"
else
usr << browse(src.paper)
proc
paper()
src.name = src.title
src.makerkey = usr.key
src.makername = usr

I fixed it...
Would I need to use Javascript to make the window pop-up?
In response to Hell Ramen
http://www.byond.com/docs/ref

Look up the browse proc.
In response to Ter13
That is the best choice, but you can also look here http://developer.byond.com/hub/RaeKwon/PopupWindow
In response to Ter13
Ter13 wrote:
http://www.byond.com/docs/ref

Look up the browse proc.

Thanks. :D