ID:138903
 
I'm fairly new to programming, so this might be Stupid Question #456 million, but I'm stumped. I went through the beginning guide several months ago and managed to get my mob to move, but here I'm having trouble and can't figure what I did wrong.


Code:
mob
Login()
world << "Hello, world!"//words of player on login

icon = 'player.dmi'

verb
smile()
world << "[usr] grins."//emote coding
giggle()
world << "[usr] giggles."//emote coding
cry()
world << "[usr] cries \his heart out."//emote coding
say (msg as text)
world << "[usr] says, [msg]."//speech coding
move()
world << "[usr] moves."//player moves around
turf
floor
icon = 'floor.dmi'//creates somewhere player can walk
wall
icon = 'wall.dmi'//creates boundaries for player in maze
density = 1//defines an area player can't move through
mob
icon = 'player.dmi'


Problem description:I have a map, and the wall's got density, but I keep getting stuck when I try to make the mob move around on the floor. So I tried to put in move() and didn't get anything from that either. What am I missing?

JAHowe wrote:
I'm fairly new to programming, so this might be Stupid Question #456 million, but I'm stumped. I went through the beginning guide several months ago and managed to get my mob to move, but here I'm having trouble and can't figure what I did wrong.


Code:
mob
> Login()
> world << "Hello, world!"//words of player on login
>
> icon = 'player.dmi' //
>
> verb
> smile()
> world << "[usr] grins."//emote coding
> giggle()
> world << "[usr] giggles."//emote coding
> cry()
> world << "[usr] cries \his heart out."//emote coding
> say (msg as text)
> world << "[usr] says, [msg]."//speech coding
> move()
> world << "[usr] moves."//player moves around
> turf
> floor
> icon = 'floor.dmi'//creates somewhere player can walk
> wall
> icon = 'wall.dmi'//creates boundaries for player in maze
> density = 1//defines an area player can't move through
> mob
> icon = 'player.dmi' //
>
>

Problem description:I have a map, and the wall's got density, but I keep getting stuck when I try to make the mob move around on the floor. So I tried to put in move() and didn't get anything from that either. What am I missing?

You defined the mob's icon 2 times :o
You don't need to use move() to walk....
How do you get stuck? Try setting the floor's density to 0.
In response to Tensa Soul
I removed the second mob definition (so the only one is by the Login message), and set floor to 0 density. Even so, I still can't make the player icon move (sorry, that's what I meant by "stuck"). And for some reason the only place I can put the icon is on the walls, not in the area defined as "floor"! Really confused here.
In response to Tensa Soul
mob
icon = 'player.dmi'

Login()
world << "Hello, world!"//words of player on login
..() // Place this, use the default parent inherited.

verb
smile()
world << "[usr] grins."//emote coding
giggle()
world << "[usr] giggles."//emote coding
cry()
world << "[usr] cries \his heart out."//emote coding
say (msg as text)
world << "[usr] says, [msg]."//speech coding
turf
floor
icon = 'floor.dmi'//creates somewhere player can walk
wall
icon = 'wall.dmi'//creates boundaries for player in maze
density = 1//defines an area player can't move through
In response to JAHowe
Under the floor code, set density to 0.
In response to Dr.DraX
Dr.DraX wrote:
Under the floor code, set density to 0.

Density is 0 on default for turfs, its default on 1 for mobs.
In response to JAHowe
JAHowe wrote:
I removed the second mob definition (so the only one is by the Login message), and set floor to 0 density. Even so, I still can't make the player icon move (sorry, that's what I meant by "stuck"). And for some reason the only place I can put the icon is on the walls, not in the area defined as "floor"! Really confused here.

Hey,i have some theories to that.
1)Have you set an custom interface to your game?
if you done that,have you deleted macro?Cuz if deleted,it's sure the character will not walk when pressing the buttons,and you will need to configure it manualy.
2)TensaSoul have given a tip,maybe,2 or more of your character are spawning,and you'ren't knowing.
In response to Nakano15
Nakano15 wrote:
JAHowe wrote:
I removed the second mob definition (so the only one is by the Login message), and set floor to 0 density. Even so, I still can't make the player icon move (sorry, that's what I meant by "stuck"). And for some reason the only place I can put the icon is on the walls, not in the area defined as "floor"! Really confused here.

Hey,i have some theories to that.
1)Have you set an custom interface to your game?
if you done that,have you deleted macro?Cuz if deleted,it's sure the character will not walk when pressing the buttons,and you will need to configure it manualy.
2)TensaSoul have given a tip,maybe,2 or more of your character are spawning,and you'ren't knowing.

3) Are you using any of the built-in movement procs? (Such as Move(), South(), North(), East(), West(), etc?)
In response to Deathscyth15
But at the end of the code it says density=1, and they are both in one "turf". So wouldn't it set both as 1?
In response to Dr.DraX
Dr.DraX wrote:
But at the end of the code it says density=1, and they are both in one "turf". So wouldn't it set both as 1?

No, turf is the parent and Floor or Wall are the children from turf. They get everything from the parent and the things you add extra. Because density was set on wall it would only affect that child(in this case only the wall icon).
In response to Ocean King
no, I had Move() but removed it.
In response to Nakano15
no custom interface; I'm just going through the guide at the moment to practice, you see. So I didn't put in anything like that. Oddly yes I ended up with a bunch of the player icons when I futzed with the map, but that was because I kept mistakenly hitting a key that put them there. So they didn't spawn at random.
In response to Dr.DraX
already did that one
In response to JAHowe
Start a fresh environment. and redo the tutorial.
In response to Slic3y
Yeah, I think that makes sense - very frustrating but I agree. Thanks to you and everyone else who's tried to help here.