Posts ID:262589 Favorites
ID:262589

Code:
 ``` var/monster a=pick(encounter) b=pick(encounter) c=pick(encounter) a=new a(locate(x,y+3,z)) b=new b(locate(x--,y+3,z)) c=new c(locate(x++,y+3,z)) ```

Problem description:
Well, a's created, but the rest aren't.
Explain. =(

 #1 Aug 29 2005, 12:04 pm There might be a problem with New() where it is getting stuck in a loop and not returning, so the subsequent lines don't get run.
 #2 Aug 29 2005, 12:10 pm In response to Hazman (#1) Nothing's wrong with New(), I've never overridden it for a mob to an extent to where it's not being called. It could be something with swapmaps, or I may be creating them in a void, I'll go check. :|
Ol' Yeller wrote:
Code:
 ```> var/monster> a=pick(encounter)> b=pick(encounter)> c=pick(encounter)> a=new a(locate(x,y+3,z))> b=new b(locate(x--,y+3,z))> c=new c(locate(x++,y+3,z))> ```
What is "a", specifically? You've defined a monster datum I'm guessing...

Something I see that could possibly cause problems, might be your use of x++ and x--. If I'm not mistaken, b should be put in the same location as a, or not created at all.

Why do I think this? You're changing the x value with x--, and I believe that reads it as an arg, then changes it afterwards. Try using x-1, or maybe even --x. I have the same theory for c.

A good way to test if they are being created:
 ```monster/New() . = ..() if(.)world<<"New monster created!" ```