ID:150329
 
For() ?????
How can i make monsters that are dead regen every 2 minutes?
And if anyone is good at numbers for attack and deffence that would be good two.
Thanx,
zzghost
I don't know what Attack and Defense has to do with anything, but something like this would world:

world/New()
spawn(1200) Repopulate()

proc/Repopulate()
for()
world.Repop()
sleep(1200)

In response to Foomer
I like this way better:

mob
monster
proc/Die()
var/deadmonsterarea = new /area/deadmonster (src.loc)
deadmonsterarea.monster_type = src.type
del(src)
area
deadmonster
var/monster_type
proc
Regenerate_Dead_Monsters()
for(var/area/deadmonster/A in world)
new A.monster_type (A.loc)
del(A)
world/New()
..()
anchor
spawn(2000)
Regenerate_Dead_Monsters()
goto anchor


That's fundamentally how I run a monster repop system. Of course, I store more of the monster's vars in the area and add other little things, but this is the base code. Good luck!
In response to Lord of Water
Lord of Water wrote:
I like this way better:

mob
> monster
> proc/Die()
> var/deadmonsterarea = new /area/deadmonster (src.loc)
> deadmonsterarea.monster_type = src.type
> del(src)
> area
> deadmonster
> var/monster_type
> proc
> Regenerate_Dead_Monsters()
> for(var/area/deadmonster/A in world)
> new A.monster_type (A.loc)
> del(A)
> world/New()
> ..()
> anchor
> spawn(2000)
> Regenerate_Dead_Monsters()
> goto anchor

That's fundamentally how I run a monster repop system. Of course, I store more of the monster's vars in the area and add other little things, but this is the base code. Good luck!

The whole area thing seems a bit unnecessary to me. I just mark them dead, turn them inivisible, move them to a new random location, and use spawn() to mark them alive and make them visible again after a length of time has passed.

To save on cpu time, you can have any looping procedures return from the mob if it is dead.