Jump to content
Sign in to follow this  
Benoist

Trench Generator

Recommended Posts

Trench Generator by RAVEN from Clan RAV (www.armedassault.com.ar)

Armed Assault only

Download: http://200.58.114.81/~cr000493/scripts/Trinchera.rar

Other mirrors:

@ Armed Assault Zone (Thanks jammydodger)

Combat-Prison.net (Thanks Stavanger)

Demo Mission: http://200.58.114.81/~cr000493/scripts/Test_Trinchera.rar

Script generator (with sandbag addon)

http://img.photobucket.com/albums....-34.jpg

http://img.photobucket.com/albums....-84.jpg

http://img.photobucket.com/albums....-35.jpg

http://img.photobucket.com/albums....-90.jpg

SCRIPT:

; ******************************************************************************************

*

; ** Script Name: TRINCHERA.SQS

; ** Description: Arma trench

; ******************************************************************************************

*

; ** Made by: RAVEN

; ******************************************************************************************

*

; ** Invocation: [this,"BolsaArena",270,5,1,0,Inv_XY,[Ajx, AJy, AJz]] exec "trinchera.sqs"

; *******************************************************************************

; ** Parametro1 = logical drive that it contains the call to script

; ** Parametro2 = Object to use to raise trench

; ** Parametro3 = Degrees of cover

; ** Parametro4 = Amount of bags

; ** Parametro5 = Radio (in meters)

; ** Parametro6 = Way to pile up (0: vertical, 1: Concave)

; ** Parametro7 = Investment of dimensions X/Y of object

; ** Parametro8 = Vector of adjustment of dimensions of object (3 elements)

; *******************************************************************************

_marca = _this select 0

_bolsa = _this select 1

_frente= _this select 2

_alt = _this select 3

_rad = _this select 4

_modo = _this select 5

_InvXY = _this select 6

_AjDim = _this select 7

_canElem = count _this

;--- Determina dimensiones de objeto

_obj = _bolsa createvehicle [0,0,0]

_dim = boundingBox _obj

deletevehicle _obj

_Ang = 0

_Ajx = 0; _Ajy = 0; _Ajz = 0

? _canElem < 8 : goto "Calculos"

_Ajx = _AjDim select 0

_Ajy = _AjDim select 1

_Ajz = _AjDim select 2

#Calculos

_set1 = _dim select 1

_px1 = (_set1 select 0) + _Ajx

_py1 = (_set1 select 2) + _Ajy

_pz1 = (_set1 select 1) + _Ajz

_dx = (_px1 * 2)

_dy = (_py1 * 2)

_dz = _pz1

? _InvXY : _dx = (_py1 * 2); _dy = (_px1 * 2); _Ang = 90

_bolsas = ((2 * PI * _rad) / _dx)

_tope = (_frente * _bolsas) / 360

_tramo = (360 / _bolsas)

? _rad < 1: _rad = 1

? _frente > 300: _frente = 300

? _alt > 6: _alt = 6

? _modo != 0 and _modo != 1: _modo = 0

_dir = direction _marca

_posm = getpos _marca

_pz = _posm select 2

#ciclo1

_gini = _dir - (_frente / 2)

_gfin = _dir + (_frente / 2)

_contador = 0

_px = _posm select 0

_py = _posm select 1

#ciclo2

_ppx = _px + (_rad * sin(_gini))

_ppy = _py + (_rad * cos(_gini))

_ppz = _pz

_x = _bolsa createvehicle [0,0,0]

_x setpos [_ppx, _ppy, _ppz]

_x setdir (_gini + _Ang)

_contador = _contador + 1

? _contador > _tope: goto "ciclo3"

_gini = _gini + _tramo

? _gini <= _gfin: goto "ciclo2"

#ciclo3

? _modo == 1: _rad = _rad - (_dy / 3)

_frente = _frente - (_frente / _tope)

_tope = _tope - 1

_alt = _alt - 1

_pz = _pz + _dz

? _alt > 0: goto "ciclo1"

#salida

exit

FUNCTIONALITY:

Put special attention in the parameters form that script.

First it is the name of the object on which the trench will be assembled (generally a logical drive), but also it can be an object like a mounted M2 or a tube of artillery. The direction that we give this unit it will be used like direction towards which the trench will be faced.

