-
Content Count
719 -
Joined
-
Last visited
-
Medals
Everything posted by opusfmspol
-
rRemoveaction in Framework
opusfmspol replied to CreativeProduct's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
An RE call won't return an action ID, it returns the results of validation checks, true when all is good, false or nil when it fails. rAddAction stores locally the action ID as a variable in the target object. You have to pass in a variable name or it doesn't get stored. To have the variable name stored, the full addAction parameters have to also be passed in (default values can be used). The rAddAction script receives parameters: (required:) ----------- caller = select 0 // not used target = select 1 // object receiving the action title = select 2 // title of the action that appears script = select 3 // script that executes (optional:) ----------- arguments = select 4 // arguments to pass into the script, default: [] priority = select 5 // priority in action list, default: 100 (rAddAction makes it very high priority) showWindow = select 6 // show action text mid-screen, default: true hideOnUse = select 7 // hide action when used, default: true shortcut = select 8 // action shortcut key, default: "" condition = select 9 // (stringed) condition for action to appear, default: "true" variableName = select 10 // variable name for storing the action ID (string, you decide the variable name) Not passing in a variable name results in the action getting added without the ID being stored. That would be for actions that won't be removed. For actions that will get removed, pass in all parameters + variable name and the action ID is stored locally in the object. rRemoveAction uses the variable name to identify the action and remove it. The object keeps the variable with the action ID, rRemoveAction won't nil it away. If an rAddAction with the same variable name is added again, the variable gets updated with the new ID number. Untested, but might see if this works, "addedGearAction" is the stored variable name: _nic = [nil, _unit, rAddAction, "Gear", "client\gear.sqf", [], 0, false, true, "", "true", "addedGearAction"] call RE; _nic = [nil, _unit, rRemoveAction, "addedGearAction"] call RE;- 3 replies
-
- rremoveaction
- removeaction
-
(and 1 more)
Tagged with:
-
How do I activate trigger only if ammo box load in vehicles ?
opusfmspol replied to sasan007's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It fails because ammo_1 isn't a unit (crewman). wiki IN command What is the object state of the ammo box when loaded? Use that as a condition for checking. For example, if the box object gets deleted when loaded: loaded = (isNull ammo_1). -
Buy units without warfare factory buildings
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It would likely be due to the factory dependencies in the various functions involved with purchasing units. You would have to go through a number of function scripts to remove factory dependencies and assign a different spawn point since there won't be a factory to getPos from. GUI_buyUnitsMenu.sqf is the factory GUI script. It has factory dependencies, and it's a rather complicated script. You would first want to review it and decide whether it's a task you want to take on. It involves handling the displays and dialogs.- 1 reply
-
- 1
-
A2/A2:OA beta CorePatch 01.03.2016
opusfmspol replied to Dwarden's topic in ARMA 2 & OA - BETA PATCH TESTING
Following up with an observation; Where SILVIE's "spawnVehicle.sqf" (beta) has this line, which causes the .rpt error in A2: _car setVectorUp (surfaceNormal _tempPos); This line works in both A2 and OA in an editor mission, and clears the error from .rpt: if (count supportInfo "u:surfaceNormal*" > 0) then {_car setVectorUp (Call Compile Format ["surfaceNormal %1",_tempPos])}; When I tried simple "if then" with setVectorUp surfaceNormal, A2 encountered the OA command, but it seems stringing the OA command in a format statement can keep A2 from encountering it. -
It could probably be handled by copying, editing and running as custom the onPlayerConnected and onPlayerDisconnected scripts that Warfare uses. The core scripts don't account for player commander, or store the values set for towns by a player commander. Essentially when a host player disconnects, commander switches back to AI. And when the mission is continued, it picks up with an AI commander. But some saved settings still allow the player who was commander to pull up the command bar, even though they're no longer the commander. onPlayerDisconnected could be edited to detect whether disconnecting player is host and commander. If so, store the commander and town settings. onPlayer connected could be edited to detect whether connecting player is host, and if so, restore saved commander and town settings if they exist and the host unit being played was the commander. If host is playing a different unit, wipe those settings because AI commander has taken over. But I haven't tried, so right now its just a theory whether that would work.
-
Addaction script help
opusfmspol replied to battleship's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This page on the wiki explains the addAction command and its optional arguments that can be used. First two arguments are required (title, script name), the others are optional. Variables passed into the addaction come third in the array. act1 = _this addAction ["Title", "script.sqf", [grpOne]]; Or a single variable can be passed without an array. act1 = _this addAction ["Title", "script.sqf", grpOne]; But note that within the action script that is being run, the passed param(s) would be _this select 3. In an action script: _object_with_addAction = _this select 0; _calling_Player = _this select 1; _action_ID_Number = _this select 2; _params_passed_in = _this select 3; For a single variable it would be "_grp = _this select 3;". To select the first argument from a passed array, it would be "_grp = (_this select 3) select 0;". Or by defining, it would be " _params = _this select 3; _grp = _params select 0;". And if the action is only supposed to appear when a certain condition is being met, condition comes eighth in the array. The defaults can be used to make up the other arguments. But the condition itself has to be made a string. act1 = _this addAction ["Title", "script.sqf", [grpOne], 1.5, true, true, "", "({alive _x} count (units grpOne)) > 0"]; -
Respawn warfare resistance opposition patrol teams
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Town patrols are only managed for the owning side. What you want done would have to be a custom server update script. You would build it from scratch. 1) Build a starter script, something not very complicated. It will become the compiled function. It's an update function so give it some starter stuff, and finish with a "while {!gameOver} do {looped code}" which has a sleep delay and uses the starter stuff. 2) If you're running a custom server init script copied from Warfare, you can add it into the mix there to compile and spawn it; or you could add something like this to a WF custom common init: if (isServer) then { // use spawn so mission won't hang during loading due to the 'waitUntil'. _niv = [] spawn { PCC_ResistanceTownSpawnFunc = Compile PreprocessFileLineNumbers ("Server\Functions\Server_ResistanceTownSpawns.sqf"); waitUntil {gameInitialized}; [] Spawn PCC_ResistanceTownSpawnFunc; }; }; If adding to a WF server script, only the lines 6 (compile preprocess) and 8 (spawn) would get added into the mix. Compile it with the other functions and spawn it after teams and towns get initialized. 3) Test run and edit as needed to make sure the simple compiled function is running properly. 4) Then edit the function as much as you want until it finally does what you want it to do. Be sure cleanup of the spawned units is included when killed or no players are around. -
how to create a custom warfare mission please
opusfmspol replied to Ke Bab Alp's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Darren Brant did some good tutorials years ago, start here: http://sandbox.darrenbrant.com/arma_ii/adventures-in-editing-the-arma-ii-warfare-mission -
How to exclude certain barracks units
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Crew and pilot have to be call-compile-formatted as well. They use side letters rather than side text. Not tested, but this should make a copy of the factory units list, remove the pilot and crew from the copied list, and do random selection from it. _units = +(Call Compile Format ["%1%2Units",_sideText,_factoryName]); _pilot = Call Compile Format ["%1PILOT",_side Call GetSideLetter]; _crew = Call Compile Format ["%1CREW",_side Call GetSideLetter]; _units = _units - [_pilot,_crew]; _unit = _units Call BIS_WF_GetRandomElement; If no good, try call-compile-format on crew and pilot.- 1 reply
-
- 1
-
How to remove duplicate weapon detected error
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
See if this helps: In Warfare, when an AI leader gets killed Common_ReplaceTeamMember.sqf runs and a team member takes on the leader role. where it has: RemoveAllWeapons _newUnit; {_newUnit AddMagazine _x} ForEach Magazines _oldUnit; {_newUnit AddWeapon _x} ForEach Weapons _oldUnit; Change it to: RemoveAllWeapons _newUnit; // Remove items so they don't duplicate. { if ((_x In (Items _newUnit))) then {_newUnit removeWeapon _x}; } ForEach ["ItemGPS","ItemMap","ItemCompass","ItemWatch","ItemRadio"]; {_newUnit AddMagazine _x} ForEach Magazines _oldUnit; {_newUnit AddWeapon _x} ForEach Weapons _oldUnit; It should cut down on the number of times the messages occur. -
Prevent driver and gunner dismount in warfare
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The Server\ AI\ AI_Transport.sqf handles units disembarking. But I'm at a loss to understand how this would be the cause, Server_BuyUnit.sqf shows the script only runs on transport vehicles (those having cargo space), and the M1128 MGS isn't a transport. Server_AITeamMove.sqf and Server_AITeamMoveByType.sqf deal with AI teams moving. Those two scripts get called with most mission updates. I don't have an answer, so I'm just pointing in directions. -
AI commander call warfare artillery at waypoints
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I believe static defenses resupplying have to do with distance to a vehicle service point. Server's BIS_WF_UpdateVehicleServicePoint loop should handle it. -
AI respawning AH6J over and over
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Adding Team Air to those two blocks should be no problem. There's no conflict I know of. I have Leader assigned as pilot in attack helos, and cargo in transport helos. Were any changes made that specifically targeted any AH6J_EP1? Were any changes done in Server AI Team Team_ReinforceAction.sqf or the long update that calls for reinforce at the end of Team_Update.sqf? Team update is what loops the action. -
AI commander call warfare artillery at waypoints
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The data array gets defined and returned in the last line of the script: if !(isnil "_patrolLocation") then {[_completed,_timeNextMove,_patrolPoints,_patrolLocation]} else {[_completed,_timeNextMove]} The second array [_completed,_timeNextMove] gets returned when the mission is terminated or completed. While the mission is in progress there is a patrol location, so the first array [_completed,_timeNextMove,_patrolPoints,_patrolLocation] gets returned. You would want to return it in the first array, it will then get passed into the script during the next cycle: if !(isnil "_patrolLocation") then {[_completed,_timeNextMove,_patrolPoints,_patrolLocation,_artySuppression]} else {[_completed,_timeNextMove]} When the script starts running, define the value in the block that defines variables based upon what the _data array contains: //If this is not the first cycle then data will be passed. if (Count _data > 0) then { _timeNextMove = _data Select 1; _patrolPoints = _data Select 2; _patrolLocation = _data Select 3; _artySuppression = _data Select 4; // <--- added } //If no data then this is the first cycle. else { _team SetVariable ["missionLocation",_location]; _timeNextMove = time - 1; _artySuppression = 0; // <--- added }; -
Set flying on spawn for air units in warfare
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Not tested, but try: if (!(_unit Call BIS_WF_IsSoldier)) then { Private["_commander","_crewName","_distance","_driver","_factoryPosition","_gunner","_leader","_pilotName","_soldierName","_templateType","_vehicle"]; _vehicle = objNull; if (_unit in ["AH1Z","AH64D"]) then { _position = [(_position select 0),(_position select 1),150]; _vehicle createVehicle [_unit, _position, [], 0, "FLY"]; } else {_vehicle = _unit CreateVehicle _position;}; [_vehicle,_side] Call BIS_WF_InitUnit; _team AddVehicle _vehicle; The script adds the crew further down. -
AI respawning AH6J over and over
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If it was customized, might be something looping in the Server_BuyUnits.sqf. The config defines various attributes of the units when purchased, but the buy units script is spawning them. -
Count group size from BIS_fnc_spawnVehicle units
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It will return whichever is defined as _team in the script, I would think it would be the Warfare AI team. But I don't know what custom you've added. West is a side, it can't be used as a variable identifying a team. Something like West1 or grpWest can be used to identify a team. -
Filling all vehicle turrets in warfare
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
KK's function is posted here: https://community.bistudio.com/wiki/moveInTurret This is what I've been using in my SOM-Warfare mission, hope it helps: -
Count group size from BIS_fnc_spawnVehicle units
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Second condition should be: (count units group _team < 3) -
Error in expression <};>
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The original error Error in expression <};> probably was reporting on the semicolon at the end of the if--then. SQS uses keyboard returns to end a line. Semicolon is a comment in SQS and goes at the beginning of a line. Also _positionSlot and _position might be an issue. There's a server base setup script (can't recall the name) that designates slots. There are only so many slots for structures and defenses. It can be brought into the mission folder to add more and reconfigure positions, you would have to calculate different distances from base center for each structure and defense to be set up. Somewhere in its routine the server Init identifies the setup script. -
trigger Creating an alternate trigger event (good/bad Intel)
opusfmspol replied to gunut82's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
_rnd = Random 1; if (_rnd < .5) then { // ambush } else { // good info }; In a script you would use ( _rnd ), in an editor trigger you would use ( rnd ) instead. Editor triggers don't much use local variables. -
AI respawning AH6J over and over
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If this is in Teams, make it a single heli. Use Squads to team up two helis, using "HeliLight" in _u array. Can't check WF scripts right now, other comp's in the shop (motherboard gave out ). Should be back soon though. -
AI commander call warfare artillery at waypoints
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
An object is being sent as the destination rather than a position array. Try: if (typeName _destination != "ARRAY") then {_destination = getPos _destination}; -
A2/A2:OA beta CorePatch 01.03.2016
opusfmspol replied to Dwarden's topic in ARMA 2 & OA - BETA PATCH TESTING
The airport object in the mission needs to have its init field corrected to go back to Warfare's Server_UpdateAirport script. It might not be the only mission, there might be others with capturable airports. Where it has: ExecVM "CorePatch\CorePatch_WF\Scripts\Server\Server_UpdateAirport.sqf"; it should now be: ExecVM "ca\Warfare2\Scripts\Server\Server_UpdateAirport.sqf"; -
Config_Teams.sqf spams errors
opusfmspol replied to pcc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
EastUnits, WestUnits and ResistanceUnits is an error that comes from Common_GetUnitData.sqf. It results when no structure type can be identified for a unit (i.e., what should be returned as "EastBarracksUnits" returns as "EastUnits" instead, no structure identified). It's caused by a few different factors. One is where certain units passed by the Team & Squad configs are not defined in the factory configs. The error occurs each time they try to get data on an undefined unit. Because the unit is not listed in a structure config, no structure type can be returned. Examples from non-beta Warfare: Example 1: - ZSU_CDF is not defined in the CDF heavy config. - ZSU_CDF is listed in CDF Team "MechanizedHeavyAA". - "MechanizedHeavyAA" is twice listed in CDF Squad "LargeAALightTankSquad". Result: 3 WestUnits errors Example 2: - RU_Soldier_Sniper is undefined in RU barracks config. - RU_Soldier_Sniper is twice listed in RU team "Sniper". Result: 2 EastUnits errors Example 3: - There is no such unit as "Ins_Soldier". - Ins_Soldier is listed in INS team "Sniper". Result: 1 EastUnits error Correcting the missing and misidentified units in custom configs will clear continuing errors in a mission, but the few core errors at startup will persist since core will run before custom. Another cause is that the factory config check is case sensitive. If a Unit is not listed in the Team or Squad configs with the exact same case text as in the factory config, the check fails. Those errors are cleared by correcting the case text wherever the unit is listed in the Team or Squad configs. The last cause should be non-beta only. if winged aircraft units are added to any of the Team or Squad configs, GetUnitData checked the Barracks, Light, Heavy and Aircraft factory configs, but not the Winged Aircraft (airport) config. Adding the check of "WingedAircraft" to the list cleared the error. It was fixed in beta.- 1 reply
-
- 1