Let mob pop out of grasses. in Developer Help
|
|
Well, I'm wondering how I should do this, letting mobs pop out of the grasses when you walk over it. And after a while when they're out of ur sight, it says, '[mob] has ran away.' or something like that. And the mob needs to attack your pet that you've out. I've tried it with this:
mob var wild=0
turf dense density=1 var/Spawnz2 = list() Spawn Entered(atom/AZ) if(istype(AZ,/mob)) var/mob/M = AZ var/i = rand(1,5) if(i==1) var/X = pick(src.Spawnz2) var/mob/m = new X var/LV=rand(5,6) for(var/mob/Pokemon/P in M.pokemonlist) if(P.level>rand(5,6)) LV = rand(5,6) while(m.level<>LV) m.next+=1 m.wild = 1 m.loc = src for(var/mob/Ms in world) if(get_dist(Ms,m)<10) M << "<font color=green><font size=2>A wild [m] appeared!" step_rand(m) step_rand(m) Testing Spawnz2 = list(/mob/Wild_Pokemon/Bidoof,/mob/Wild_Pokemon/Pidgey)
|
But it just freezes up my window, making it crash.
So any suggestions, help, will be appreciated.
|