Author Topic: NPC/Item respawn ?  (Read 3300 times)

Offline SonyUSA

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
NPC/Item respawn ?
« on: April 29, 2008, 04:56:39 am »
Sorry for being a total newb, I've got everything flowing nicely in my rooms with my items and npc's and things... but how do I make the npc's and items respawn after a set amount of time?  ???

Offline irmo

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: NPC/Item respawn ?
« Reply #1 on: April 29, 2008, 05:16:49 am »
The mudconfig command will be usefull in your case, if I'm not mistaking:

mudconfig interval <time>


(Typing 'mudconfig' without an argument, will show you a detailed list of other possibilities)
I'm not as think as you drunk I am.

Offline SonyUSA

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: NPC/Item respawn ?
« Reply #2 on: April 29, 2008, 05:43:20 am »
I tried that but it says the interval command hasn't been implemented yet :(

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: NPC/Item respawn ?
« Reply #3 on: April 29, 2008, 06:07:42 am »
Quote
but how do I make the npc's and items respawn after a set amount of time?

The simple way is to set the number of respawn seconds in the SetInventory element.
For example:

Code: [Select]
    SetInventory(([
        "/domains/town/obj/btable" : 1,
        "/domains/town/obj/bbucket" :1,
        "/domains/town/npc/lars" : ({ 60, 1})
      ]) );

Note particularly

Code: [Select]
        "/domains/town/npc/lars" : ({ 60, 1})

This says "check every 60 seconds to make sure there's
a Lars there. If there isn't, respawn one."

-Crat

Offline SonyUSA

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: NPC/Item respawn ?
« Reply #4 on: April 29, 2008, 06:36:48 am »
Ah! very simple! thanks! :)

Offline SonyUSA

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: NPC/Item respawn ?
« Reply #5 on: April 29, 2008, 08:10:28 am »
Using this method, will it keep creating zombies if one does not exist in the room when the timer runs out? So if left unattended and loaded in memory, it will makes tons of they are able to move around? Or is each NPC tied to its originating room to check for respawn?

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: NPC/Item respawn ?
« Reply #6 on: April 29, 2008, 08:14:48 am »
If your zombies wander off, the room will spawn more.

They will probably eventually be retired from memory during
periodic reset sweeps, but this is not guaranteed, since
they could wind up in rooms that do not reset.

For reset info, see: http://dead-souls.net/ds-admin-faq.html#112

-Crat

Offline SonyUSA

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: NPC/Item respawn ?
« Reply #7 on: April 29, 2008, 08:18:33 am »
Oh that's handy, I won't worry about it too much then :)

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: NPC/Item respawn ?
« Reply #8 on: April 29, 2008, 08:19:56 am »
Note that you don't *have* to set an explicit respawn time.
If your lars line reads:

Code: [Select]
        "/domains/town/npc/lars" :  1

Then when that room is reset according to the mud's
schedule, the room will contain a Lars the next time
a player enters it.

The respawn option is just for rooms with NPC's that
need to respawn more rapidly than the mud's
reset interval would normally handle.

-Crat