ID:261777
 
Okay first off my attack verb wont work here it is:

mob
verb
attack(mob/M as mob in oview(1))
usr << "you attack [m]!"
oview() << [usr] attacks [m]!"
var/damage = rand(1,5) + usr.str/2 - mdef
mhp =- damage

all i get are a whole bunch of errors saying mdef and mhp are undefined vars i set them under mob/M/var

next is my pickup verb

mob/verb/pickup(obj/item/ in oview(1))
src = usr.contents
new /obj/item/ (src)
del /obj/item/ in oview(1)
return..()
same with my drop, equip, and unequip verbs
plz help!!!!

i also tried setting icons for stats but that didnt work too well

Define the variables for mob, not mob/m. The latter way gives you a mob called m with the variables. Also, use this for pickup:

obj/verb/pickup()
src.loc=usr


Setting icons for stats? What do you mean by that?
In response to Jp
Also, with the mhp and mdef, make it as M.hp and M.def, or whatever other variables you use
In response to Jp
You forgot the <code>set src in oview(1)</code>
In response to Syier
for the stat icons in some games people have it so u can see icons next to there verb i.e in the rpgstarter kit bylil trunks he has eyes that move next to his look around verb, i tried something similar for stats bu it just gives me errors
In response to War_master66
and on more thing i have an idea on how to get a shop system going but i dont know if it will work so here it goes!

mob
verb
shop(mob/npc/shop in view(1))
usr << "welcome look around and if you find something bring it up."
list("Weapons","Armor")
if(list == "Weapons")
list("Dagger","Short Sword","Broad Sword", "Long Sword") etc.... same kinda thing for armor
then
if(list = "Sword")
usr << "Sword costs 500 gold, want it anyway?" input list("Yes","No")
if("Yes"
if(usr.gold >=500)
Set src in oview(1)
src.loc=usr
usr << "you bought the Sword"
else
usr << "you do not have enough gold!"



I know alot of this is probably incorrect but im just checking, if it will work ill put it in if not, then back to the drawing board.
In response to War_master66
....and one other thing i just thught of, how would i make monsters wander until they see a usr then move towards them and attack?
In response to War_master66
Don't say usr. That will only lead to trouble when you put usr all willy-nilly around your code. Say "player," not "usr."
In response to Garthor
mob/monster
icon = 'monster.dmi'
icon_state = "monster"
npc = 0
health = 10
maxhealth = 10
strength = 10
exp = 50

var/mob/characters/Playa

New()
.=..()
spawn(1)
Wander()

proc/Wander()
while(src)
if (Playa in oview(5))
step_towards(src,Playa)
else
step_rand(src)
for(P layain view(src))
break
sleep(5)
spawn(40)
Wander()

Bump(mob/M)
if (istype(M,/mob/characters))
NPCAttack(M)
proc/NPCAttack(mob/M)
M.damage(M)

You will have to make a new proc for damage and call it up when the mosnetr attacks also as to your attack verb if i were you id take out all that def- crap and make it into the proc damage and have it called up whwve you click the attack verb it will save you alot of time and effort for npc's and other things instead of wrighting it out numerous times.
In response to Cloud54367
There are a very large number of problems in this. Do not take this person's advice. Ignore the post this post was in reply to, and do not listen to Cloud54367.
In response to Garthor
outta curiousity.. why not listen to cloud?