ID:178012
![]() Jun 29 2002, 1:16 pm
|
|
I'm creating a game with zelda style fighting. there's a problem when fighting baddies, once they're all killed in a map, no other player will be able to fight them. this may be fine for a dungeon and bosses, but for out in the field for people to fight and gain exp, it's bad. is anyone willing to share the secrets of how to make mobs spawn or respawn? i tried making it put src.loc into a variable (L) then moving the mob to an empty map, then after a while moving it back to L, but when it does L = src.loc, it takes the loc of all that type of mob in the world, and comes up with a runtime error. this is something i need for my game, but i can't figure it out on my own, anyone willing to help?
|
make it so when mobs die, it sets a world variable to 0
example: when an octorok dies have a variable change to 0 var octorok1 = 1 then set up a proc proc/octorok1_repop() if(octorok1 == 0) octorok1 = 1 new/mob/octorok(locate(x,y,z)) spawn(300) octorok1_repop() /mob/octorok being the octorok's type... if you coded it as mob/monster/octorok it would be new/mob/monster/octorok(locate(x,y,z)) also spawn is divided by 10 then its than many seconds (300 being 30 seconds) x,y,z being where you want the octorok to appear although there are like 2 problems with this code, one is you have to start it somewhere (preferably when the first person logs on) and the second is you have to create a variable and a proc for each mob you want to respawn. I hope this can help you in one way or another |
Darkness wrote:
Shizuka wrote:heh that sure beats my version :> |
You might want to make a repop() loop. It would look something like this:
world/New()
spawn while(1)
sleep(500) Repop()
return ..()
This code will repop or respawn all mobs and objs that are orgianlly on the map, if they are not deleted. If they were not deleted this will not make another one.