Jump to content
zooloo75

[SCRIPT] Explosive-To-Vehicle

Recommended Posts

Can you please finish the explosives script before moving onto another one. I would like the script errors fixed and a working respawn handler.

Share this post


Link to post
Share on other sites
Can you please finish the explosives script before moving onto another one. I would like the script errors fixed and a working respawn handler.

*hold on*

---------- Post added at 02:34 AM ---------- Previous post was at 02:09 AM ----------

Updated - Fixed script error and added a respawn EH. Download from the Dropbox link.

Share this post


Link to post
Share on other sites
*hold on*

---------- Post added at 02:34 AM ---------- Previous post was at 02:09 AM ----------

Updated - Fixed script error and added a respawn EH. Download from the Dropbox link.

Crashes the server and client on on respawn. Also not multiplayer compatible for local or dedicated. please test before uploading.

Share this post


Link to post
Share on other sites

Sorry for digging this thread back up, but I'm trying to create a mission, and need this script for the first part of the mission, but it won't work.

I'm brand new at this, and have next to no clue what I'm doing. So far, I've added the .sqf files to the mission folder, but am not sure what to do from there.

I'm using a custom loadout for my diver:

removeAllWeapons this; player addmagazines ["SatchelCharge_Remote_Mag", 5]; player addweapon "NVGoggles_opfor"; player addweapon "srifle_LRR_F"; player addmagazines ["7Rnd_408_Mag", 5]; {player addPrimaryWeaponItem _x} forEach ["optic_TWS"];

And the only way I've been able to get it to work is by deleting removeAllWeapons this;

So why does removing the diver's original gun have anything to do with whether the script runs?

Also, is there a way to not have my character yell out "there's a charge there!" for the doomed occupants of the boat to clearly hear? The whole point of this is to discretely place a charge on the bottom of a patrol boat, to set off later in the mission. And did anything come of being able to place the explosives from underneath the boat?

Thanks for your patience!

Share this post


Link to post
Share on other sites
Sorry for digging this thread back up, but I'm trying to create a mission, and need this script for the first part of the mission, but it won't work.

I'm brand new at this, and have next to no clue what I'm doing. So far, I've added the .sqf files to the mission folder, but am not sure what to do from there.

I'm using a custom loadout for my diver:

And the only way I've been able to get it to work is by deleting removeAllWeapons this;

So why does removing the diver's original gun have anything to do with whether the script runs?

Also, is there a way to not have my character yell out "there's a charge there!" for the doomed occupants of the boat to clearly hear? The whole point of this is to discretely place a charge on the bottom of a patrol boat, to set off later in the mission. And did anything come of being able to place the explosives from underneath the boat?

Thanks for your patience!

Not sure why your units load-out has anything to do with the interference of the script, my unit also has an entirely customized load out and it works just fine ;)

my unit load-out

removeAllWeapons RECON1; removeHeadgear RECON1; removevest RECON1; removeUniform RECON1; RECON1 addUniform "U_B_GhillieSuit"; RECON1 addWeapon "Laserdesignator"; RECON1 addMagazine "Laserbatteries"; RECON1 addvest "V_PlateCarrierSpec_rgr"; RECON1 addMagazine "20Rnd_762x51_Mag"; RECON1 addWeapon "srifle_EBR_F"; RECON1 addPrimaryWeaponItem "optic_Hamr"; RECON1 addPrimaryWeaponItem "muzzle_snds_B"; RECON1 addPrimaryWeaponItem "acc_pointer_IR"; RECON1 addItem "optic_Nightstalker"; RECON1 addMagazine "20Rnd_762x51_Mag"; RECON1 addMagazine "20Rnd_762x51_Mag"; RECON1 addMagazine "20Rnd_762x51_Mag"; RECON1 addMagazine "20Rnd_762x51_Mag"; RECON1 addmagazine "DemoCharge_Remote_Mag"; RECON1 addmagazine "DemoCharge_Remote_Mag"; RECON1 addmagazine "DemoCharge_Remote_Mag";

