ID:263046
 
Code:
world
status = "<b><font face='Times New Roman' size=2 color='black'>( A Random Game |Version 2|[world.name]) - [Host]'s Server - [ppl] players connected."

mob //makes whatever is up a /mob
var //whatever is next is a /mob/var (variable)
host = "" //The Var!


Problem description:loading RM.dme
RM.dm:6:error:host:undefined var
RM.dm:6:error::expected a constant expression

RM.dmb - 2 errors, 0 warnings (double-click on an error to jump to it) Why doesn't this work so this will work on the hub. Thanks for your help and time.


When you define the host var under the mob tree, you spelled it with a non-capital "h", but when outputting the status, you used a capital "H".

Also, when you send out the status, it will not know what you want outputted by "Host" due to there not actually being a world/host variable. What I mean is, you should make the host a world variable instead of a mob variable like so:

world
var
Host="[host name]"
status = "<b><font face='Times New Roman' size=2 color='black'>( A Random Game |Version 2|[world.name]) - [Host]'s Server - [ppl] players connected."
In response to Satans Spawn
I still get errors with all of this. Need me to post them?
In response to Kiyo Takamine
I didn't do all of the work for you, I mostly just pointed you in the direction you need to go. for example, where I wrote:

world
Host="[host name]"


I was merely implying that, that would be where you would put the name of the host after running your usual host determining procs and so forth.

Although, you may have understood that, so I suppose that I will look at your other errors as well.
In response to Satans Spawn
Alright.

So all I'd have to do is put the vars I used under "World". Right?
In response to Kiyo Takamine
Not all of them, just the ones that you are going to be outputting with your status. (I am not too sure of how to do this, because I have never actually used the status proc yet.) But the way you have it set up, that does seem to be the solution.
world
New()
..()
status = "Host: [host]"

var/host

mob/Login()
if(src.client.address == world.address)
host = src.key
update()
proc/update()
world.status = "Host: [host]"


Also, Don't forget to close your HTML tags.
In response to Satans Spawn
Thanks Crzyl, Its working! and thanks for your time too Satans Spawn. But I get this error even when I use host as a world var, I also used it was a mob var too(For Back Up).
world
var
host
mob
var
host = ""
loading RM.dme
RM.dm:14:error:host :variable declaration not allowed here

RM.dmb - 1 error, 0 warnings (double-click on an error to jump to it)


So I'm at a Stopping Point >.<
What now.. I made a var and Dream Maker is being mean O.o
In response to Kiyo Takamine
Kiyo Takamine wrote:
> world
> var
> host
> mob
> var
> host = ""
> loading RM.dme
> RM.dm:14:error:host :variable declaration not allowed here
>
> RM.dmb - 1 error, 0 warnings (double-click on an error to jump to it)


Sorry. I was mistaken on where it would go. I forgot that you can't define vaiables for the world.

If you look at Crzylme's post again, his code has host defined under no set path, which would mean it is a global variable, which is what I was really thinking of making it. so your code should like like:

 world
var
host


You also no longer need to give the mobs a host variable, unless you wish for the host to be highlighted somehow in game, in which case, you will not be able to define it as you did, you would have to change it to "Host" or something along the same lines, as you cannot have two variables with the same name.