ID:145247
 
Code:
world
view = "21x15"
version = 0.4

client
command_prompt = "Kaefé - Legacy of Atlantis v0.4"

mob
player
var/tmp
atom/movable/HUD/DLmeter

Login()
alert("Welcome to Kaefe - Legacy of Atlantis. Please bear in mind that this game is not yet finished and some features are yet to be implemented. Enjoy!","Kaefe-Legacy of Atlantis","OK")
src.icon = 'Akiro.dmi'
client.lazy_eye = 1
DLmeter = new(src, "Health", "2,NORTH", "darklight", 'kaefe.dmi')
src.Move(locate(25,15,1))


Problem description:
DLmeter: undefine var. The var is there, am I missing something or did I forget to add something? I can't understand why this isn't working

Login() isn't under mob/PLayer, but you did defined the var under mob/Player
Another problem with that code is that you're using Move(). If the location is already occupied, Move() will fail, so you need to have a backup location. If you want all players to start there, set loc directly instead of using Move() to do it.

Lummox JR
In response to Mysame
Mysame wrote:
Login() isn't under mob/PLayer, but you did defined the var under mob/Player

oops! thanks for pointing that out but I still get the same message-
DLmeter: undefined var
In response to TheLunarWolf
TheLunarWolf wrote:
Mysame wrote:
Login() isn't under mob/PLayer, but you did defined the var under mob/Player

oops! thanks for pointing that out but I still get the same message-
DLmeter: undefined var

That shouldn't be happening if you changed the code. There are two changes you could make. The first is to use mob/player/Login() instead of mob/Login(). The second, better way is to simply define DLmeter under /mob instead of under /mob/player. Had you made either of those changes, that error message wouldn't be occurring.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
That shouldn't be happening if you changed the code. There are two changes you could make. The first is to use mob/player/Login() instead of mob/Login(). The second, better way is to simply define DLmeter under /mob instead of under /mob/player. Had you made either of those changes, that error message wouldn't be occurring.

Lummox JR

OK I tried both ways you suggested and still the error remains. (This is starting to really bug me)
In response to TheLunarWolf
TheLunarWolf wrote:
OK I tried both ways you suggested and still the error remains. (This is starting to really bug me)

Frankly, that's not possible. If you made either correction, it would compile without that same error message. Can you post the code you used?

Lummox JR
In response to Lummox JR
Lummox JR wrote:
TheLunarWolf wrote:
OK I tried both ways you suggested and still the error remains. (This is starting to really bug me)

Frankly, that's not possible. If you made either correction, it would compile without that same error message. Can you post the code you used?

Lummox JR

I put the var in mob instead of player:-
mob
var/tmp
atom/movable/HUD/DLmeter

mob
player
Login()
DLmeter = new(src, "health", "2,NORTH", "darklight", "DL", 'kaefe.dmi')
alert("Welcome to Kaefe - Legacy of Atlantis. Please bear in mind that this game is not yet finished and some features are yet to be implemented. Enjoy!","Kaefe-Legacy of Atlantis","OK")
src.icon = 'Akiro.dmi'
src.Move(locate(25,15,1))//This is the only thing going to those co-ords at login
..()

In response to TheLunarWolf
As far as I've experienced, doing that will result in something like

mob.player.DLMeter

This being because you put it under mob/Player and added the var without any datum.

Try src.DLMeter