|
|
Line 1: |
Line 1: |
| {{Resource page}}
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| __NOTOC__
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| EDF stands for ''Editor Definition File''. EDF's are XML files with an .edf extension that describe the custom elements used by a resource: new element types that have no meaning to MTA itself. Examples are <spawnpoint>, <flag>, <checkpoint> etc. They also are used to define settings that are used by gamemodes, which are placed under the <settings> tag within a resource's ''meta.xml''.
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| ==Introduction==
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| Some resources use custom map elements. A capture the flag gamemode, for example, will likely use <flag> elements that contain flag positions and teams. When a map is loaded, the gamemode looks for any <flag> elements and installs flags accordingly - for example by creating a flag object and a collision shape.
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| The problem with these custom elements is that, unlike built-in MTA elements, the map editor has no idea of their meaning. How should a <flag> element be visually represented? What properties does it have? Without telling the editor this information, you could not use it to create these custom elements and would instead have to resort to manually editing the .map file with a text editor. Fortunately this isn't necessary: any resource can contain an editor definition file that describes the custom map elements used by that resource.
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| ==Using definition files in the editor==
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| As described in the [[Resource:Editor|main editor manual]], to be able to create the custom elements of a resource in your map you need to add it in the ''Definitions'' window. Click the ''Definitions'' button in the main menu and double click the resource in the left list. Then close the window and roll the mousewheel in the element panel until the resource comes up. At that point you can create and manipulate custom elements of that resource like any other element.
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| ==Writing EDF files==
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| EDF files are simply XML files with an .edf extension. We'll start with an example: the EDF of the Capture the Orb gamemode.
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <syntaxhighlight lang="xml">
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <def name="Capture the Orb">
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <element name="orb" friendlyname="Orb spawnpoint" instructions="Place your orb in a position that can be collected.">
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <data name="position" type="coord3d" default="0,0,0" />
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <marker size="0.5" type="corona" color="#ffff00ff" />
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| </element>
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <element name="objective" friendlyname="Objective point" instructions="Place your objective point in a position that can be reached.">
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <data name="position" type="coord3d" default="0,0,0" />
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <marker size="3" type="cylinder" color="#9370dbaa" />
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| </element>
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <element name="spawnpoint" friendlyname="Spawnpoint">
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <object editorOnly="true" model="3092" posZ="1" />
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <data name="position" type="coord3d" default="0,0,0" />
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <data name="rotation" type="coord3d" default="0,0,0" />
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| <data name="skin" type="skinID" default="0" />
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| </element>
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| </def>
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| </syntaxhighlight>
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| As you can see, the syntax is fairly straightforward. The root element, <def>, contains a number of <element>s. Each of these <element>s describes a custom element and specifies its name, visual representation and available properties.
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| ===Visual representation===
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| Any child node of an <element> that is not a <data> node is part of the visual representation. There can be one or more objects, markers, pickups etc. For each representation element you can optionally specify a position (posX, posY, posZ) and rotation (rotX, rotY, rotZ): these are ''relative'' to the position and rotation of the represented custom element. Using the above Capture the Orb example, if you were to create a spawnpoint at (30, 14, 3), the editor would display an object of model 3092 at (30, 14, 4) to represent it, because the object's posZ of 1 is added to the spawnpoint's z position of 3.
| | Extrem liże hazowi dupsko a Barcioo liże cipsko Trinowi |
| | |
| ===Properties===
| |
| | |
| Properties of a custom element are described by <data> nodes. Some property names have a special meaning, like ''position'' and ''rotation'': these can be changed by moving and rotating the element in the editor. The other properties can be changed in the Properties window.
| |
| | |
| ===Property-dependent visual representation===
| |
| | |
| It is possible to make the representation of a custom element depend on one or more of the element's properties. Take as example a <checkpoint> element of a race gamemode that contains a <marker> for representation: the checkpoint has several attributes like color and size that should be reflected in the marker. To accomplish this, specify something of the form ''!propertyname!'' in one or more of the representing element's attributes. For example:
| |
| | |
| <syntaxhighlight lang="xml">
| |
| <def name="Race">
| |
| <element name="checkpoint" friendlyname="Race checkpoint">
| |
| <data name="position" type="coord3d" required="true" default="0,0,0" />
| |
| | |
| <data name="type" type="selection:checkpoint,ring" required="true" default="checkpoint" />
| |
| <data name="size" type="number" required="true" default="2.25"/>
| |
| <data name="color" type="color" required="false" default="#ff0000ff" />
| |
| ...
| |
|
| |
| <marker type="!type!" size="!size!" color="!color!" />
| |
| </element>
| |
| </def>
| |
| </syntaxhighlight>
| |
| | |
| Now whenever the "type", "size" or "color" property of a checkpoint is changed, the new value will be copied to its marker, and the marker's visual appearance changes accordingly.
| |
| | |
| ===Integrating in a resource===
| |
| | |
| Once you've written your EDF, save it as an .edf file in your resource's folder and add an "edf:definition" attribute to your meta.xml's <info> tag, like so:
| |
| | |
| <syntaxhighlight lang="xml">
| |
| <meta>
| |
| <info author="erorr404" type="gamemode" ... edf:definition="cto.edf" />
| |
| ...
| |
| </meta>
| |
| </syntaxhighlight>
| |
| | |
| ==EDF reference==
| |
| | |
| ===Built-in elements===
| |
| These are the elements you can use for representing your custom elements, along with their properties.
| |
| | |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE" colspan="2" | <blip>
| |
| |-
| |
| ! style="background-color: #EEE"|Property
| |
| ! style="background-color: #EEE"|Type
| |
| |-
| |
| | style="background-color: #EEE"|position
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| | style="background-color: #EEE"|icon
| |
| | style="background-color: #EEE"|blipID
| |
| |-
| |
| | style="background-color: #EEE"|size
| |
| | style="background-color: #EEE"|integer
| |
| |-
| |
| | style="background-color: #EEE"|color
| |
| | style="background-color: #EEE"|color
| |
| |-
| |
| | style="background-color: #EEE"|dimension
| |
| | style="background-color: #EEE"|integer
| |
| |}
| |
| | |
| | |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE" colspan="2" | <marker>
| |
| |-
| |
| ! style="background-color: #EEE"|Property
| |
| ! style="background-color: #EEE"|Type
| |
| |-
| |
| | style="background-color: #EEE"|position
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| | style="background-color: #EEE"|type
| |
| | style="background-color: #EEE"|markerType
| |
| |-
| |
| | style="background-color: #EEE"|size
| |
| | style="background-color: #EEE"|number
| |
| |-
| |
| | style="background-color: #EEE"|color
| |
| | style="background-color: #EEE"|color
| |
| |-
| |
| | style="background-color: #EEE"|interior
| |
| | style="background-color: #EEE"|integer
| |
| |-
| |
| | style="background-color: #EEE"|dimension
| |
| | style="background-color: #EEE"|integer
| |
| |}
| |
| | |
| | |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE" colspan="2" | <object>
| |
| |-
| |
| ! style="background-color: #EEE"|Property
| |
| ! style="background-color: #EEE"|Type
| |
| |-
| |
| | style="background-color: #EEE"|model
| |
| | style="background-color: #EEE"|objectID
| |
| |-
| |
| | style="background-color: #EEE"|position
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| | style="background-color: #EEE"|rotation
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| | style="background-color: #EEE"|interior
| |
| | style="background-color: #EEE"|integer
| |
| |-
| |
| | style="background-color: #EEE"|dimension
| |
| | style="background-color: #EEE"|integer
| |
| |}
| |
| | |
| | |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE" colspan="2" | <ped>
| |
| |-
| |
| ! style="background-color: #EEE"|Property
| |
| ! style="background-color: #EEE"|Type
| |
| |-
| |
| | style="background-color: #EEE"|position
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| | style="background-color: #EEE"|model
| |
| | style="background-color: #EEE"|skinID
| |
| |-
| |
| | style="background-color: #EEE"|rotZ
| |
| | style="background-color: #EEE"|number
| |
| |-
| |
| | style="background-color: #EEE"|interior
| |
| | style="background-color: #EEE"|integer
| |
| |-
| |
| | style="background-color: #EEE"|dimension
| |
| | style="background-color: #EEE"|integer
| |
| |}
| |
| | |
| | |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE" colspan="2" | <pickup>
| |
| |-
| |
| ! style="background-color: #EEE"|Property
| |
| ! style="background-color: #EEE"|Type
| |
| |-
| |
| | style="background-color: #EEE"|position
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| | style="background-color: #EEE"|type
| |
| | style="background-color: #EEE"|pickupType
| |
| |-
| |
| | style="background-color: #EEE"|amount
| |
| | style="background-color: #EEE"|number
| |
| |-
| |
| | style="background-color: #EEE"|respawn
| |
| | style="background-color: #EEE"|integer
| |
| |-
| |
| | style="background-color: #EEE"|interior
| |
| | style="background-color: #EEE"|integer
| |
| |-
| |
| | style="background-color: #EEE"|dimension
| |
| | style="background-color: #EEE"|integer
| |
| |}
| |
| | |
| | |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE" colspan="2" | <vehicle>
| |
| |-
| |
| ! style="background-color: #EEE"|Property
| |
| ! style="background-color: #EEE"|Type
| |
| |-
| |
| | style="background-color: #EEE"|model
| |
| | style="background-color: #EEE"|vehicleID
| |
| |-
| |
| | style="background-color: #EEE"|position
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| | style="background-color: #EEE"|rotation
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| | style="background-color: #EEE"|color
| |
| | style="background-color: #EEE"|vehiclecolors
| |
| |-
| |
| | style="background-color: #EEE"|upgrades
| |
| | style="background-color: #EEE"|vehicleupgrades
| |
| |-
| |
| | style="background-color: #EEE"|plate
| |
| | style="background-color: #EEE"|plate
| |
| |-
| |
| | style="background-color: #EEE"|interior
| |
| | style="background-color: #EEE"|integer
| |
| |-
| |
| | style="background-color: #EEE"|dimension
| |
| | style="background-color: #EEE"|integer
| |
| |}
| |
| | |
| | |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE" colspan="2" | <radararea>
| |
| |-
| |
| ! style="background-color: #EEE"|Property
| |
| ! style="background-color: #EEE"|Type
| |
| |-
| |
| | style="background-color: #EEE"|posX
| |
| | style="background-color: #EEE"|number
| |
| |-
| |
| | style="background-color: #EEE"|posY
| |
| | style="background-color: #EEE"|number
| |
| |-
| |
| | style="background-color: #EEE"|sizeX
| |
| | style="background-color: #EEE"|number
| |
| |-
| |
| | style="background-color: #EEE"|sizeY
| |
| | style="background-color: #EEE"|number
| |
| |-
| |
| | style="background-color: #EEE"|color
| |
| | style="background-color: #EEE"|color
| |
| |-
| |
| | style="background-color: #EEE"|dimension
| |
| | style="background-color: #EEE"|integer
| |
| |}
| |
| | |
| ===Built-in property names===
| |
| Properties with these names have a special meaning to the editor and can be modified by other means than the Properties window.
| |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE"|Name
| |
| ! style="background-color: #EEE"|Type
| |
| |-
| |
| ! style="background-color: #EEE"|position
| |
| | style="background-color: #EEE"|coord3d
| |
| |-
| |
| ! style="background-color: #EEE"|rotation
| |
| | style="background-color: #EEE"|coord3d
| |
| |}
| |
| | |
| ===Property types===
| |
| These are the types you can choose from for the properties (<data>) of your custom elements.
| |
| | |
| ====Primitives====
| |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE"|Name
| |
| ! style="background-color: #EEE"|Description
| |
| ! style="background-color: #EEE"|Value
| |
| |-
| |
| ! style="background-color: #EEE"|boolean
| |
| | style="background-color: #EEE"|Simple boolean value.
| |
| | style="background-color: #EEE"|"true" or "false"
| |
| |-
| |
| ! style="background-color: #EEE"|natural
| |
| | style="background-color: #EEE"|Natural number (whole and non-negative).
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|integer
| |
| | style="background-color: #EEE"|Whole number.
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|number
| |
| | style="background-color: #EEE"|Rational number.
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|string
| |
| | style="background-color: #EEE"|Simple string of text.
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|color
| |
| | style="background-color: #EEE"|color, with or without alpha.
| |
| | style="background-color: #EEE"|#RRGGBB or #RRGGBBAA
| |
| |}
| |
| | |
| ====Coordinates====
| |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE"|Name
| |
| ! style="background-color: #EEE"|Description
| |
| ! style="background-color: #EEE"|Value
| |
| |-
| |
| ! style="background-color: #EEE"|camera
| |
| | style="background-color: #EEE"|Position and lookat coordinates for the camera.
| |
| | style="background-color: #EEE"|posX,posY,posZ,lookatX,lookatY,lookatZ
| |
| |-
| |
| ! style="background-color: #EEE"|coord3d
| |
| | style="background-color: #EEE"|3-component vector, typically used for positions and rotations.
| |
| | style="background-color: #EEE"|x,y,z
| |
| |}
| |
| | |
| ====Vehicles====
| |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE"|Name
| |
| ! style="background-color: #EEE"|Description
| |
| ! style="background-color: #EEE"|Value
| |
| |-
| |
| ! style="background-color: #EEE"|plate
| |
| | style="background-color: #EEE"|Number plate text for a vehicle.
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|vehiclecolors
| |
| | style="background-color: #EEE"|colors of a vehicle
| |
| | style="background-color: #EEE"|colorID1,colorID2,colorID3,colorID4
| |
| |-
| |
| ! style="background-color: #EEE"|vehicleupgrades
| |
| | style="background-color: #EEE"|Upgrades of a vehicle
| |
| | style="background-color: #EEE"|upgradeID1,upgradeID2,...
| |
| |}
| |
| | |
| ====Model ID's====
| |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE"|Name
| |
| ! style="background-color: #EEE"|Description
| |
| ! style="background-color: #EEE"|Value
| |
| |-
| |
| ! style="background-color: #EEE"|blipID
| |
| | style="background-color: #EEE"|Picture ID for blips
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|objectID
| |
| | style="background-color: #EEE"|Model ID for objects
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|pickupType
| |
| | style="background-color: #EEE"|Armor, health or weapon
| |
| | style="background-color: #EEE"|"armor", "health" or numeric weapon ID
| |
| |-
| |
| ! style="background-color: #EEE"|skinID
| |
| | style="background-color: #EEE"|Skin ID for peds
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|vehicleID
| |
| | style="background-color: #EEE"|Model ID for vehicles
| |
| | style="background-color: #EEE"|
| |
| |-
| |
| ! style="background-color: #EEE"|weaponID
| |
| | style="background-color: #EEE"|Weapon, e.g. M4
| |
| | style="background-color: #EEE"|Numeric weapon ID, e.g. 31
| |
| |}
| |
| | |
| ====Colshapes and markers====
| |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE"|Name
| |
| ! style="background-color: #EEE"|Description
| |
| ! style="background-color: #EEE"|Value
| |
| |-
| |
| ! style="background-color: #EEE"|colshapeType
| |
| | style="background-color: #EEE"|collision circle, cube, rectangle, sphere or tube
| |
| | style="background-color: #EEE"|One of: "colcircle", "colcube", "colrectangle", "colsphere", "coltube"
| |
| |-
| |
| ! style="background-color: #EEE"|markerType
| |
| | style="background-color: #EEE"|Arrow, checkpoint, corona, cylinder or ring marker.
| |
| | style="background-color: #EEE"|One of: "arrow", "checkpoint", "corona", "cylinder", "ring"
| |
| |-
| |
| |}
| |
| | |
| ====Specials====
| |
| {| cellspacing="1"
| |
| ! style="background-color: #EEE"|Name
| |
| ! style="background-color: #EEE"|Description
| |
| ! style="background-color: #EEE"|Value
| |
| |-
| |
| ! style="background-color: #EEE"|element:type
| |
| | style="background-color: #EEE"|Element of a certain type, for example: element:flag
| |
| | style="background-color: #EEE"|The element's ID
| |
| |-
| |
| ! style="background-color: #EEE"|selection:val1,val2,...
| |
| | style="background-color: #EEE"|Shows a dropdown box from which to pick one value.
| |
| | style="background-color: #EEE"|The selected value
| |
| |}
| |
| [[ru:Resource:Editor/EDF]]
| |