Search the Community
Showing results for tags 'dynamic loadout'.
Found 5 results
-
Respawn Expressions Issue(s)
EveryEmpireFalls posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello! First | The basic premise of what I am attempting to do is two-fold. A) respawn existing vehicles (of different types - i.e. some jets, some helicopters, some ground vehicles), with the same custom pylons - for the jets/helis - set by the pylon/dynamic loadout editor in 3den. This part works fine thus far (see below). And B) apply unlimited ammo on a delay (i.e. it takes 45 seconds for the ammo to restore) to both the original vehicle and its respawned clone. The main trouble I am having is getting unlimited ammo to work with the new, respawned vehicles. Second | A code dump and summary of what is where: The code below is my unlimited ammo expression in the existing F/A-181 (and other vehicles). Ideally, the missiles & bombs refresh on a delay, hence the {sleep 45} segment. This part works perfectly for my purposes. this addEventHandler ["Fired",{[_this select 0,getNumber (configFile/"CfgAmmo"/(_this select 4)/"explosive")] spawn {if (_this select 1==1) then {sleep 45};_this select 0 setVehicleAmmo 1}}]; This code is present in the expression of a Game Logic and synced to all relevant air vehicles. It works perfectly for my purposes; no errors and functions as intended. [this] call { if (!isServer) exitWith {}; params ["_thisObject"]; _vehs = synchronizedObjects _thisObject; _initScript = { params ["_vehicle", ["_pylons", "none"]]; if (typeName _pylons == typeName []) then { private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply { getArray (_x >> "turret") }; { _vehicle removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _vehicle; { _vehicle setPylonLoadout [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons; }; }; { [_x] call _initScript; } forEach _vehs; [_vehs, _initScript] spawn { params ["_vehs", "_initScript"]; sleep 1; _respawnlist = []; { _respawnlist = _respawnlist + [[_x, position _x, [vectorDir _x, vectorUp _x], getPylonMagazines _x]] } forEach _vehs; while { true } do { sleep 1; { _veh = _x # 0; _respawnpos = _x # 1; _playerdistance = 200; { if (_veh distance _x < _playerdistance) then { _playerdistance = _veh distance _x }; } forEach allPlayers; if (!alive _veh || (_veh distance _respawnpos > 20 && _playerdistance > 20)) then { _vehType = typeOf _veh; [_veh, _respawnlist] spawn { params ["_veh", "_respawnlist"]; deleteVehicleCrew _veh; _veh lock true; _inSpawn = false; waitUntil { sleep 0.5; _inSpawn = false; { _respawnpos = _x # 1; if ((_veh distance _respawnpos) < 30) exitWith { _inSpawn = true; }; } forEach _respawnlist; _inSpawn || ((speed _veh == 0) && (isTouchingGround _veh)); }; if (!_inSpawn) then { sleep 30 }; deleteVehicle _veh; }; sleep 10; _newveh = _vehType createVehicle _respawnpos; _newveh setPos _respawnpos; _newveh setVectorDirAndUp (_x # 2);[_newveh, _x # 3] call _initScript; _respawnlist set [_forEachIndex, [_newveh, _respawnpos, _x # 2, _x # 3]]; }; } forEach _respawnlist; }; }; }; This is the current code present in the "System Specific - Vehicle Respawn" Module expression (not its Init). It does not work at all. params ["_newVeh", "_oldVeh"]; [_newVeh addEventHandler ["Fired", { [_newVeh select 0, getNumber (configFile/"CfgAmmo"/(_newVeh select 4)/"explosive")] spawn { if (_newVeh select 1 >= 0) then { sleep 5 }; _newVeh select 0 setVehicleAmmo 1 } }]] call BIS_fnc_initVehicle; The Vehicle Respawn Module: It throws the no errors upon mission launch and no errors upon vehicle respawn. My friends and I suspect it is not even executing properly. Here are a few screencaps of the 3den editor of the scene in question if it helps you: // Overview of the whole airfield. The Vehicle Respawn Module on the Right by the center of the airfiled is exlusively linked to ground vehicles. It respawns the vehicles fine but without the unlimited ammo. // The test F/A-181. // The Game Logic. // My two primary test subjects (Left is experimental; Right is the control). As you can see, the left F/A-181 is the primary test subject for the Vehicle Respawn Module, as it is synced to both the Vehicle Respawn and the Game Logic. The right F/A-181 (and all other air vehicles) is synced only to the Game Logic. Both jets initially spawn with the proper pylons/dynamic loadouts and unlimited ammo, as expected vis-a-vis the 3den editor settings. Both jets respawn with the proper pylons/dynamic loadouts. Neither jet respawns with unlimited ammo, currently. I feel close to solving this, but I am blind to what I am missing/adding unnecessarily. I have tried numerous other variations with even less luck. I am sure there is some redundancy between the Vehicle Respawn Module and the game logic, and I would appreciate any simplifications there. However, that is a secondary concern. Thanks for reading this far! Hopefully, you can help me and anyone else who wants to do this. -
Description : Small ingame loadout cheanger for planes and helicopters, save and load custom presets In game '?' is only in english, if some one know english and russian perfectly any help will be accepted How to import it in your map/scenario? Just add following text in files, and obviously files downloaded -description.ext class CfgFunctions { #include "ZLoad\functions.hpp" }; #include "Zload\defines.hpp" #include "Zload\dialogLoadout.hpp" #include "Zload\dialogHelp.hpp" #include "Zload\dialogSave.hpp" -initPlayerLocal.sqf [player,"MarkerNameFromEDITOR",20] spawn zlo_fnc_CreateZone;//[PLAYER,MARKERNAME,RADIUS] -onPlayerRespawn.sqf [player,"MarkerNameFromEDITOR",20] spawn zlo_fnc_CreateZone;//[PLAYER,MARKERNAME,RADIUS] -stringtable.xml just add all from file in mission to your stringable.xml(if exists, else just put in your mission folder) -in editor add marker to use in scripts, it will be the marker near the menu will apear (ps:sorry for my bad english) Exemple : _Radius_From_center = 20; [_OBJ_TO_ADD_ACTION,"Zone_Center",_Radius_From_center] spawn zlo_fnc_CreateZone; #v1.0 First Release Download <-> Steam Workshop
- 2 replies
-
- 7
-
- loadout
- dynamic loadout
-
(and 4 more)
Tagged with:
-
Use scripting to equip aircraft with a certain weapon?
Thorimus posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, I am a complete noob to scripting with virtually no experience in coding, so guidance would be much appreciated. Is there a way to use a script to equip an aircraft with a weapon that is not selectable in the dynamic loadouts menu? For example, equipping a BLUFOR A-164 Wipeout with an OPFOR Sharur AT missile? EDIT: For anyone else who finds this, I found sucess in this method: In a vehicles init field, enter: this setPylonLoadOut [PYLON NUMBER, "NAME OF MISSILE", true]; Example: this setPylonLoadOut [4, "ace_maverick_L_PylonRack_3Rnd", true];- 2 replies
-
- script
- dynamic loadout
-
(and 2 more)
Tagged with:
-
as form topic, I've tried to create a mission for testing with an empty wipeout (named wipe) and a single trigger with this code wipe setPylonLoadOut [10, "PylonMissile_1Rnd_Missile_AA_04_F"] but it doesn't work. I have to remove the weapons first or use other commands? I've also tried with different CfgMagazines, but nothing. Thanks!
-
I am trying to create my own in-game Dynamic Loadout script, and I have some problems. Are they possible? Get Memory Point of a pylon either using index or pylon name. Get magazine of a pylon from pylon name. Get index from pylon name. Get pylon name from index. The feature is something... complicated and hard to use. Thank you in advice. EDIT: Use weapons properly after use animateBay.