Jump to content
Sign in to follow this  
Addetter

Remove the satchel charge touch off action?

Recommended Posts

So, as stated in the title, I want to remove the touch off action for satchel charges for an unit. But I still want the unit to be able to set the 40 seconds timer.

My TvT mission idea is sort of based on Battlefield 3's Rush mode, where one side is trying to destroy M-COM stations (In this case, ammo crates) while the other side is trying to defend those ammo crates. One side, in this case Blufor, is supposed to set a timed charge, and if the charge is planted opfor will have the possibility to defuse this charge. The opfor defusing feature can easily be done in arma 3 by giving opfor tool boxes. If possible, I also want a hint to indicate that Blufor have set a charge, and that Opfor have defused a charge.

So, to sum this up:

- Remove touchoff action on explosive charges and only have the 40 second timer action, or create an addaction that will plant an explosive that will be set on a 40 second timer.

- Hint to indicate when a satchel charge is on the ground next to the ammo crate, when the charge is planted, and when the charge is defused by Opfor.

Share this post


Link to post
Share on other sites

I tried the Addaction solution, seemed more neat. So, in the Init of an ammo box i put this code:

if (isServer) then  {   this addAction ["Plant Charge", "plant_charge.sqf"];  };

And then in "Plant_charge.sqf" I put this code:

#define arg(x) (_this select x)

if (local arg(1)) then
{
//Remove the "Plant Charge" action
arg(0) removeAction arg(2);

//Play an animation to simulate doing something
player playMove "Some animation i will find later";
sleep 5;


};

My problem now is that I do not want it to be able to do this action for everybody, only Blufor, and I want it to be able for Opfor to defuse this charge, and if they fail to do so within 1 minute, the ammo crate will blow up.

Share this post


Link to post
Share on other sites
I tried the Addaction solution, seemed more neat. So, in the Init of an ammo box i put this code:

if (isServer) then  {   this addAction ["Plant Charge", "plant_charge.sqf"];  };

And then in "Plant_charge.sqf" I put this code:

#define arg(x) (_this select x)

if (local arg(1)) then
{
//Remove the "Plant Charge" action
arg(0) removeAction arg(2);

//Play an animation to simulate doing something
player playMove "Some animation i will find later";
sleep 5;


};

My problem now is that I do not want it to be able to do this action for everybody, only Blufor, and I want it to be able for Opfor to defuse this charge, and if they fail to do so within 1 minute, the ammo crate will blow up.

Not sure if you can edit those items, will have to wait for someone experienced to shine in, but for some free logic, you don't necessarily need to have to use the satchel item. Maybe use something else, or ficticiously set it in the trigger area.. :D

Share this post


Link to post
Share on other sites

Well, when using the addaction there is no real satchel. But i need an opfor only addaction that resets the "Plant Charge" addaction so the Blufor side has to plant the charge again, but I think this is eventhandlers.

I also need the "Plant Charge" action to be Blufor restricted, I believe this wouldn't be too hard for an experienced scripter, which im obviously not. If possible it would be cool if an item (Which is the explosive charge) could spawn when its planted and dissapear if defused.

Share this post


Link to post
Share on other sites
Well, when using the addaction there is no real satchel. But i need an opfor only addaction that resets the "Plant Charge" addaction so the Blufor side has to plant the charge again, but I think this is eventhandlers.

I also need the "Plant Charge" action to be Blufor restricted, I believe this wouldn't be too hard for an experienced scripter, which im obviously not. If possible it would be cool if an item (Which is the explosive charge) could spawn when its planted and dissapear if defused.

for the more realistic action you want, probably easier to make a model and tie those actions to that model and bring it in game.. otherwise i would think its more less, area based trigger way points, with countdown timers... The triggers only trigger based upon what you tell them.. For example, if Opfor present and no Blufor, start countdown, after 10 seconds, remove bomb...

Share this post


Link to post
Share on other sites
So, as stated in the title, I want to remove the touch off action for satchel charges for an unit. But I still want the unit to be able to set the 40 seconds timer.

My TvT mission idea is sort of based on Battlefield 3's Rush mode, where one side is trying to destroy M-COM stations (In this case, ammo crates) while the other side is trying to defend those ammo crates. One side, in this case Blufor, is supposed to set a timed charge, and if the charge is planted opfor will have the possibility to defuse this charge. The opfor defusing feature can easily be done in arma 3 by giving opfor tool boxes. If possible, I also want a hint to indicate that Blufor have set a charge, and that Opfor have defused a charge.

So, to sum this up:

- Remove touchoff action on explosive charges and only have the 40 second timer action, or create an addaction that will plant an explosive that will be set on a 40 second timer.

- Hint to indicate when a satchel charge is on the ground next to the ammo crate, when the charge is planted, and when the charge is defused by Opfor.

Im unfamiliar with the syntax of Arma. But here is what i believe you need to do.

It is only Pseudocode.

//"_________" signifies spaces.

/**

*The following are variables that will be used as a timer, and

*to stop the timer and reset.

*/

int counter // <type> <identifier>

boolean stop = false //This needs to be global, will be used in the remove script.

/**

*Your First if statment should check if the player is blufor.

*If player is, execute the code. If not, display to user

*they are unable to execute and dnt execute the code.

*/

if (player is blufor) then //Check if player is blufor

_____removeAction //Remove plant action from the crate.

_____this.addaction(remove charge) //Add the remove action to crate.

_____while ((counter <= 40) and (!stop)) then

____________counter = counter + 1

_____if (counter == 40) then //40 is the time it takes to have the charge go off.

__________//BLOW UP THE CRATE.

__________removeAction(removecharge) //Get rid of this option.

__________counter = 0

_____else

__________//The charger was diffused because stop was set to true from removecharge script.

__________removeAction(removecharge)

__________addAction(plantcharge)

__________counter = 0

else //if player is opfor

____//display to player this is not possible.

---------- Post added at 15:04 ---------- Previous post was at 14:43 ----------

Remove Script Pseuocode.

/**

*Check if opfor. Set a disarmant time(sleep). set stop to true.

*/

int disarment = 5

int count = 0

if (player is opfor) then //Check if player is opfor

_____while ((player is alive) and (count <= disarment)

__________count = count + 1 //time it takes to disarm

_____if (count = disarment)

__________stop = true //stop the countdown

__________removeAction(removeCharge)

__________addAction(plantCharge)

_____else

__________count = 0 //restart counter because player was killed.

else //if player is bluefor

_____//display to player this is not possible.

Edited by Botelho

Share this post


Link to post
Share on other sites

A fantastic guy helped me with this, is this by any chance correct?:

Plant_charge.sqf:

if (side player == blufor) 
{
_then removeAction (Place Charge);
_player playMove "AinvPknlMstpSlayWrflDnon_medic";
_sleep 5;
_this addaction (Remove Charge);
_while ((counter <= 40) and (!stop)) then

{
counter = counter + 1;
};

if (counter == 40)
{
_then setdamage mycrate;
_removeaction (Removecharge);
_counter=0;
};

if (Stop == true)
{
_removeaction(removecharge);
_addaction(plantcharge);
_counter = 0;
};

if (side player == opfor) then
{
_
};

Remove_charge.sqf:

int disarment = 5
int count = 0

if (side player == opfor) then
{
_while ((alive) and (count <= disarment)
{
_count = count +1;
_sleep 1;
};

if (count = disarment)
{
_Stop = true;
_removeAction(removeCharge);
_addAction(plantCharge);
};

if player !alive
{
_count = 0
};

if


_count = 0;
};

if (side player == blufor) then
{
_
};

[/Code]

Edited by Addetter

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  

×