Object Spawner – DayZ
Jump to navigation
Jump to search
↑ Back to spoiler's top
No edit summary |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 5: | Line 5: | ||
Objects from such lists are spawned into the world at the start of the server mission. | Objects from such lists are spawned into the world at the start of the server mission. | ||
{{Feature|warning| | {{Feature|warning|Please note that spawning a lot of objects this way may have impact on both the server and client performance.}} | ||
=== How to create and use a custom spawn list === | === How to create and use a custom spawn list === | ||
* Enable cfgGameplay.json, (see the [ | * Enable cfgGameplay.json, (see the [[DayZ:Gameplay Settings|Gameplay settings documentation]] for {{hl|cfgGameplay.json}} configuration) | ||
* Create a new .json file ''(for example spawnerData.json)'' in your Mission folder, copy the contents of the template bellow into this new file | * Create a new .json file ''(for example spawnerData.json)'' in your Mission folder, copy the contents of the template bellow into this new file | ||
<spoiler text="Show the template..."> | <spoiler text="Show the template..."> | ||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
{ | { | ||
"Objects": [ | |||
{ | |||
"name": "Land_Wall_Gate_FenR", | |||
"pos": [ | |||
8406.501953125, | |||
107.73682403564453, | |||
12782.3388671875 | |||
], | |||
"ypr": [ | |||
0.0, | |||
0.0, | |||
0.0 | |||
] | |||
}, | |||
{ | |||
"name": "Land_Wall_Gate_FenR", | |||
"pos": [ | |||
8410.501953125, | |||
107.73682403564453, | |||
12782.3388671875 | |||
], | |||
"ypr": [ | |||
0.0, | |||
0.0, | |||
0.0 | |||
] | |||
}, | |||
{ | |||
"name": "Land_Wall_Gate_FenR", | |||
"pos": [ | |||
8416.501953125, | |||
107.73682403564453, | |||
12782.3388671875 | |||
], | |||
"ypr": [ | |||
0.0, | |||
0.0, | |||
0.0 | |||
] | |||
}, | |||
{ | |||
"name": "Land_Wall_Gate_FenR", | |||
"pos": [ | |||
8422.501953125, | |||
107.73682403564453, | |||
12782.3388671875 | |||
], | |||
"ypr": [ | |||
0.0, | |||
0.0, | |||
0.0 | |||
] | |||
} | |||
] | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 80: | Line 80: | ||
The '''cfgGameplay.json''' contains a filename array: | The '''cfgGameplay.json''' contains a filename array: | ||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json">"objectSpawnersArr": ["mySpawnData1.json","mySpawnData2.json","mySpawnData3.json"]</syntaxhighlight> | ||
"objectSpawnersArr": ["mySpawnData1.json","mySpawnData2.json","mySpawnData3.json"] | |||
</syntaxhighlight> | |||
Where each JSON file contains a list of objects to be spawned in the world at the start of the server mission. | Where each JSON file contains a list of objects to be spawned in the world at the start of the server mission. | ||
{{Feature|warning| | {{Feature|warning|Any persistent item (usually majority of types within the ''db\types.xml'') will be spawned once again after the server restart.}} | ||
=== Parameters === | === Parameters === | ||
Line 108: | Line 104: | ||
|ypr | |ypr | ||
|Orientation as Yaw, Pitch and Roll in degrees | |Orientation as Yaw, Pitch and Roll in degrees | ||
| | |} | ||
[[Category:DayZ]] | [[Category:DayZ]] | ||
[[Category:DayZ:Editing]] | [[Category:DayZ:Editing]] |
Revision as of 19:28, 15 July 2022
What is the Object Spawner?
The Object Spawner addresses the need of our community to add additional detail to the world through a list of map objects together with their position and orientation.
Objects from such lists are spawned into the world at the start of the server mission.
How to create and use a custom spawn list
- Enable cfgGameplay.json, (see the Gameplay settings documentation for cfgGameplay.json configuration)
- Create a new .json file (for example spawnerData.json) in your Mission folder, copy the contents of the template bellow into this new file
{
"Objects": [
{
"name": "Land_Wall_Gate_FenR",
"pos": [
8406.501953125,
107.73682403564453,
12782.3388671875
],
"ypr": [
0.0,
0.0,
0.0
]
},
{
"name": "Land_Wall_Gate_FenR",
"pos": [
8410.501953125,
107.73682403564453,
12782.3388671875
],
"ypr": [
0.0,
0.0,
0.0
]
},
{
"name": "Land_Wall_Gate_FenR",
"pos": [
8416.501953125,
107.73682403564453,
12782.3388671875
],
"ypr": [
0.0,
0.0,
0.0
]
},
{
"name": "Land_Wall_Gate_FenR",
"pos": [
8422.501953125,
107.73682403564453,
12782.3388671875
],
"ypr": [
0.0,
0.0,
0.0
]
}
]
}
- Edit the contents as needed. Do note each object's entry needs to end with a comma, except the last one.
- In the cfgGameplay.json, locate the "objectSpawnersArr" and input your previously created .json as a parameter (example: "objectSpawnersArr": ["spawnerData.json" ])
Details
The cfgGameplay.json contains a filename array:
"objectSpawnersArr": ["mySpawnData1.json","mySpawnData2.json","mySpawnData3.json"]
Where each JSON file contains a list of objects to be spawned in the world at the start of the server mission.
Parameters
Type | Parameter | Details |
---|---|---|
string | name | Class name of the object to be spawned |
vector | pos | Position of the object in the world |
vector | ypr | Orientation as Yaw, Pitch and Roll in degrees |