Jump to content

I dont understand the scenery coords for custom mission


Recommended Posts

I understand how to change some of the mission file, but i don't get how the scenery works.

 

Here is a bit of code from EM1

_trash = createVehicle ["Barrels",[(_coords select 0) - 7.4511, (_coords select 1) + 3.8544,0],[], 0, "NONE"];
_trash setDir 61.911976;
[_trash] call DZMSProtectObj;

_trash1 = createVehicle ["Misc_palletsfoiled",[(_coords select 0) + 4.062, (_coords select 1) + 4.7216,0],[], 0, "NONE"];
_trash1 setDir -29.273479;
[_trash1] call DZMSProtectObj;

Can someone explain how I would take something I've built in the arma editor, an convert it for a mission. It's the cords bit I don't get! I understand to change classname etc

 

Thanks in advance

 

 

Link to comment
Share on other sites

Pretty easy.

 

_coords has been declared somewhere in the file (I thought using this piece of code: _coords = .... call DZMSFindSafePos?). 

So for example it generates coordinates: [0,1,2]. 

 

So, what that piece of code does is the following:

[(_coords select 0) + 4.062, (_coords select 1) + 4.7216,0]

_coords select 0, means that it selects the first 'entry' in the coordinates array, so the 0.
The + 4.062 means that it will add 4.062 to the 0 --> becomes so the 0 becomes 4.062
The _coords select 1 means that it will select the 2nd entry from the array, which is 1 in our case. 
The same story, the + 4.7... adds that value to the current value (1) and it will become 8,7..

 

Ask me if you have more questions or if this story is a bit unclear :)

 

Edit: Select (Bohemia Interactive Wiki)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...