=What is unit?=
Units are objects in inside SCS game engine that have ability to . One of their core abilities is so they can be serialized or deserializedmaking it a perfect tool to give content creators a way to define various parts of the games.
Unit has:
== SII files ==
Units are stored in SII files. There are two versions of this file supported by the game engine textual : plain-text and binary however . However, only textual form the plain-text format is used for definitions.
=== Struture Structure ===
The magic mark - – used to check if the file is a real SII file or not.
<pre>SiiNUnitSiiNunit</pre>
The opening bracket used to explicitly show the global file scope start
attribute_number: 40
attribute_string: "TEST STRING"
attribute_tokenattribute_unit: TESTtest.unit
attribute_float3: (1.0, 1.0, 1.0)
attribute_float_number_ieee754: &40490f5a
}</pre>
The closing bracked bracket for the SiiNUnitSiiNunit
<pre>}</pre>
'''Example:'''<br />
''some_file_using_include.sii''
<pre>SiiNUnitSiiNunit
{
example: doing.includes
<pre> ninjas: true</pre>
''How the game “sees” some_file_using_include.sii:''
<pre>SiiNUnitSiiNunit
{
example: doing.includes
}
</pre>
You may notice usage of the new extension - '''.sui'''. It's used for unit serialized files without magic mark <code>SiiNUnitSiiNunit</code> that are included somewhere in different files. We recommend you also use this extension.
{{Note|The <code>@include</code> directive must appear at the beginning of a new line with no whitespace (space, tab, etc) before it. The following examples will '''not''' work:
<pre>SiiNUnitSiiNunit
{
bad_examples: just.the.worst {
== Attribute types ==
{| class="wikitable" width="100%"
!width="19%"| Type!width="25%"| Value!width="55%"| Example! Notes
|-
| string
| "x"
| attribute: "String value"
|
|-
| float
| x
| attribute: 1.0 // Using normal float-notation<br>attribute: &3f800000 // using ieee754 hexa notation
|
|-
| float2
| (x, y)
| attribute: (1.0, 2.0)
|
|-
| float3
| (x, y, z)
| attribute: (1.0, 5.0, 3.0)
|
|-
| float4
| (x, y, z, w)
| attribute: (1.0, 5.0, 3.0, 9.0)
|
|-
| placement
| (x, y, z) (w; x, y, z)
| attribute: (0, 0, 0) (1; 0, 0, 0)
|
|-
| fixed
| x
| attribute: 10|
|-
| fixed2
| (x, y)
| attribute: (10, 22)|
|-
| fixed3
| (x, y, z)
| attribute: (10, 22, 33)|
|-
| fixed4
| (x, y, z, w)
| attribute: (10, 22, 33, 44)|
|-
| int2
| (x, y)
| attribute: (20, 69)
|
|-
| quaternion
| (w, x, y, z)
| attribute: (1.0, 0.0, 0.0, 0.0)
|-| token| x| attribute: value
|-
| s16
| x
| attribute: -15
|
|-
| s32
| x
| attribute: -15
|
|-
| s64
| x
| attribute: -15
|
|-
| u16
| x
| attribute: 15
|
|-
| u32
| x
| attribute: 15
|
|-
| u64
| x
| attribute: 15
|
|-
| bool(boolean)
| x
| attribute: true
attribute: false
|
|-
| unit<span id="attribute_type_token">token</span>
| x
| attribute: myvalue| Token is a string of maximum length of 12 characters, only lowercase alphanumeric characters and underscore can be used [<code>a-z0-9_</code>]|-| owner pointer (owner_ptr)| x| attribute: .some.nameless.unit| '''owner_ptr''' refers to unit defined within the same SiiNunit (eg. <code>.trailer.tchassis</code>)|-| link pointer (link_ptr)| x| attribute: some.named.unit| '''link_ptr''' refers to a named unit that is defined elsewhere (eg. <code>cabin_a.brand.model.cabin</code>)|-| resource_tie| "x"| attribute: "path/to/some/resource.pma"| '''resource_tie''' is typically used to bind animations to animated models. The syntax is the same as for 'string' type attributes.
|}
<pre>
attribute_name[]: value
attribute_name[]: value2
attribute_name[]: value3
</pre>
attribute_name[2]: 9 <-- 3rd element
</pre>
=Documented Unit Types=
{{Special:PrefixIndex/Documentation/Engine/Units/|hideredirects=1|stripprefix=1}}