Dynamic Object Compositions – Arma 2

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "ArmA III" to "{{arma3}}")
m (Some wiki formatting)
 
Line 1: Line 1:
{{GameCategory|arma2|Editor Modules}}
{{TOC|side}}
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.


== 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.
{{Feature|informative|This page was written for {{arma2}}.}}
{{Feature|informative|This page was written for {{arma2}}.}}


== How to add BIS compositions ==


To add one of the BIS premade compositions simply create a gamelogic and the code below into the init field <pre>_newComp = [(getPos this), (getDir this), "FuelDump1_US"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));</pre>
== How to add BI compositions ==
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: <pre>_newComp = [(getPos this), random 360, ["usmc", "medium"]] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));</pre>
Where ''"usmc"'' & ''"medium"'' are the tags used.


== Creating custom compositions ==
To add one of the BIS premade compositions simply create a gamelogic and the code below into the init field:
<sqf>_newComp = [getPos this, getDir this, "FuelDump1_US"] call compile preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf";</sqf>


How to create a custom composition:
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:
<sqf>_newComp = [getPos this, random 360, ["usmc", "medium"]] call compile preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf";</sqf>
Where ''"usmc"'' and ''"medium"'' are the tags used.


1) Download the customized (from {{Link|link= http://forums.bistudio.com/showthread.php?130462-How-do-I-precisely-place-local-objects-consistently&p=2096215&viewfull=1#post2096215|text= this post}}) objectGrabber & objectMapper scripts : {{Link|http://www.mediafire.com/?ilgwjijl4gxpg8c|link}}


2) Open the editor (2d) using the map "Render Island" or another island with some flat space.
== Creating Custom Compositions ==


3) Create & save a mission. Then put the objectGrabber.sqf script into the mission folder.
How to create a custom composition:


4) Place your objects on the map.
Download the customized (from {{Link|link= http://forums.bistudio.com/showthread.php?130462-How-do-I-precisely-place-local-objects-consistently&p=2096215&viewfull=1#post2096215|text= this post}}) objectGrabber & objectMapper scripts: {{Link|http://www.mediafire.com/?ilgwjijl4gxpg8c|link}}
# Open the editor (2d) using the map "Render Island" or another island with some flat space.
# Create & save a mission. Then put the objectGrabber.sqf script into the mission folder.
# Place your objects on the map.
# If you want a custom object init you have to use this format in the initialization field of the object otherwise it won't be grabbed: <sqf>
this setvariable ["VehicleInit","<YOUR INITSTRING>;"]
</sqf>
# Place the player unit in the middle of your composition and put this in its init: <sqf>null = [getPos this, 200] execVM "objectGrabber.sqf"; // (200 is the radius, adjust when needed).</sqf>
# Preview the mission, the objects are now written in arma2.rpt
# Copy all text between "startgrabbing" and "endgrabbing" (not the ### lines) and paste this in the file {{hl|composition_template.sqf}} at the marked area.
# Remove the comma at the last line of the copied text. Example arma2.rpt:<sqf>
["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,{}], // here
</sqf>After editing:<sqf>
["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,{}]
</sqf><br>It should now look like the example in the scripts
# Then save the file as "yourCompositionName.sqf"


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
{{Feature|important|
grabbed: this setvariable ["VehicleInit","<YOUR INITSTRING>;"]
The above process is not working in {{arma3}}.
See {{Link|link= http://forums.bistudio.com/showthread.php?173396-Dynamic-Object-Compositions-(DoC)&p=2641626&viewfull=1#post2641626|text= this thread}} for information about a compatible one.
}}


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>


7) Preview the mission, the objects are now written in arma2.rpt
== Spawning Custom Compositions ==
 
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"
 
 
IMPORTANT NOTE: The above process is not working in {{arma3}}. See {{Link|link= http://forums.bistudio.com/showthread.php?173396-Dynamic-Object-Compositions-(DoC)&p=2641626&viewfull=1#post2641626|text= this thread}} for information about a compatible one.
 
== Spawning custom compositions ==


To place your custom composition in your mission
To place your custom composition in your mission


1) Place the objectMapper.sqf file into your mission directory.
# Place the {{hl|objectMapper.sqf}} file into your mission directory.
# Create a folder called 'compositions' in your mission directory and place the composition there.
# Place a game logic on the map and put this in the init: <sqf>null = ["test_comp", getDir this, getPos this] execVM "objectMapper.sqf"; // (replace "test_comp" with your own compositioname without '.sqf')</sqf>
# Preview the mission and your composition is placed (you can place multiple and different compositions at once).


2) Create a folder called 'compositions' in your mission directory and place the composition there.


3) Place a game logic on the map and put this in the init: null = ["test_comp", getDir this, getPos this] execVM "objectMapper.sqf (replace "test_comp" with your own compositioname without '.sqf')
{{Feature|important|
The above process is not working in {{arma3}}.
See {{Link|link= http://forums.bistudio.com/showthread.php?173396-Dynamic-Object-Compositions-(DoC)&p=2641626&viewfull=1#post2641626|text= this thread}} for information about a compatible one.
}}


4) Preview the mission and your composition is placed (you can place multiple and different compositions at once).


== Composition library ==


IMPORTANT NOTE: The above process is not working in {{arma3}}. See {{Link|link= http://forums.bistudio.com/showthread.php?173396-Dynamic-Object-Compositions-(DoC)&p=2641626&viewfull=1#post2641626|text= this thread}} for information about a compatible one.
== Composition library ==
{{Link|link= http://forums.bistudio.com/showthread.php?s=7a61764b758d515d2d989266e9e80ec3&p=1673511#post1673511|text= Rok's script to put all on map}}
{{Link|link= http://forums.bistudio.com/showthread.php?s=7a61764b758d515d2d989266e9e80ec3&p=1673511#post1673511|text= Rok's script to put all on map}}


{{Feature|important|NOTE: While the list above is useful, some of the composition classnames are incorrect in the pictures.}}
{{Feature|important|While the list above is useful, some of the composition classnames are incorrect in the pictures.}}


=== List of classnames ===
=== {{arma2}} Classnames ===


{{Columns|5|
* SmallBase
* SmallBase
* CityBase01
* CityBase01
Line 157: Line 154:
* FiringRange_Water1
* FiringRange_Water1
* FiringRange_Water2
* FiringRange_Water2
}}


=== List of classnames: OA ===
=== {{arma2oa}} Classnames ===


{{Columns|5|
* SmallBase_EP1
* SmallBase_EP1
* CityBase01_EP1
* CityBase01_EP1
Line 224: Line 223:
* MPA_infoKiosk2
* MPA_infoKiosk2
* MPA_infoKiosk3
* MPA_infoKiosk3
}}
{{GameCategory|arma2|Editor Modules}}

Latest revision as of 22:41, 29 March 2024

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.


This page was written for Arma 2.


How to add BI compositions

To add one of the BIS premade compositions simply create a gamelogic and the code below into the init field:

_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" and "medium" are the tags used.


Creating Custom Compositions

How to create a custom composition:

Download the customized (from this post) objectGrabber & objectMapper scripts: link

  1. Open the editor (2d) using the map "Render Island" or another island with some flat space.
  2. Create & save a mission. Then put the objectGrabber.sqf script into the mission folder.
  3. Place your objects on the map.
  4. If you want a custom object init you have to use this format in the initialization field of the object otherwise it won't be grabbed:
    this setvariable ["VehicleInit","<YOUR INITSTRING>;"]
  5. 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).
  6. Preview the mission, the objects are now written in arma2.rpt
  7. Copy all text between "startgrabbing" and "endgrabbing" (not the ### lines) and paste this in the file composition_template.sqf at the marked area.
  8. Remove the comma 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,{}], // here
    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 the scripts
  9. Then save the file as "yourCompositionName.sqf"
The above process is not working in Arma 3. See this thread for information about a compatible one.


Spawning Custom Compositions

To place your custom composition in your mission

  1. Place the objectMapper.sqf file into your mission directory.
  2. Create a folder called 'compositions' in your mission directory and place the composition there.
  3. Place a game logic on the map and put this in the init:
    null = ["test_comp", getDir this, getPos this] execVM "objectMapper.sqf"; // (replace "test_comp" with your own compositioname without '.sqf')
  4. Preview the mission and your composition is placed (you can place multiple and different compositions at once).


The above process is not working in Arma 3. See this thread for information about a compatible one.


Composition library

Rok's script to put all on map

While the list above is useful, some of the composition classnames are incorrect in the pictures.

Arma 2 Classnames

  • SmallBase
  • CityBase01
  • CityBase02
  • CityBase04
  • BunkerMedium01
  • BunkerMedium02
  • BunkerMedium03
  • BunkerMedium04
  • BunkerMedium05
  • BunkerMedium06
  • BunkerMedium07
  • BunkerMedium08
  • BunkerMedium09
  • BunkerMedium10
  • GuardPost_US
  • GuardPost2_US
  • GuardPost3_US
  • GuardPost4_US
  • GuardPost5_US
  • GuardPost6_US
  • GuardPost7_US
  • GuardPost8_US
  • SmallNest_US
  • VehicleShelter_US
  • FuelDepot_US
  • CheckPoint1_US
  • AntiAir1_US
  • Firebase1_US
  • FuelDump1_US
  • RadarSite1_US
  • VehicleParking1_US
  • HeliParking1_US
  • AirplaneParking1_US
  • WeaponsStore1_US
  • Camp1_US
  • Camp2_US
  • Camp3_US
  • MediumTentCamp_RU
  • MediumTentCamp2_RU
  • MediumTentCamp3_RU
  • AntiAir1_RU
  • Firebase1_RU
  • FuelDump1_RU
  • RadarSite1_RU
  • VehicleParking1_RU
  • HeliParking1_RU
  • AirplaneParking1_RU
  • WeaponsStore1_RU
  • Camp1_RU
  • Camp2_RU
  • GuardPost_CDF
  • VehicleShelter_CDF
  • TankDitch_CDF
  • TankDitch2_CDF
  • CityBase03
  • BunkerSmall01
  • MediumTentCamp_napa
  • SmallTentCamp_napa
  • SmallTentCamp2_napa
  • Camp1_INS
  • Camp2_INS
  • FiringRange1
  • FiringRange2
  • FiringRange3
  • FiringRange4
  • FiringRange5
  • FiringRange6
  • FiringRange7
  • FiringRange8
  • FiringRange9
  • FiringRange10
  • FiringRange11
  • FiringRange_Wreck1
  • FiringRange_Wreck2
  • FiringRange_Wreck3
  • FiringRange_Wreck4
  • FiringRange_Wreck5
  • FiringRange_Wreck6
  • FiringRange_Wreck7
  • FiringRange_Water1
  • FiringRange_Water2

Arma 2: Operation Arrowhead Classnames

  • SmallBase_EP1
  • CityBase01_EP1
  • CityBase02_EP1
  • CityBase04_EP1
  • BunkerMedium01_EP1
  • BunkerMedium02_EP1
  • BunkerMedium03_EP1
  • BunkerMedium04_EP1
  • BunkerMedium05_EP1
  • BunkerMedium06_EP1
  • BunkerMedium07_EP1
  • BunkerMedium08_EP1
  • BunkerMedium09_EP1
  • BunkerMedium10_EP1
  • GuardPost_US_EP1
  • GuardPost2_US_EP1
  • GuardPost3_US_EP1
  • GuardPost4_US_EP1
  • GuardPost5_US_EP1
  • GuardPost6_US_EP1
  • GuardPost7_US_EP1
  • GuardPost8_US_EP1
  • SmallNest_US_EP1
  • VehicleShelter_US_EP1
  • FuelDepot_US_EP1
  • CheckPoint1_US_EP1
  • AntiAir1_US_EP1
  • Firebase1_US_EP1
  • FuelDump1_US_EP1
  • RadarSite1_US_EP1
  • VehicleParking1_US_EP1
  • HeliParking1_US_EP1
  • AirplaneParking1_US_EP1
  • WeaponsStore1_US_EP1
  • Camp1_US_EP1
  • Camp2_US_EP1
  • Camp3_US_EP1
  • MediumTentCamp_TK_EP1
  • MediumTentCamp2_TK_EP1
  • MediumTentCamp3_TK_EP1
  • AntiAir1_TK_EP1
  • Firebase1_TK_EP1
  • FuelDump1_TK_EP1
  • RadarSite1_TK_EP1
  • VehicleParking1_TK_EP1
  • HeliParking1_TK_EP1
  • AirplaneParking1_TK_EP1
  • WeaponsStore1_TK_EP1
  • Camp1_TK_EP1
  • Camp2_TK_EP1
  • GuardPost_CZ_EP1
  • VehicleShelter_CZ_EP1
  • TankDitch_CZ_EP1
  • TankDitch2_CZ_EP1
  • CityBase03_CZ_EP1
  • BunkerSmall01_CZ_EP1
  • MediumTentCamp_GUE_EP1
  • SmallTentCamp_GUE_EP1
  • SmallTentCamp2_GUE_EP1
  • Camp1_TKM_EP1
  • Camp2_TKM_EP1
  • MPA_infoKiosk1
  • MPA_infoKiosk2
  • MPA_infoKiosk3