ok i have here somthing that respawns the objects in the world...but there is a bug, it restores the npc mobs that have been restored too! (and this is the only part of my game that has 'repop' called) so im thinking its somthing ive done wrong?
world/New()
spawn
while(1)
sleep(100)
for(var/obj/clips/L in world)
sleep(310)
Repop(L)
for(var/obj/gherb/L in world)
sleep(520)
Repop(L)
[edit] all i want restored is 'gherb' and the 'clips' but it makes every thing, including mobs and other obj's [/edit]
ID:174971
Jun 27 2003, 6:30 pm (Edited on Jun 27 2003, 7:05 pm)
|
|
Jun 27 2003, 6:38 pm
|
|
try repop(L)
|
I'm not sure, but something I should point out is that you need to put the last two lines after both for() things and not just the second
|
In response to Koolguy900095
|
|
Koolguy900095 wrote:
try repop(L) hmm diddnt work :( |
In response to Wanabe
|
|
Also you need something between the two for's
|
In response to Koolguy900095
|
|
Thats what i now have..... ill test it now
world/New() spawn while(1) sleep(100) for(var/obj/clips/L in world) sleep(310) Repop(L) for(var/obj/gherb/L in world) sleep(520) Repop(L) |
Wanabe wrote:
ok i have here somthing that respawns the objects in the world...but there is a bug, it restores the npc mobs that have been restored too! (and this is the only part of my game that has 'repop' called) so im thinking its somthing ive done wrong? The bolded line has no effect, you should also look up Repop() and read what it does exactly. |
In response to Nadrew
|
|
oh ok neaver knew that :| Is there a way to just repopulate/create certain things that i want repopulated/created?
|
In response to Wanabe
|
|
easy, use the mobs Del() proc to do this.
example: mob Not sure if all that is correct, since I just thought it up, but...I'm not sure about that locate(src) since it'll already be deleted, so it may return null. |
In response to Goku72
|
|
Goku72 wrote:
easy, use the mobs Del() proc to do this. > mob Not sure if all that is correct, since I just thought it up, but...I'm not sure about that locate(src) since it'll already be deleted, so it may return null. hey thats a decent idea :) Ill try somthing simalair. im about to go to some one elses house so ill check the forum out later and test what i had in mind, cyas later. |
In response to Goku72
|
|
Goku72 wrote:
easy, use the mobs Del() proc to do this. mob Not sure if all that is correct, since I just thought it up, but...I'm not sure about that locate(src) since it'll already be deleted, so it may return null. Actually locate(src) is wrong anyway; you can't use locate() that way. What you're thinking of, I think, is src.loc. Also, it's much better to just put new type(loc), since the type of the monster may change depending on if it's /mob/monster/slime or /mob/monster/bunny. You're right that the deletion will screw with this though. The spawn() will end up doing nothing once src is deleted. What you'll have to do is find some other approach, like using a temporary event datum to do this. event mob/monster object.procpath(data)
new object(procpath, data)
If you need to save your world and want events done in this system to save, just do this: // assuming F is the world/map/etc. savefile Lummox JR |
In response to Lummox JR
|
|
Thank you lummox! that worked
|