Object Spawner – DayZ

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Category:DayZ: Editing" to "{{GameCategory|dayz|Editing}}")
m (Some wiki formatting)
Line 1: Line 1:
{{TOC|side}}
=== What is the Object Spawner? ===
=== What is the Object Spawner? ===


Line 6: Line 7:


{{Feature|warning|Please note that spawning a lot of objects this way may have impact on both the server and client performance.}}
{{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 ===
Line 15: Line 15:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
    "Objects": [
"Objects": [
        {
{
            "name": "Land_Wall_Gate_FenR",
"name": "Land_Wall_Gate_FenR",
            "pos": [
"pos": [
                8406.501953125,
8406.501953125,
                107.73682403564453,
107.73682403564453,
                12782.3388671875
12782.3388671875
            4395.167480,
4395.167480,
339.012421,
339.012421,
10353.140625
10353.140625
],
],
            "ypr": [
"ypr": [
                0.0,
0.0,
                0.0,
0.0,
                0.0
0.0
            ],
],
"scale": 2
"scale": 2
        },
},
        {
{
            "name": "Land_Wall_Gate_FenR",
"name": "Land_Wall_Gate_FenR",
            "pos": [
"pos": [
                84104395.501953125,
84104395.501953125,
                107339.73682403564453,
107339.73682403564453,
                1278210356.3388671875
1278210356.3388671875
            ],
],
            "ypr": [
"ypr": [
                0.0,
0.0,
                0.0,
0.0,
                0.0
0.0
            ],
],
"scale": 1
"scale": 1
        },
},
        {
{
            "name": "Land_Wall_Gate_FenR",
"name": "Land_Wall_Gate_FenR",
            "pos": [
"pos": [
                84164395.501953125,
84164395.501953125,
                107339.73682403564453,
107339.73682403564453,
                1278210359.3388671875
1278210359.3388671875
            ],
],
            "ypr": [
"ypr": [
                0.0,
0.0,
                0.0,
0.0,
                0.0
0.0
            ],
],
"scale": 0.5
"scale": 0.5
        },
},
        {
{
            "name": "Land_Wall_Gate_FenR",
"name": "Land_Wall_Gate_FenR",
            "pos": [
"pos": [
                84224395.501953125,
84224395.501953125,
                107339.73682403564453,
107339.73682403564453,
                1278210362.3388671875
1278210362.3388671875
            ],
],
            "ypr": [
"ypr": [
                0.0,
0.0,
                0.0,
0.0,
                0.0
0.0
            ],
],
"scale": 0.25
"scale": 0.25
        },
},
        {
{
            "name": "Apple",
"name": "Apple",
            "pos": [
"pos": [
                4395.501953125,
4395.501953125,
                339.73682403564453,
339.73682403564453,
                10362.3388671875
10362.3388671875
            ],
],
            "ypr": [
"ypr": [
                0.0,
0.0,
                0.0,
0.0,
                0.0
0.0
            ],
],
"scale": 1,
"scale": 1,
"enableCEPersistency": true
"enableCEPersistency": true
        }
}
    ]
]
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 96: Line 96:


* Edit the contents as needed. Do note each object's entry needs to end with a comma, except the last one.
* 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" ])''
* In the {{hl|cfgGameplay.json}} file, locate the "objectSpawnersArr" and input your previously created .json as a parameter (example: <syntaxhighlight lang="json" inline>"objectSpawnersArr": ["spawnerData.json" ]</syntaxhighlight>)


=== Details ===
=== Details ===


The '''cfgGameplay.json''' contains a filename array:
The {{hl|cfgGameplay.json}} contains a filename array:


<syntaxhighlight lang="json">"objectSpawnersArr": ["mySpawnData1.json","mySpawnData2.json","mySpawnData3.json"]</syntaxhighlight>
<syntaxhighlight lang="json">"objectSpawnersArr": ["mySpawnData1.json","mySpawnData2.json","mySpawnData3.json"]</syntaxhighlight>
Line 109: Line 109:


{| class="wikitable"
{| class="wikitable"
!Type
! Type
!Parameter
! Parameter
!Details
! Details
|-
|-
|string
| <enforce inline>string</enforce>
|name
| {{hl|name}}
|Class name of the object to be spawned
| Class name of the object to be spawned
|-
|-
|vector
| <enforce inline>vector</enforce>
|pos
| {{hl|pos}}
|Position of the object in the world
| Position of the object in the world
|-
|-
|vector
| <enforce inline>vector</enforce>
|ypr
| {{hl|ypr}}
|Orientation as Yaw, Pitch and Roll in degrees
| Orientation as Yaw, Pitch and Roll in degrees
|-
|-
|float
| <enforce inline>float</enforce>
|scale
| {{hl|scale}}
|Multiplayer of the original object's size
| Multiplayer of the original object's size
|-
|-
|bool
| <enforce inline>bool</enforce>
|enableCEPersistency
| {{hl|enableCEPersistency}}
|Spawns without persistence. Once the player takes it, persistence will be enabled if available.
| Spawns without persistence. Once the player takes it, persistence will be enabled if available.
|}
|}


===Limitations===
=== Limitations ===


Only these paths are supported for p3d spawning:
Only these paths are supported for p3d spawning:


{| class="wikitable"
* DZ/plants
 
* DZ/plants_bliss
|-
* DZ/rocks
|DZ/plants
* DZ/rocks_bliss
|-
|DZ/plants_bliss
|-
|DZ/rocks
|-
|DZ/rocks_bliss
|}


{{Feature|informative|If the specified object does not exist (class or path to a model), log message with "Object spawner failed to spawn" will appear in the server RPT file.}}
{{Feature|informative|If the specified object does not exist (class or path to a model), log message with "Object spawner failed to spawn" will appear in the server RPT file.}}

Revision as of 15:59, 18 March 2024

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.

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

  • 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
							4395.167480,
				339.012421,
				10353.140625
			],
			"ypr": [
				0.0,
				0.0,
				0.0
			],
			"scale": 2
		},
		{
			"name": "Land_Wall_Gate_FenR",
			"pos": [
				84104395.501953125,
				107339.73682403564453,
				1278210356.3388671875
			],
			"ypr": [
				0.0,
				0.0,
				0.0
			],
			"scale": 1
		},
		{
			"name": "Land_Wall_Gate_FenR",
			"pos": [
				84164395.501953125,
				107339.73682403564453,
				1278210359.3388671875
			],
			"ypr": [
				0.0,
				0.0,
				0.0
			],
			"scale": 0.5
		},
		{
			"name": "Land_Wall_Gate_FenR",
			"pos": [
				84224395.501953125,
				107339.73682403564453,
				1278210362.3388671875
			],
			"ypr": [
				0.0,
				0.0,
				0.0
			],
			"scale": 0.25
		},
		{
			"name": "Apple",
			"pos": [
				4395.501953125,
				339.73682403564453,
				10362.3388671875
			],
			"ypr": [
				0.0,
				0.0,
				0.0
			],
			"scale": 1,
			"enableCEPersistency": true
		}
	]
}
↑ Back to spoiler's top

  • 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 file, 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
float scale Multiplayer of the original object's size
bool enableCEPersistency Spawns without persistence. Once the player takes it, persistence will be enabled if available.

Limitations

Only these paths are supported for p3d spawning:

  • DZ/plants
  • DZ/plants_bliss
  • DZ/rocks
  • DZ/rocks_bliss
If the specified object does not exist (class or path to a model), log message with "Object spawner failed to spawn" will appear in the server RPT file.