Dynamic Object Compositions – Arma 2
No edit summary |
No edit summary |
||
Line 18: | Line 18: | ||
How to create a custom composition: | How to create a custom composition: | ||
1) Download the objectGrabber & objectMapper scripts: [http://www.filefront.com/15846565/custom_compositions.rar] | 1) Download the objectGrabber & objectMapper scripts: [http://www.filefront.com/15846565/custom_compositions.rar] | ||
2) Open the editor (2d) using the map "Render Island" or another island with some flat space. | 2) Open the editor (2d) using the map "Render Island" or another island with some flat space. | ||
3) Create & save a mission. Then put the objectGrabber.sqf script into the mission folder. | 3) Create & save a mission. Then put the objectGrabber.sqf script into the mission folder. | ||
4) Place your objects on the map. | 4) Place your objects on the map. | ||
5) If you want a custom object init you have to use this format in the initialization field of the object otherwise it wont be | 5) If you want a custom object init you have to use this format in the initialization field of the object otherwise it wont be | ||
grabbed: this setvariable ["VehicleInit","<YOUR INITSTRING>;"] | grabbed: this setvariable ["VehicleInit","<YOUR INITSTRING>;"] | ||
Line 26: | Line 30: | ||
6) Place the player unit in the middle of your composition and put this in its init: | 6) Place the player unit in the middle of your composition and put this in its init: | ||
<pre>null = [getpos this,200] execvm "objectGrabber.sqf"; // (200 is the radius, adjust when needed).</pre> | <pre>null = [getpos this,200] execvm "objectGrabber.sqf"; // (200 is the radius, adjust when needed).</pre> | ||
7) Preview the mission, the objects are now written in arma2.rpt | 7) Preview the mission, the objects are now written in arma2.rpt | ||
8) Copy all text between "startgrabbing" and "endgrabbing" (not the ### lines) and paste this in the file composition_template.sqf | 8) Copy all text between "startgrabbing" and "endgrabbing" (not the ### lines) and paste this in the file composition_template.sqf | ||
at the marked area. | at the marked area. | ||
9) Remove , at the last line of the copied text. | 9) Remove , at the last line of the copied text. | ||
Example arma2.rpt: | Example arma2.rpt: | ||
Line 40: | Line 47: | ||
["ACamp",[-41.3973,-33.6524,0],0,1,0] | ["ACamp",[-41.3973,-33.6524,0],0,1,0] | ||
It should now look like the example in with the scripts | It should now look like the example in with the scripts | ||
10) Then save the file as "yourCompositionName.sqf" | |||
== Composition library == | == Composition library == | ||
List of all compositions with pictures: http://www.armatechsquad.com/ArmA2Class/Objects/compositions/ | List of all compositions with pictures: http://www.armatechsquad.com/ArmA2Class/Objects/compositions/ |
Revision as of 17:02, 22 March 2010
Note: this page is a work-in-progress! More info to follow as soon as possible.
Introduction
The Dynamic Object module (DynO) was made to make spawning entire sets / templates of objects much easier (e.g. an entire base). It is possible to spawn specific sets of objects or ask a library for a random set matching a list of tags. The system is flexible so that anyone may grab new sets, register them and all systems using the DynO sets will spawn the new sets as well.
How to add BIS compositions
To add one of the BIS premade compositions simply create a gamelogic and put
_newComp = [(getPos this), (getDir this), "FuelDump1_US"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
Where "FuelDump1_US" is the composition name you want to spawn (check composition library for names of BIS compositions).
You can also spawn compositions by searching the library for matching tags, for example:
_newComp = [(getPos this), random 360, ["usmc", "medium"]] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
Where "usmc" & "medium" are the tags used.
Custom compositions
How to create a custom composition: 1) Download the objectGrabber & objectMapper scripts: [1]
2) Open the editor (2d) using the map "Render Island" or another island with some flat space.
3) Create & save a mission. Then put the objectGrabber.sqf script into the mission folder.
4) Place your objects on the map.
5) If you want a custom object init you have to use this format in the initialization field of the object otherwise it wont be grabbed: this setvariable ["VehicleInit","<YOUR INITSTRING>;"]
6) Place the player unit in the middle of your composition and put this in its init:
null = [getpos this,200] execvm "objectGrabber.sqf"; // (200 is the radius, adjust when needed).
7) Preview the mission, the objects are now written in arma2.rpt
8) Copy all text between "startgrabbing" and "endgrabbing" (not the ### lines) and paste this in the file composition_template.sqf at the marked area.
9) Remove , at the last line of the copied text.
Example arma2.rpt: ["MASH",[0,0,0],0,1,0], ["Land_GuardShed",[35.9503,29.7019,0],0,1,0], ["ACamp",[-41.3973,-33.6524,0],0,1,0],
After editing: ["MASH",[0,0,0],0,1,0], ["Land_GuardShed",[35.9503,29.7019,0],0,1,0], ["ACamp",[-41.3973,-33.6524,0],0,1,0] It should now look like the example in with the scripts
10) Then save the file as "yourCompositionName.sqf"
Composition library
List of all compositions with pictures: http://www.armatechsquad.com/ArmA2Class/Objects/compositions/