ID:148929
 
The following code is the entire file, btw, so don't worry.
var
player

mob
var
score = 0



mob
Login()
player = "[usr.key]"
usr << "This is a single-player game, do not host. The player is [player]."





world/New()
..()
spawn() ClosePorts()

proc/ClosePorts()
set background = 1
while(1)
if(world.port)
world.OpenPort("none") //closes any open ports

mob
enemy
icon = 'enemy.dmi'
wander = 1
Click()
usr.score += 1
world << sound('gun.wav')

mob
var/wander
New()
if(wander) walk_rand(src)
..()

turf
grass
icon = 'grass.dmi'
spawner
icon = 'spawn.dmi'
proc/Respawn()
for()
new/mob/enemy(usr.loc)
spawn(20) Respawn()
New()
spawn() Respawn()
caller
icon = 'call.dmi'
Bump(O)
player.score -= 1
del(O)


The following are the errors:

loading Aracade.dme
Aracade.dm:59:error:player.score:undefined var
Aracade.dm:58:error:Bump :undefined proc

Aracade.dmb - 2 errors, 0 warnings (double-click on an error to jump to it)
Player.score is not defined. Use usr.score, which you have defined. I'm not sure about the Bump(), but it seems to work fine when it's a child of objs and mobs.
In response to Nathias
Well, that's fixed, but nothing spawns. All you see is a map with grass, the spawner, and the caller. The enemies aren't created.
Bump() is only defined for movable atoms, so it doesn't work for turfs.

mob
Bump(O)
if(istype(O, /turf/caller))
src.score -= 1


Also, this code is problematic (under spawner):

for()
new/mob/enemy(usr.loc)

I'm not sure what the behavior is of for() without any arguments. It is either going to execute continuously forever, or not at all. I doubt either is what you want.

In addition, usr is meaningless here. There is no usr set, so usr.loc will be an unpredictable value. Who were you expecting usr to be here?

You probably want something closer to this:

proc/Respawn()
new/mob/enemy(location)
spawn(20)
Respawn()

But you're going to have to supply a good value for location. I'm not sure where you the respawn to occur.
In response to Nathias
Nathias wrote:
Player.score is not defined. Use usr.score, which you have defined. I'm not sure about the Bump(), but it seems to work fine when it's a child of objs and mobs.

You can't use usr in Bump()--not reliably.
The reason player.score is coming up undefined is totally unrelated to this.

Lummox JR
I can explain your undefined player.score error. This is happening because when you defined var/player, you didn't define it as a mob:
var/mob/player

DM thinks the global player var could be anything, so it doesn't recognize player.score as valid because it can't be sure that player is a mob.

Lummox JR
In response to Drafonis
The game won't start.