Big_Daddy
-
Content Count
208 -
Joined
-
Last visited
-
Medals
Posts posted by Big_Daddy
-
-
Well I've done more reading, more searching, took apart the UAV module built into the game. Found out a few things...
Here's what how I add the UAV to a map.
In editor, drag the UAV module onto the map
Name it BIS_uav_1(or whatever, and change accordingly)
in the init of the UAV module:BIS_uav_1 setvariable ["name","RQ-1 Predator"];BIS_uav_1 setvariable ["rules",[west]]
add any unmanned vehicle/buildings and sync them to the UAV module, don't do any UAV's
Add an action to each vehicle you want to be able to "Launch" a UAV from, Doesn't have to be one that you've synced. or even one that you want to control the UAV from
nul = this addAction ["Launch UAV", "uav.sqf",[xvec1,100,BIS_uav_1,"xvec2,xvec1",MQ9PredatorB,west],0,false]
Take note of the use of quotes. string/object/side through me for a loop.
xvec1 - The name of the Launch vehicle
100 - height you want the UAV to start from above launch vehicle
BIS_uav_1 - name of the UAV module
"xvec1,xvec2" - list of objects you want UAV to be synced to notice the quotes/commas
MQ9PredatorB - Name of the UAV you want to use. Other is Pchela1T but init would have to be changed to remove added weapons. :)
west - side you want the UAV to spawn on.
uav.sqf:
/* ========================================================= Default values of all settings are: nul = this addAction ["Launch UAV", "uav.sqf",[xvec1,100,BIS_uav_1,"xvec2,xvec1",MQ9PredatorB,west],0,false] 1: spawn location 2: spawn height 3: Name of UAV Module added to map - BIS_UAV 4: units to be syncronized with: "xvec2, xvec1, unit, etc" 5: Version of UAV - MQ9PredatorB 6: side - east/west. Group should work, but UAV crashes after launch. ========================================================= */ private ["_vec_array","_myarray"]; _myarray = _this select 3; _spawloc = _myarray select 0; _spawhei = if (count _myarray > 1) then {_myarray select 1} else {100}; uavMod = if (count _myarray > 2) then {_myarray select 2} else {BIS_UAV_1}; _units = if (count _myarray > 3) then {_myarray select 3} else {xvec1, xvec2}; _uavType = if (count _myarray > 4) then {_myarray select 4} else {MQ9PredatorB}; _grp = if (count _myarray > 5) then {_myarray select 5} else {"west"}; _vec_array = [[getPos _spawloc select 0, getPos _spawloc select 1, (getPos _spawloc select 2) +_spawhei], random 360, _uavType, _grp] call BIS_fnc_spawnVehicle; MyUAV = _vec_array select 0; MyUAV setVehicleInit "this addWeapon ""SidewinderLaucher""; this addMagazine ""4Rnd_Sidewinder_AV8B"";this disableAI ""AUTOTARGET"" ; this disableAI ""TARGET"" ; this setCombatMode ""BLUE"";this setBehaviour ""careless"";uavMod synchronizeObjectsAdd [xvec2, xvec1, MyUAV]"; publicVariable "MyUAV"; processInitCommands; //[assignedGunner MyUAV] join player; //still seems to crash after 2 launches.. //hint format ["%1",assignedGunner _myuav]; hint "UAV has been Launched"; exitNow, some guru's please take a look.. I'm feeling a little lonely here. any suggestions on cleaning up the script, help in MP play? anything.. thanks.
-
Cool, thanks.. Also, if you turn it on, off, on off, it seems that the first missile work. I'll test some more.
-
I'm noticing that the first missile/bomb are always going the wrong direction.
Also, it would be nice to be able to break out of the control. If you've messed up on a bombing run, you have to wait until you can aim the bomb at the ground.
But great work so far. very impressive.
-
Ok, it seems the spawn only twice bug may have been just local. I moved testing to the server, and bingo.. works every time.. Ok.. now, Can somebody help me get the UAV to stop playing dive bomber? Here's my updated code..
_grp = createGroup west; _vec_array = [[getPos xvec1 select 0, getPos xvec1 select 1, (getPos xvec1 select 2) +100], random 360, "MQ9PredatorB", _grp] call BIS_fnc_spawnVehicle; BIS_UAV synchronizeObjectsAdd [xvec2, xvec1, (_vec_array select 0)]; _grp disableAI "AUTOTARGET"; _grp disableAI "TARGET" ; _grp setCombatMode "BLUE"; _grp setBehaviour "careless"; //_vec_array = [[getPos _spacloc select 0, getPos _spawloc select 1, (getPos _spawloc select 2) + _spawhei], random 360, _uavType, _grp] call BIS_fnc_spawnVehicle; //_uavMod synchronizeObjectsAdd [_units,(_vec_array select 0)]; hint "UAV has been Launched"; exit
I've tried setting the behaviour of the vehicle, the group, etc.. nothing works. With BIS_fnc_spawnVehicle is there a way to set the vehicle's init? I've tried setvehicleinit, but when I do that, the synchronizeObjectsAdd does not work.
-
Yes, yes, i've searched, and found many wonderful posts from the likes of Xeno, cobra, etc.. but I've found something that's throwing me for a loop.
Background. I'm trying to add UAV to Xeno's Domination map (wonderful work btw) And I'm working around the fact that when you die, or when the UAV dies that's it, no more UAV fun. Now, I've been able to do this, and it works great. Twice. The third time I try to respawn the UAV it doesn't have a crew. It just crashes into the ground.
Here's the code:
Addaction on init of Mobile Spawn 1
nul = this addAction ["Launch UAV", "uav.sqf",["xvec1",100,"BIS_UAV","xvec2,xvec1","MQ9PredatorB","west"],0,false]
The arguments I haven't quite got working yet (that will be the next question :))
uav.sqf:
/* ========================================================= 1: spawn location 2: spawn height 3: Name of UAV Module - BIS_UAV 4: units to be syncronized with Names, xvec2, xvec1, (_vec_array select 0) 5: Version of UAV - MQ9PredatorB 6: side/group _myarray = _this select 3; _spawloc = _myarray select 0; _spawhei = if (count _myarray > 1) then {_myarray select 1} else {100}; _uavMod = if (count _myarray > 2) then {_myarray select 2} else "BIS_UAV"; _units = if (count _myarray > 3) then {_myarray select 3} else "xvec1, xvec2"; _uavType = if (count _myarray > 4) then {_myarray select 4} else "MQ9PredatorB"; _grp = if (count _myarray > 5) then {_myarray select 5} else "west"; ========================================================= */ _vec_array = [[getPos xvec1 select 0, getPos xvec1 select 1, (getPos xvec1 select 2) +100], random 360, "MQ9PredatorB", west] call BIS_fnc_spawnVehicle; BIS_UAV synchronizeObjectsAdd [xvec2, xvec1, (_vec_array select 0)]; _vec_array disableAI "AUTOTARGET"; _vec_array disableAI "TARGET" ; _vec_array setCombatMode "BLUE"; _vec_array setBehaviour "careless"; UAV = _vec_array select 0; hint format ["%1", _vec_array]; //_vec_array = [[getPos _spacloc select 0, getPos _spawloc select 1, (getPos _spawloc select 2) + _spawhei], random 360, _uavType, _grp] call BIS_fnc_spawnVehicle; //_uavMod synchronizeObjectsAdd [_units,(_vec_array select 0)]; hint "UAV has been Launched"; exitNow, again, this works flawlessly twice. the third time, it just crashes into the ground. (but you CAN watch it crash from the UAV terminal) Also, the
_vec_array disableAI "AUTOTARGET";
_vec_array disableAI "TARGET" ;
_vec_array setCombatMode "BLUE";
_vec_array setBehaviour "careless";
isn't working. maybe I need to add
private ["_vec_array"];
Thanks in advance...
-
Yes, 1.5.. I even re-downloaded it thinking there was already a bug fix..
:)
---------- Post added at 12:02 PM ---------- Previous post was at 10:58 AM ----------
Ok.. I think I got it figured out.. seems it WAS all me.. :)
too many quotes and semicolons.. here's the init that works for me..
this removeweapon "MaverickLauncher"; this removeWeapon "5Rnd_Maverick_A10"; this addMagazine "6Rnd_GBU12_AV8B"; this addWeapon "BombLauncher"; this removeweapon "BombLauncherA10"; this removeMagazine "4Rnd_GBU12"; this addweapon "HellfireLauncher"; this addMagazine "8Rnd_Hellfire"; this removeweapon "FFARLauncher_14"; this addWeapon "FFARLauncher"; this addMagazine "38Rnd_FFAR"; veh = [this, 15, 10, 5, TRUE, FALSE, "this removeweapon ""MaverickLauncher""; this removeWeapon ""5Rnd_Maverick_A10""; this addMagazine ""6Rnd_GBU12_AV8B""; this addWeapon ""BombLauncher""; this removeweapon ""BombLauncherA10""; this removeMagazine ""4Rnd_GBU12""; this addweapon ""HellfireLauncher""; this addMagazine ""8Rnd_Hellfire""; this removeweapon ""FFARLauncher_14""; this addWeapon ""FFARLauncher""; this addMagazine ""38Rnd_FFAR""" ] execVM "vehicle.sqf"
You have to add the weapons and ammo in both places..
Also, you have to make sure to remove the final semicolon.
-
Great script..
I'm running a server that I'm modifying the layout on the A10's.
The script works great, but when the vehicle respawns, it's loadout is default.
I've tried having the init before the call to your script, and inside the call to your script. ie:(straight from mission.sqf
INIT="veh = [this, 30, 120, 0, FALSE, FALSE, ""this removeweapon ""FFARLauncher_14""; this removeweapon ""BombLauncherA10""; this removeMagazine ""4Rnd_GBU12"";this removeweapon ""MaverickLauncher""; this removeMagazine ""5Rnd_Maverick_A10""; this addWeapon ""BombLauncher""; this addMagazine ""6Rnd_GBU12_AV8B""; this addweapon ""HellfireLauncher""; this addMagazine ""8Rnd_Hellfire""; this addWeapon ""FFARLauncher""; this addMagazine ""38Rnd_FFAR""] execVM ""vehicle.sqf"""
BTW, I tried this as well:
veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf"
The vehicle would respawn, but still be at full health.
What am I missing?
Thanks for your help.
Restarting A Module
in ARMA 2 & OA : MISSIONS - Editing & Scripting
Posted
try this instead:
I use it in for a UAV mod.. works great.