ID:175849
 
world
name="DBZeta Classic Remix Server [host] is Hosting."

I get this error
new_char_handling.dm:64:error::expected a constant expression
<font color="#FF0000">WARNING: I'm not a BYOND expert.</font>

world.name wants a constant expression. Because you put "[host]" when setting the value of world.name, it is no longer a constant because the value of host can change. To fix it, remove "[host]" from your string.
Coolroman123 wrote:
world
name="DBZeta Classic Remix Server [host] is Hosting."
I get this error
new_char_handling.dm:64:error::expected a constant expression

Well, I'll forgo the obvious joke. The reason this is a problem is that the [] syntax is only good inside a proc. Remember, the code you just showed has to be interpreted when the game is compiled, and the compiler doesn't know in advance who the host is going to be.

What you really want is to set this in a proc. Setting it in mob/Login() will do, at the same time you set the host var.

Lummox JR
In response to Lummox JR
heh...I didn't catch that. :-P

*logs out and goes back to his corner*
In response to Lummox JR
ahhhhh IT messed up.
What I am trying to do is to is have the name of the world tell who is hosting.How would I do this?
In response to Coolroman123
By changing it when the game is hosted.
In response to Coolroman123
Coolroman123 wrote:
ahhhhh IT messed up.

You'll have to be more specific. How did you try to change the code? What does it look like now?

Lummox JR
In response to Lummox JR
var/global/address
mob/var/ishost=0
var/host=""
mob/proc/checkhost()
if(client) //the the mob has a client
if(client.address==null | client.address==world.address | client.address=="127.0.0.1") host() //but the client is read as null
mob/New() //starts when a mob is created
..() //other stuff first
spawn() //spawn
checkhost() //check for host
mob/proc/host()
world << "[name] is hosting." //they are the host
ishost=1 //so give them the variable
host="[usr.name]" //give the world the variable
mob/Login()
world
name="DBZeta Classic Remix Server [host] is Hosting."

In response to Coolroman123
nmv I got it
nvm I don't got it
YaY I got it