Jump to content
Sign in to follow this  
A-SUICIDAL

custom ammo box appears at new captured area?

Recommended Posts

At the start of my coop mission there is an custom ammo box with all weapons in it. It has the following ammo box filler script in its init field:

null0 = this execVM "ammo.sqf"; this allowDamage false;

My team later captures an area and our respawn location then becomes the new area we just captured. How can I get the custom filled ammo box to then appear at our new respawn location? Can the ammo box at mission start be relocated to the new respawn location? So far I have figured out how to create a new ammo box at the new respawn location, but I am having trouble filling the new ammo box with all weapons.

To create the new ammo box, so far I have:

_ammobox1 = "USSpecialWeapons_EP1" createVehicle (getMarkerPos "area2");

...but then I get stuck on the part where I am trying to exec the ammo.sqs

I tried using setVehicleInit, but I think I'm doing it wrong.

It would be easier to just relocate the ammo box from the starting point in the mission to area2, but I don't know how to do that either.

Any help with this would be greatly appreciated. Also, I was trying to change a Takistani flag to a USA flag using setFlagTexture, but I don't know what the default USA flag texture path would be.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

Why not place the ammo box on the map and fill it with what you want, then as the game progresses you just getmarkerpos and setpos the box to where you want it.

Put the box at your start point, then when obj 1 is complete move it there, obj 2 complete etc...

Edited by cobra4v320

Share this post


Link to post
Share on other sites

I'm not sure how to do that, but I will try. That is exactly what I want to do.

Share this post


Link to post
Share on other sites

Something along these lines should work for you, not tested.

Place this into your ammbox init:

nul = [this] execVM "boxmove.sqf"

boxmove.sqf

_ammobox = _this select 0;

_run 		= true;

while {_run} do
{
  if (!alive _ammobox) then {_run = false};

waituntil {_run = false or obj1 = true};

_ammobox setPos (getmarkerPos "area1");

waituntil {_run = false or obj2 = true};

_ammobox setPos (getmarkerPos "area2");

};

Here is a crate filler script by Tophe:

http://www.armaholic.com/page.php?id=11346

Edited by cobra4v320

Share this post


Link to post
Share on other sites

I really appreciate all your help. I'm trying so hard to get this to work, but I'm still having trouble.

Basically I step within a trigger and it immediately sets the small red ellipse marker area surrounding the trigger from Red to Green, changes the flag from Takistani to USA, changes the respawn location to be that area. The only thing missing is the indestructible custom filled ammo box which I want to move to that new location. So basically I just need the trigger to change the location of the ammo box and keep its custom added weapons script running and not conflict. No other functions are needed.

I'm using "Ammo Box Filler" from http://www.armaholic.com/page.php?id=5843

In the ammo box init field it uses:

null0 = this execVM "ammo.sqf"; this allowDamage false;

There will be 8 small areas that need to be captured in any order. As each area is captured it will then become the new respawn area. Everything is working except for the ammo box relocating to the new respawn area.

Based on the above example you posted. Do I name the 8 triggers to be called obj1, obj2, obj3, obj4, obj5, obj6, obj7 and obj8 ? Do I name the 8 small Red Ellipse markers to be called area1, area2, area3, area4, area5, area6, area7 and area8 ?

Where you had put:

waituntil {_run = false or obj1 = true};

I'm not at the level yet where I understand all that stuff, but I'm trying my best.

Is there an example mission anywhere that I could download that simple has a trigger that causes a crate to move from one location to another?

---------- Post added at 05:56 PM ---------- Previous post was at 05:10 PM ----------

I tried this earlier:

ammobox setPos (getmarkerPos "area1");

and it didn't work.

Then I just tried it again and it did work. Must've been a typo on my part. It's unbelievable how much time can be wasted trying to resolve and issue with something that simply needed proof reading.

Share this post


Link to post
Share on other sites

_ammobox = _this select 0; ////lets you select the box in game

_run 		= true; 

while {_run} do   ////while {condition run is true} do
{
  if (!alive _ammobox) then {_run = false}; ////then it is checking if the box is alive or not, if its not then the script exits by run = false

waituntil {_run = false or obj1 = true}; ////waituntil {this condition is true} the script will not move on until this condition has been met.

_ammobox setPos (getmarkerPos "area1"); ////setting your box location

waituntil {_run = false or obj2 = true}; /////waituntil {the condition is met}

_ammobox setPos (getmarkerPos "area2");

};

Here is a list of code structures: http://community.bistudio.com/wiki/Control_Structures

Here are the scripting commands: http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2

Edited by cobra4v320

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  

×