the only thing you need to do to make it work is add a init.sqf to your mission folder and edit with notepad++ add the following code line to your inti.sqf

waitUntil {time > 0};
execVM "Scripts\EtV.sqf";
waitUntil {!isNil "EtVInitialized"};
[player] call EtV_Actions;

place a folder named Scripts in your mission folder and put the EtV.sqf file provided by zooloo75 in that folder launch your mission and it should work on mission load I just tested it out. However bare in mind that it may depend on the vehicle you want to rig, some vehicles like AA armored units are not allowing you to rig it from behind only from the left right and front ...

(additional note)

the Scripts folder is not needed if you do not want to work that way "it is more my preferred way to set up my mission editing" because I just do not like to make a mess. You are able to place the EtV.sqf directly in your mission folder and remove the Scripts\ from the line execVM "Scripts\EtV.sqf"; in your init.sqf

to zooloo75

are you able to fix the following error?

_illogic = group server createUnit ["logic", Position _explosive, [], 0, "FORM"];

the error when using your script points to line 53 "code line above" in your provided EtV.sqf the error claims it is a bad variable ...

disregard the last, it seems that modsaholic does not contain the last updated script (download the one from drop box) error free ;)

best of regards

Edited by LiquitHQ

Share this post


Link to post
Share on other sites

Ack!

I was just about to start work on a similar script, when I noticed this one, already in existence.

Oh well, saves me some work :D

Share this post


Link to post
Share on other sites

It would be awesome if it was a mod instead of a script. anyone have it working recently?

Share this post


Link to post
Share on other sites

Great script!!!

One slight issue: attaching it the bottom of a boat is very tricky. The placement area is very small and it takes alot of time moving around to find it. Anyway of improving this?

Thanks :-)

Share this post


Link to post
Share on other sites

is there any way of making this run in MP or add it to multiple units in the game? so every unit can do it?

Share this post


Link to post
Share on other sites
is there any way of making this run in MP or add it to multiple units in the game? so every unit can do it?

it should automatically do it as long as the person is carrying either a satchel or explosive charge, I've used it in mp and it works flawlessly

Share this post


Link to post
Share on other sites

No it doesnt run on multiplayer server. Its runing on dedicated server but when you rent server it wont run there :-/

Share this post


Link to post
Share on other sites

Em,Is Explosive can be attached only to Enemy's veh?

Share this post


Link to post
Share on other sites
Em,Is Explosive can be attached only to Enemy's veh?

Negative, any vehicle placed on the map

Share this post


Link to post
Share on other sites
Negative, any vehicle placed on the map

Only at enemies car works for me in mp(car spawned by VVS,may trouble in it?)

Share this post


Link to post
Share on other sites

Hello anyone :).

I realize the original creator is probably long gone. But this script is a very elegant solution to a "bombing" task in my mission that does avoids requiring mods (such as ACE3). 

There's one snag though: I want to be able to attach an explosive to an Underwater Mine, aka Naval Mine (moored).  

When nosing around the "EtV.sqf" file of this script, I find a reference towards _nearVehs and _nearVehicle . See extract:

EtV_ChargeCheck =
{
    _charge = _this select 0;
    _unit = _this select 1;
    _hasIt = _charge in (magazines _unit);
    _nearVehs = nearestObjects [_unit,["Air","Ship","LandVehicle"],5];
    
    _return = (_hasIt && count _nearVehs > 0 && alive _unit);
    _return
};

I guessed that extending the array to include mines after "LandVehicle" would allow me to attach my explosive to any mines. If I understand the BI Wiki correctly, the naval mines belong to the "explosives" class. 

I added "explosives" to the _nearVehs and _nearVehicle arrays, but that unfortunately broke the script. 

Is anyone willing to puzzle with me how to extend this script?

Much thanks!

Share this post


Link to post
Share on other sites

Make a backup of the original file and replace these two functions:

EtV_ChargeCheck =
{
      _charge = _this select 0;
      _unit = _this select 1;
      _hasIt = _charge in (magazines _unit);
      _nearVehs = nearestObjects [_unit,["Air","Ship","LandVehicle"],5];
      _mines = _unit nearObjects ["MineBase", 5];
      _nearVehs append _mines;
	
      _return = (_hasIt && count _nearVehs > 0 && alive _unit);
      _return
};

