OFPEC Forum
Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: hazydave420 on 15 Jun 2012, 00:59:32
-
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.
-
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 (http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#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:
-
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. :)
-
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.
-
In the firing unit's init:
this addEventHandler ["Fired",{(nearestObject [_this select 0,_this select 4]) execVM "boom.sqf"}]
boom.sqf:
private["_pos"];
while {alive _this} do {
_pos = position _this;
sleep 0.01;
};
"Bo_GBU12_LGB" createVehicleLocal _pos;