ID:167198
Apr 16 2006, 7:59 am
|
|
is it possible to locate a newly spawned mob using rand() to place them randomly from your current location? any examples?
|
Apr 16 2006, 8:19 am (Edited on Apr 16 2006, 10:20 am)
|
|
In response to Mysame
|
|
sorry i didnt explain it thoughorly. something like var/mob/player=new loc(src.x,src.y,src.z)(rand(0,3))
my method doesnt work though. |
In response to Propylparaben
|
|
Editted the post, check it.
|
In response to Mysame
|
|
I believe you meant:
1,world.maxblahblah. =p |
In response to Mysame
|
|
Mysame scribbled:
var/x=rand(0,world.maxx) // will occasionally return 0, which will crash the proc That's inexcusably lame, retard. Shame on you. This is far better: proc |
In response to PirateHead
|
|
Heyhey, yours doesn't compile either. o.O
And I didn't notice I had o instead of 0 and that I had 0 instead of 1. Still, no reason to call me a retard, har har pirate. :/ And he said he wanted to create a new 'player'. Who knows it's an NPC, I don't know the hell he's doing. :/ |
Propylparaben wrote:
is it possible to locate a newly spawned mob using rand() to place them randomly from your current location? any examples? Simple enough. var/mob=new(locate(rand(src.x-5, src.x+5),rand(src.y-5,src.y+5),src.z)) What this code will do is create a new mob anywhere between five steps left of you, to five steps right of you, and five steps up from you, to five steps down from you on the same z-level of the map. (Effectively anywhere within a 5 square radius with you as its center.) Now, I never tested if this would actually work, but in theory it will. Good luck with your game. -- §atans §pawn -- |