ID:1714183
 
Keywords: a, as, define, dev, mob, player, rougelike, the
(See the best response by Crazah.)
I am building a rouge like and am working off of this code for turn based movement. (Thanks to Kaiochao for the code :) )
mob
proc
// Players call this whenever they do something.
// NPCs have this called by players.
Act()

npc
// When it's the NPC's turn to act,
Act()
// step towards a player nearby
for(var/mob/player/p in ohearers(src))
step_towards(src, p)
break

player
// Whenever the player moves successfully, it has acted
Move()
. = ..()
if(.)
Act()

// When the player has acted,
Act()
// Notify every nearby NPC
for(var/mob/npc/npc in ohearers(src))
npc.Act()

verb
// A verb to stand still for a turn
wait()
Act()

PROBLEM:When I try to get the NPC to follow the player it sits still, I am thinking that its because the npc doesnt note that I'm the player here is how I defined the mobs:
//I am unsure how to define the player mob as //player lol I think thats why it doesn't //work :P
mob
icon = 'icons.dmi'
icon_state = "player"
var
hp = 100
str = 8
def = 8
New()
Act()

mob/npc/npc
icon = 'icons.dmi'
icon_state = "monster"
hp = 25
str = 6
def = 5
New()
Act()

I'm sure my mistakes are apparent lol Thank you in advance for your help :)
Best response
You have not defined your mob as a player type. That specific Act() method is defined under mob/player not /mob
I have been trying to define it as the player and I can't figure out how, It seems no matter what when I start I don't get the verbs and the npcs don't follow me, I'm sure its simple to do but I can't seem to find a post on defining the player as a specific mob.

thank goodness, I figured it out!

it's

world
mob = mob/player

So simple yet messed up everything without it lol thanks for the hint :)