ID:172093
 
when i tryed to put a monster into my game, it created something like a loop? Could someone please help me?
Here's my code:


mob/Monster/Bug
icon = 'monsters.dmi'
icon_state = "bug"
HP = 30
Power = 18
var/expplus = 7
var/mob/player/P
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
var/Found = FALSE
for(P in oview(5,src))
step_towards(src,P)
Found = TRUE
break
if(Found != TRUE)
step_rand(src)
sleep(10)
sleep(5)
Bump(mob/M)
if(istype(M,/mob/player))
Attack(M)
proc/Attack(mob/M)
sleep(2)
var/damage = rand(1,Power)
M.HP -= damage
M.Death()


I don't know where to start.
What's wrong with it? The only thing I see is in the proc/Wander(). Indent everything under while(src) one more time.
This Wander() proc has been a plague on the forums ever since the piece of crap was written. It's been improved somewhat from its original bugginess, but it still sucks. Don't use it.

Lummox JR
In response to Lummox JR
Speaking of which, did you ever find out who originall made the demo? O.o
In response to Airjoe
well since that dosen't work, can someone please give me a code where if you attack them they attack back? Or how to get the monsters to walk around in different patterns?
In response to Shadowcat519
"could someone please give me a code..."

Wrong thing to say. You'd be best to ask how it's done, or something of the sort. The words "give me code" aren't going to come in handy all that much.
In response to Rippy
sorry. Can someone show me how it's done?
In response to Shadowcat519
S'okay. I think if you search rpg starter, you'd come up with some demos that would cover that.
In response to Shadowcat519
Shadowcat519 wrote:
sorry. Can someone show me how it's done?

Show you how what's done? Sorry if this seems like a hassle, but you need to get used to the forum. You need to be specific aboout exactly what you want. Here's how "it's" done.

proc/It()
return "Done!"

:-P So be specific!