The second parameter is the object that will be used to raise the trench. It can be a trunk of tree, one sand stock market (addon under section EMPTY/FIRESTORM-OBJECTS is included) or even can be rocks.

Whenever we know its name. (EJ: FenceWood).

Script “reads†the dimensions of the object (long, high, wide) and begins to pile up it according to the other parameters.

The third parameter talks about the circumference degrees that will include the trench. (180 will be of left

to right of the center, 360 will be all the circumference, etc).

The fourth parameter talks about the amount of rows that will be piled up of the selected object.

Fifth, it is the radius of the circumference of the trench and depends on which will protect (men, vehicles, arms).

Sixth, it is the way to pile up objects (0: he is cylindrical and 1: he is conical)

Seventh, it treats on the possibility of investing the dimensions of wide length and since some addon-makers

they do not design its objects with direction the north-south and they make it East-West.

The eighth and last parameter (optional) are an Array of 3 elements that stores modifiers of dimensions

of the object. For example, the FenceWood object - to apilarlo- it leaves underneath him, 25 centimeters empty (scale of Weapon)

that they are part of the object. Placing like third value of this one Array -0,25, we obtained that script fits the values

for a correct location and contact with the object underneath he himself.

I hope that the community takes advantage of it and we see ourselves in the battlefield (behind a good trench).

NOTE: He toldme to post this as a "sorry" for the fast rope script. This is an old work that he finished so he can use it to "buy" time.

Share this post


Link to post
Share on other sites
images please

Are you blind? biggrin_o.gif

There are 4 pics on the topic, just in link format. Click on them.

Share this post


Link to post
Share on other sites

Looks like a nifty item for Armed Asasult. I would politely ask:

If we have to pass parameters to the script can we get a  working example of an init line/trigger On Act string?

wink_o.gif

my bad. the invocation area of the script shows what we need to know

Share this post


Link to post
Share on other sites

Tenches is very good idea for Arma, and your imgs look great,

I tried to use the script with no good result, look i missed somthing, "note i'm new to arma, and trying to understand the use of scripts " help.gif

I put the script in my mission folder that i creat for test, i apply scrit to a M119 and use [this,"BolsaArena",270,5,1,0,Inv_XY,[Ajx, AJy, AJz]] exec "trinchera.sqs" and i only got one sand bag near the canon, i chage the value as descripted in "Functionality" circumference degrees, Object... and i alaways got one sand bag in different position. even with other stuf like FenceWood, same result.

could you please help me to understand, or better give us an exemple.

Ps. I love the idea that we can use other stuff from arma then sand bag.

Share this post


Link to post
Share on other sites

wow,

This stuff will finally releave me from that sandbag positioning the objects in the editor... which drives me nuts!

but is the name 'trenches' correct? i thought trenches were digged in the ground.

meh, whatever - im gonna use this!

Share this post


Link to post
Share on other sites

... omg all spanish ... plz give us a engl. how to do file ...

thx m8

btw great work - keep it up m8

Share this post


Link to post
Share on other sites
Benoit explains it in his post wink_o.gif

... so call my a noob BUT i am not able to get it to work if you can plz post an example or pm it to me

thx alot wink_o.gif

Share this post


Link to post
Share on other sites

Very good script! notworthy.gif

Let's take some examples together smile_o.gif

b1 = game logic

Script is activated by a trigger

[b1,"BolsaArena",270,5,2,0,10] exec "trinchera.sqs"

= Sandbags

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

roadcone1 = game logic

Script is activated by a trigger

[roadcone1,"RoadCone",360,1,5,0,10] exec "scripts\trinchera.sqs";

= Roadcones

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

guy1= game logic

Script is activated by a trigger

[guy1,"SoldierWB",270,1,2,0,10] exec "scripts\trinchera.sqs";

= Soldiers

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[guy1,"SoldierWB",270,5,2,0,10] exec "scripts\trinchera.sqs";

= LOL

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

wall01 = game logic

Script is activated by a trigger

[wall01,"wall1",360,1,5,0,10] exec "scripts\trinchera.sqs";

= Wall (US flag placed manually)

Share this post


Link to post
Share on other sites

Wiii my post appears in armedassaul.info, I can die happy, i help the community somehow ^^

The translation is from google, there were 3 o'clock in the morning, i start the first sentences i somehow it became french instead of english, so pardon me

Share this post


Link to post
Share on other sites
Sandbags, not trenches.

was just about to say that....

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×