Setting of the NPCs in the game – Spawn set
From Djinni Wiki
In order for NPCs, such as villagers or bandits, to appear in the game, you should assign them with a proper file called the Spawn set. This file defines where a character is going to appear, when and for how long it is going to take part in the game, and what kind of activities it is going to carry out during this time. In order to create a new Spawn set file choose the File -> New -> Spawn set option. A clear file will be created. In order to add a new entry, click the white area with the right mouse button and choose the Add Spawn Entry option. The file will look as follows (the file has been divided into several pieces because of its size).
Spawn Entry: the name of the entry is used only to mark this line in the file Start Time, End Time: the time slice during which the character spawns in the game
OnSpawn Script: the name of the script activated when the character spawns in the game
Template: the template of a given character
Spawn Category: a set of signs describing the place at which the character spawns in the game, it must be identical with one of the categories entered in the description of the character’s spawn point.
Probability: the probability that the character spawns in the game
Min Creatures: the lowest number of characters of the same type that can spawn in the game in the same time
Max Creatures: the highest number of characters of the same type that can spawn in the game in the same time
Total Creatures: the characters from one entry can spawn several times during the game. For example, they may spawn at the same time on a daily basis. This field defines how many characters of this type may spawn during the game. The 0 value allows for the infinite respawning of a given character, the value different from 0 defines how many times the character can be killed before it stops respawning
Respawn Condition: the field defines the condition that has to be met in order for the character to respawn, NEVER – the character won’t respawn after it has been killed, AFTER TIME – the character will respawn after the time set in the Respawn Delay field, ALWAYS – the character will always respawn, as long as the other conditions are met, NEXT ENTRY – the character will respawn always when the player enters its place of residence, NEXT DAY – the character respawns but not until the next day
Respawn Delay: The time after which the character respawns in the game, it is connected with the Respawn Condition
Spawn Type: The additional field defining the conditions under which the character spawns, OnEntry – the character spawns when the player enters the location, Hidden – the character tries to spawn in a place not visible to the player, Appear – the character appears when the player finds himself at a proper distance from the spawnpoint
Min Appera Distance: If the player finds himself closer to the spawnpoint than it is set in this field, the character will not appear in the game
Appear Distance: The distance from the spawnpoint at which the player should find himself in order to trigger the appearance of the character
Disapper Distane: The distance from the spawnpoint at which the player should find himself in order for the character to leave the game
SP Guard Distance: Defines how far away from the spawnpoint the character can walk
Spawn Interwal: The time that has to pass before the next respawning of a given character, especially important when one spawnpoint is used by several characters
No-Spawn Item List: The list of items in the player’s possession which will deactivate this entry
Action List: The list of actions the character can carry out at the given points of the location, Action Name – the name of the action that is to be carried out, Probability – the probability of the action being carried out, all values in the Probability field are scaled so that their sum always equals 100. The location where the character spawns must contain places with actions the character can carry out, otherwise the character will not appear in the game
Actions Looped:
Always Start At Begin: Regions List: It is a list defining the specific points at which the character can carry out an action. The name of the region entered in this field must agree with the entry in at least one point where the action can be carried out
Each Spawn set may have any number of entries. The number should not be too high though. It is better to define several small files than to create one huge file. Such an approach makes for easier modification of life in the location. There are mechanisms enabling to set the Spawn sets on and off. Thanks to them, you can define what part of the population appears at a given moment, depending on the plot development. It is impossible with one big file.