EtV_AttachCharge =
{
      _array = _this select 3;
      _charge = _array select 0;
      _unit = _array select 1;
      private "_class";
	
      _unit removeMagazine _charge;
      _unit playMove "AinvPercMstpSnonWnonDnon_Putdown_AmovPercMstpSnonWnonDnon";
	
      switch _charge do
      {
          case "DemoCharge_Remote_Mag":
          {
              _class = "DemoCharge_Remote_Ammo";
          };
      };
	
      _nearVehs = nearestObjects [_unit,["Air","Ship","LandVehicle"],5];
      _mines = _unit nearObjects ["MineBase", 5];
      _nearVehs append _mines;
      _nearVehs = _nearVehs apply {[_x distance _unit, _x]};
      _nearVehs sort true;
      _sortedVehs = [];
      {_sortedVehs pushBack (_x select 1)}forEach _nearVehs;

      _nearVehicle = _sortedVehs select 0;
      //_nearVehicle = (nearestObjects [_unit,["Air","Ship","LandVehicle"],5]) select 0;
      _explosive = _class createVehicle [0,0,0];
      _explosive attachTo [_unit,[0,0,0],"leftHand"];
      _random0 = random 180;
      _random1 = random 180;
      [_explosive,_random0,_random1] call BIS_fnc_SetPitchBank;
      [_explosive,_nearVehicle,_unit,_random0,_random1] spawn
      {		
          _explosive = _this select 0;
          _nearVehicle = _this select 1;
          _unit = _this select 2;
          _random0 = _this select 3;
          _random1 = _this select 4;
		
          sleep 1.5;
          _explosive attachTo [_nearVehicle];
          [_explosive,_random0,_random1] call BIS_fnc_SetPitchBank;
          _unit setVariable ["charges",(_unit getVariable ["charges",[]]) + [_explosive]];
          [_explosive,_unit] spawn EtV_TimedCharge;
	};
};

 

Edited by RCA3
Took a look at the full script.
  • Like 2

Share this post


Link to post
Share on other sites

Yes.
Yes, that fixes it precisely.

Thank you so much for taking the time.

I'm just curious: why was it necessary to create a new array and append it, instead of just adding an extra entry to _nearVehs ? And how did you know of the "MineBase" class? It's not even explained in the BI Wiki!

Much impressed, sir.

  • Thanks 1

Share this post


Link to post
Share on other sites
5 hours ago, Melody_Mike said:

I'm just curious: why was it necessary to create a new array and append it, instead of just adding an extra entry to _nearVehs ? And how did you know of the "MineBase" class? It's not even explained in the BI Wiki!

 

nearestObjects wasn't returning mines, I tested it and found out nearObjects was. 🙂 After that append was necessary to give a whole result for _nearVehs.

"MineBase": I deployed a mine on the editor (searched for mines on objects), and then you right click on it and "Find in config..." or similar. Then you can read the inherited classes on the bottom of the screen.

Cheers.

  • Haha 1

Share this post


Link to post
Share on other sites
On 7/18/2013 at 9:01 PM, zooloo75 said:

I was thinking of making an addon/script package that "un-axes" a lot of "axed" features. It's disappointing that we saw and were promised a lot of wanted features only to have them removed or canceled.

Not sure if it ever existed in vanilla/was axed, but players being able to drag incapacitated players/ai would be be very welcome

Share this post


Link to post
Share on other sites
11 hours ago, RCA3 said:

 

nearestObjects wasn't returning mines, I tested it and found out nearObjects was. 🙂 After that append was necessary to give a whole result for _nearVehs.

"MineBase": I deployed a mine on the editor (searched for mines on objects), and then you right click on it and "Find in config..." or similar. Then you can read the inherited classes on the bottom of the screen.

Cheers.

 

Hello, thanks for the fix.  I see some debate on if this is mp or not.  After looking through the code will it run in mp?

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

×