Dynamic Spawner: setting a spawner ingame
.: Publication date 03-June-2004 :: Reads: 1761 :: Review :: Print current page :: Print all:.
[size=2] Manual spawner or so called "dynamic spawner" are spawner you place while being ingame and can modify them ingame too. They are good to use for item/npc spawns at specific places (dungeons for example) compared to to the big area region spawns which are explained in "Region Spawner: setting a large area spawner offline". Many thanks to saber at gernox.de for the first tutorial version! To create a dynamic spawner you first need an item that is the spawner. You can add a preformed spawner with 'add menu, spawner section. Or you place a special item (good idea is to place the item a dynamic item spawner, so you can see immediatelly what this spawner spawns). This can be everything. In this example a Brick wall 0040 is added as spawner: [CODE] 'ADD 0X00 0X40 [/CODE] This is a usefull spawner item because it is small and does not hide anything. Now we hide the item to player, so they can't see it or are blocked by it: [CODE] 'SETVISIBLE 2 [/CODE] Now we declare the spawner properties. First we declare the brickwall is a spawner, so its type must become 61 for item spawner or 62 for npc spawner. This numbers are from scriptssymbolsitemtypes.xss. [CODE] 'SETTYPE 61 [/CODE] Now we declare what should spawn. For this we set morex the scriptID of the item/npc to spawn. For example Sulfuric Ash, which has number 446 (scriptssymbolsitems.xss). We set morey as minimal time in minutes after which the spawner should spawn (eg 2 minutes) and we set morez as maximum time in minutes after which the spawner should spawn (eg 3 minutes). [CODE] 'SETMOREXYZ 446 2 3 [/CODE] Last but not least we declare how many items/npc per time should spawn, moreb12 (a combination out of moreb1 and moreb2) means the minimum amount to spawn and moreb34 (a combination out of moreb3 and moreb4) the maximum amount to spawn. [CODE] 'SETMOREB12 2 'SETMOREB34 4 [/CODE] Now we rename the spawner item to have the name of the item/npc it spawns, eg RENAME SCHWEFEL SPAWN to help us ingame to recognize it. The item/npc to spawn appears always ar the place of the spawner. Here a list of the commands/properties a dynamic spawner has: - DUPE: number of maximum Items/Npc, the spawner ever is allowed to "hold" at one time - IP_AMOUNT2: how many Items/Npc of the IP_AMOUNT already are "hold" at the spawner (only Info value, no ingame command available, use tweak command to check this) - SETMOREXYZ: MOREX: ScriptID of the Items/Npc to spawn MOREY: Minimal time between spawns in minutes MOREZ: Maximum time between spawns in minutes - SETTYPE: Item type defines if Item or NPC-Spawner ($itype_item_spawner 61, $itype_npc_spawner 62) - SETMOREB12: minimal amount of Items/Npc to spawn - SETMOREB34: maximum amount of Items/Npc to spawn How does it work in background: 5 seconds after every worldsave all new Spawner are initialized. A random number between MoreY and MoreZ is created and defines in minutes how long after the spawner is triggered again. When the spawner is triggered it checks, if the amount of items/npc the spawner holds is smaller than the amount of the spawner itself. If yes it spawns a random number of items or npc between moreb12 and moreb34, the new amount of items/npc the spawner "holds" now must be equal or lower than IP_AMOUNT. If the spawner holds already as many npc/item as the number of the spawner itself is, the next spawner trigger time point is set and nothing else happens. The amount of npc/item the spawner "holds" is lowered when someone picks an item up or it is deleted or one of its npc is tamed.

 
 
MD-Pro is Free Software released under the licenza GNU/GPL.
 
 

Powered by MD-Pro