Home   Help Search Login Register  

Author Topic: [Script] Replacing current weapon projectile with _ammoType = Bo_GBU12_LGB  (Read 2413 times)

0 Members and 1 Guest are viewing this topic.

Offline hazydave420

  • Members
  • *
First off I have to say that I'm loving this ArmA community. I've been a fan of the series since Operation Flashpoint but have only recently subscribed to Broadband Internet Service in my country.

I have been working on a custom mission script to make your current weapon shoot _ammoType = Bo_GBU12_LGB.

Not too much luck, I've decided to dive into the scripting wiki and do some research but let me tell you IT IS CONSUMING!  :no:

If anyone could help me out I'd be really thankfull

hopefully I can make this script stop when I change weapons or make a way to change back to regular ammo

EDIT: I've come to a realization that I may need to spawn a GBU right when the bullet impacts instead to simulate this "bullet bomb" effect i desire.
« Last Edit: 15 Jun 2012, 01:24:11 by hazydave420 »

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Hmm. I've seen this "bomb shooting" before: it was on a public server when some cheater removed our base with his assault rifle. :dry:

Whatever.

This could be done from a units Fired event handler:
* spawn a bomb where the projectile is (createVehicle, getPos)
* point the bomb where the projectile points to (vectorDir, vectorUp, setVectorDirAndUp)
* set the speed of the bomb (setVelocity)
* delete the projectile (deleteVehicle)

Note that you'll lose the original ballistics this way.


Edit: :welcome:
« Last Edit: 15 Jun 2012, 21:11:18 by Worldeater »
try { return true; } finally { return false; }

Offline CameronMcDonald

  • Members
  • *
Can't help you, but I had to laugh as this reminds me of the old "Ultra M16" and "Ultra M60" from one of HYK's old OFP weapon packs. :)

Offline Coyle[13thSFG]

  • Members
  • *
How would you trigger an event at the point of impact?  Like say shoot an M24 at a tank and have a Bo_GBU12_LGB explode at point of impact.  The idea is to preserve the ballistics of the m24.  Would make for a great DM.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
In the firing unit's init:
Code: [Select]
this addEventHandler ["Fired",{(nearestObject [_this select 0,_this select 4]) execVM "boom.sqf"}]
boom.sqf:
Code: [Select]
private["_pos"];

while {alive _this} do {
_pos = position _this;
sleep 0.01;
};

"Bo_GBU12_LGB" createVehicleLocal _pos;
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.