Jump to content

Search the Community

Showing results for tags 'scripting'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • BOHEMIA INTERACTIVE
    • BOHEMIA INTERACTIVE - NEWS
    • BOHEMIA INTERACTIVE - JOBS
    • BOHEMIA INTERACTIVE - GENERAL
  • FEATURED GAMES
    • Arma Reforger
    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
  • MOBILE GAMES
    • ARMA MOBILE OPS
    • MINIDAYZ
    • ARMA TACTICS
    • ARMA 2 FIRING RANGE
  • BI MILITARY GAMES FORUMS
  • BOHEMIA INCUBATOR
    • PROJECT LUCIE
  • OTHER BOHEMIA GAMES
    • ARGO
    • TAKE ON MARS
    • TAKE ON HELICOPTERS
    • CARRIER COMMAND: GAEA MISSION
    • ARMA: ARMED ASSAULT / COMBAT OPERATIONS
    • ARMA: COLD WAR ASSAULT / OPERATION FLASHPOINT
    • IRON FRONT: LIBERATION 1944
    • BACK CATALOGUE
  • OFFTOPIC
    • OFFTOPIC
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics
  • Exilemod (Unofficial)'s General Discussion
  • Exilemod (Unofficial)'s Scripts
  • Exilemod (Unofficial)'s Addons
  • Exilemod (Unofficial)'s Problems & Bugs
  • Exilemod (Unofficial)'s Exilemod Tweaks
  • Exilemod (Unofficial)'s Promotion
  • Exilemod (Unofficial)'s Maps - Mission Files
  • TKO's Weferlingen
  • TKO's Green Sea
  • TKO's Rules
  • TKO's Changelog
  • TKO's Help
  • TKO's What we Need
  • TKO's Cam Lao Nam
  • MSOF A3 Wasteland's Server Game Play Features
  • MSOF A3 Wasteland's Problems & Bugs
  • MSOF A3 Wasteland's Maps in Rotation
  • SOS GAMING's Server
  • SOS GAMING's News on Server
  • SOS GAMING's Regeln / Rules
  • SOS GAMING's Ghost-Town-Team
  • SOS GAMING's Steuerung / Keys
  • SOS GAMING's Div. Infos
  • SOS GAMING's Small Talk
  • NAMC's Topics
  • NTC's New Members
  • NTC's Enlisted Members
  • The STATE's Topics
  • CREATEANDGENERATION's Intoduction
  • CREATEANDGENERATION's HAVEN EMPIRE (NEW CREATORS COMMUNITY)
  • HavenEmpire Gaming community's HavenEmpire Gaming community
  • Polska_Rodzina's Polska_Rodzina-ARGO
  • Carrier command tips and tricks's Tips and tricks
  • Carrier command tips and tricks's Talk about carrier command
  • ItzChaos's Community's Socials
  • Photography club of Arma 3's Epic photos
  • Photography club of Arma 3's Team pics
  • Photography club of Arma 3's Vehicle pics
  • Photography club of Arma 3's Other
  • Spartan Gamers DayZ's Baneados del Servidor
  • Warriors Waging War's Vigor
  • Tales of the Republic's Republic News
  • Operazioni Arma Italia's CHI SIAMO
  • [GER] HUSKY-GAMING.CC / Roleplay at its best!'s Starte deine Reise noch heute!
  • empire brotherhood occult +2349082603448's empire money +2349082603448
  • NET88's Twitter

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber (xmpp)


Skype


Biography


Twitter


Google+


Youtube


Vimeo


Xfire


Steam url id


Raptr


MySpace


Linkedin


Tumblr


Flickr


XBOX Live


PlayStation PSN


Origin


PlayFire


SoundCloud


Pinterest


Reddit


Twitch.Tv


Ustream.Tv


Duxter


Instagram


Location


Interests


Interests


Occupation

Found 512 results

  1. I'm currently working on a money system for a gamemode I made for my friends and I. Boxes spawn all over the map and when a player gets close to it; he receives some money. The only problem I have with this script is that it only seems to work for the player who interacts with the box for the first time. This code is part of a sqf which is executed from the init.sqf. Does anyone have any idea why it doesn't work for all players in the server but only for the first player who picks up a box? BoxAmount = 0; for "_i" from 1 to 50 do { _Mcolor = "ColorGreen"; _Mtext = "$50"; _MMoney = 0; _quality = [1,2,3] selectRandomWeighted [0.1,0.2,1.3]; if (round _quality == 1) then { _Mcolor = "ColorWhite"; _Mtext = "$500"; _MMoney = 500; }; if (round _quality == 2) then { _Mcolor = "ColorYellow"; _Mtext = "$200"; _MMoney = 200; }; if (round _quality == 3) then { _Mcolor = "ColorGreen"; _Mtext = "$100"; _MMoney = 100; }; //hint format ["%1",_quality]; private _types = [ "BUILDING", "BUNKER", "BUSSTOP", "CHAPEL", "CHURCH", "FORTRESS", "HOSPITAL", "HOUSE", "LIGHTHOUSE", "POWERSTATION", "WATERTOWER" ]; _allBuildings = nearestTerrainObjects [[14000,18000], _types, 50000, false, true]; _allPositions = []; _allBuildings apply {_allPositions append (_x buildingPos -1)}; _rndPos = selectRandom _allPositions; _box = "Land_PaperBox_01_small_closed_brown_f" createVehicle [_rndPos select 0, _rndPos select 1, (_rndPos select 2) + 3]; _Mname = "marker" + str _i; [_Mname, _rndPos, _Mcolor, _Mtext, _box, _MMoney] spawn { _Mname = _this select 0; _rndPos = _this select 1; _Mcolor = _this select 2; _Mtext = _this select 3; _box = _this select 4; _MMoney = _this select 5; _dropoffmarker = createMarker [_Mname, _rndPos]; _dropoffmarker setMarkerShape "ICON"; _dropoffmarker setMarkerType "mil_box"; _dropoffmarker setMarkerColor _Mcolor; _dropoffmarker setMarkerText _Mtext; private _Amoney = player getVariable [format["_Amoney_%1", player],0]; while {true} do { if (player distance _box < 5) exitWith { deleteVehicle _box; deleteMarker _dropoffmarker; _Amoney = _Amoney + _MMoney; hint format ["You picked up $%1", _MMoney]; player setVariable [format["_Amoney_%1", player], _Amoney]; }; sleep 2; }; }; };
  2. Hi there, I'm working on a campaign for my group that involves them being under a vehicle resource scarcity. I'd really like to use a system similar to how Mike Force does wreck recovery with all of it's vehicles, helicopters, etc. However I can't seem to find any good mods or scripts online to start from. Any and all advice is greatly appreciated. Edit: I did just realize I should be able to download the Mike Force Mission itself and take a look at stuff, but any advice is still more than welcome. Edit Edit: I started looking through the Cam Lao Nam Mike force mission and actually learned a lot of cool stuff on how it works. I've determined that for my purposes the only actual functionality I would need is the packaging wrecks into crates function but I suspect it's not going to be as simple as pulling "fn_veh_asset_package_wreck.sqf" into my own mission because there are a lot of other functions and variables that are linked to it as well.
  3. Hello I want to spawn the explosion of the 30 mm MP-T from the LDF APC using createVehicle. I know you can spawn "HelicopterExploBig" and I was wondering if there was a CFGAmmo for the 30mm explosion.
  4. Hello, I've made a script to help people to create missions having spawn zones with random spawn points and waypoints It can be used with any mods/maps (or even pure vanilla) The script, with a detailed usage guide can be found on GitHub Preconfigured (and non-configured) templates of the script can be downloaded here Usage All you need to do is to place one (or more) triggers on the map and name it respecting a specific format : DynamicSpawn_<Activating side>_<Side to spawn>_<Amount of infantry squads>_<Amount of waypoints for infantry>_<Amount of vehicle squads>_<Amount of waypoints for vehicles>_<Amount of air units>_<Amount of air units waypoints (actually unused)>_<ID of the trigger> Where : <Activating side> is the side that will activate the trigger when entering in <Side to spawn> is the side of the units that will spawn when the trigger is activated Both sides can have the values : "WEST", "EAST", "GUER", "CIV" <Amount of infantry squads>, <Amount of vehicle squads> and <Amount of air units> are the amount of squads that will be spawn (except for air, that's just the amount of units). They can have any value above zero (including zero if you don't want such type of units) <Amount of waypoints for infantry>, <Amount of waypoints for vehicles> and <Amount of air units waypoints> are the amount of waypoints for each kind of squads (actually unused for air units). They can have any value above zero (including zero if you don't want the units to move) or a range of values using a comma , as separator, such as 4,8 if you want between 4 and 8 waypoints. <ID of the trigger> is a numeric value used to identify each triggers. Keep them unique or you may expect bugs (such as units spawning/moving at the wrong place) For example : DynamicSpawn_WEST_EAST_5_6,8_2_4_1_1_1 will trigger when an unit from WEST enters the trigger and will spawn units from EAST such as : 5 infantry squads having each between 6 and 8 waypoints 2 vehicle squads having 4 waypoints 1 air unit The Id of the trigger is 1 Then, you can place spawn points, named such as : <Type of group to spawn>_SPAWN_POINT_<id of the trigger>_<id of the spawn point> Where : <Type of group to spawn> can have as value any of those : INFANTRY, VEHICLE or AIR <id of the trigger> must match the id of the trigger previously created, so that way, when trigger 1 will be activated, the script will know it must use the *_SPAWN_POINT_1_* as spawn points. That way, spawn points can be placed outside of the trigger (allowing, for example, air units coming from far away) <id of the spawn point> is used to have different unique names for spawn points (and that value is automatically incremented when copying/pasting the spawnpoints) For example : INFANTRY_SPAWN_POINT_1_1 INFANTRY_SPAWN_POINT_1_2 INFANTRY_SPAWN_POINT_1_3 ... VEHICLE_SPAWN_POINT_1_1 VEHICLE_SPAWN_POINT_1_2 VEHICLE_SPAWN_POINT_1_3 VEHICLE_SPAWN_POINT_1_4 ... AIR_SPAWN_POINT_1_1 AIR_SPAWN_POINT_1_2 ... The example below shows many spawn points placed in Stratis. You can notice the air spawn points are placed all around the map, far away from the trigger. The waypoints work the same way than the spawn points : Their format is : <Type of group>_WAYPOINT_<id of the trigger>_<id of the waypoint> : INFANTRY_WAYPOINT_1_1 INFANTRY_WAYPOINT_1_2 INFANTRY_WAYPOINT_1_3 INFANTRY_WAYPOINT_1_4 ... VEHICLE_WAYPOINT_1_1 VEHICLE_WAYPOINT_1_2 VEHICLE_WAYPOINT_1_3 ... There is no air waypoints, the behavior of air vehicles is different : Once spawned (1000 meters altitude), they will fly and loiter around the center of the trigger (Altitude 250, radius 500) When a unit from the activating side is detected by the spawning side, the aircrafts will go Seek and Destroy on that unit location. When the search is over, they will go back to loiter The script is highly configurable and customizable You can configure which units type will spawn. This way, you can use any mods, as long as you tell the script the classnames of the units/groups you want to use You can inject custom scripts that can be executed at : Trigger creation Trigger activation Trigger deactivation Trigger cleared (when all spawned units are dead) More informations on GitHub
  5. 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.
  6. So I'm working on a Cold War era tank mission, very basic stuff with a US platoon breaching through a Soviet frontline. However, a trial run of the mission revealed that there are a pair of glaring issues. At first I wanted to abandon the thing, but I'm also very stubborn so I'm asking for advice here. The first issue is that I need a full repair script or function that works with a moving vehicle, as the mission has an AI support convoy tagging behind the tanks. Doing ACE repair, even with boosted settings, is a came of hunting for interaction points, so I'd rather just have an ACE interact point on the repair truck that allows you to fully repair a nearby vehicle. Similar with how rearming works, unless there's something I've missed in the ACE settings themselves that someone could inform me of. Nevermind, just noticed the ACE settings were set to Repair Facility and Advanced Engineer for the mission. I'm dumb. Although, something similar for a full heal tied to an ambulance vehicle would be good. The second issue is that the trial run revealed I had put down way, way too much AI on the mission and that had a very adverse effect on performance. To the point things started flickering badly for players (and myself) at random. I had set up Dynamic simulation for the units, however the only way it wanted to work properly was if I used the module, instead of the performance options so I must've done something wrong from what I can tell. So instead what I want to do is having tanks and IFV's spawn a distance away and come at the players, combined with some static defences. I have one basic script that spawns in AI, and making them move towards a marker waypoint, or use a LAMBS module: _grp1 = [getMarkerPos "testSpawn", east, ["O_Soldier_SL_F", "O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_F","O_Soldier_AR_F"],0] call BIS_fnc_spawnGroup; _wpt1 = _grp1 addWaypoint [getMarkerPos "testMove",5]; _wpt1 setWaypointType "MOVE"; The problem is that, while it's really handy it only works with infantry. Most likely due to how closely they spawn, as whenever I tried using it with vehicles it usually ended up with them signing up for the space program so to speak. So I'm looking for some alternative that let's me spawn in a platoon of tanks and have them head towards the players. Especially as a whole unit, as I've noticed that tank platoons can be slow to get moving and usually drip feed themselves into the action. But that could also be LAMBS for all I know, and probably something I need to check closer at some point.
  7. Would love some help figuring out how to make groups retreat back to base when needed. Such as a groups ammo running low, or when a vehicle's fuel/ammo is dwindling. Link some relevant tutorials, script commands/variables etc. This part is probably irrelevant, but to go in depth of what i wishto achieve... I want to make groups I can switch to, but if I havent switched to a group in awhile they will go back to base to replenish. Hoping to have these groups roam chernarus redux in a ravage mod scenario.
  8. Eman-227554645821b8d3

    Group tasks in multiplayer

    Greetings all! Long time lurker first time poster. I am currently working on an MP mission in Prairie Fire and I am trying to accomplish having each of my 3 groups (All BLUFOR) have separate tasks that they have to accomplish throughout the mission. I tried at first to do it with the modules but as you can imagine the triggers where not firing correctly (Probably my fault) and the insane amount of sync lines in the mission made me want to move to a script based solution. Which is where I am currently stuck and would love to have some guidance. Here is my current setup. 3 groups (All BLUFOR) Group names = RT, CV, and SR (Have not even bothered with SR because I can't get the first two to work correctly) initServer.sqf if (isServer) then { [RT, "RTbrief", ["Chief SOG has mission brief for RT Alabama.", "Go to the OPS brief", ""], chief, "ASSIGNED", 99, true, "whiteboard", true] call BIS_fnc_taskCreate; [CV, "CvyBrief", ["Chief SOG needs you at the OPS brief with RT Alabama.", "Go to the OPS brief", ""], chief, "ASSIGNED", 99, true, "whiteboard", true] call BIS_fnc_taskCreate; }; RT1 trigger "RtTasks\RT1-brief.sqf" remoteExec ["BIS_fnc_execVM","RT",true]; RT1-brief.sqf ["RTbrief", "succeeded"] call BIS_fnc_taskSetState, sleep 3; [RT, "S4", ["Go see the Quatermaster at S4 to draw weapons and gear for your mission.", "Draw weapons and gear", ""], [9418.15,6592.3,2.84225], "ASSIGNED", 98, true, "RIFLE", true] call BIS_fnc_taskCreate; CVY1 Trigger "CvyTasks\CVY1-brief.sqf" remoteExec ["BIS_fnc_execVM","cv",true]; CVY1-brief.sqf ["Cvybrief", "succeeded"] call BIS_fnc_taskSetState, sleep 3; [CV, "GetInAC", ["Head to the airfield and get in the AC-119K", "Get in AC-119K", ""], [9629.8,6631.44,6.89819], "ASSIGNED", 98, true, "GETIN", true] call BIS_fnc_taskCreate; I originally had this setup in the triggers but thought the problem had something to do with the use of "execvm" and tried the code in the blocks above. if (isServer) then { [[], "CvyTasks\CVY1-brief.sqf"] remoteExec ["execvm", 2]; }; Okay so as you can tell I have been calling an SQF file for each of the tasks so they fired in sequence instead of being able to see all the tasks from the start of the mission (There is probably a much better way to do this😅). Task(initServer)>Trigger call>run SQF. One for each task (RT has 9 tasks, CV has 5 tasks, and SR has 6). I'm sure there is a much more eloquent/efficient/better way to write this script and would love to see it. This solution worked fine in the editor but once I put the mission on my dedicated server the first person to hit their groups respective trigger would disable the other groups trigger (If RT hit their trigger and then CV tried to hit theirs it would not fire or vice versa). There was a time period where it would just assign the group who hit their trigger first task to the other group but that seems to have stopped happening. As you can tell I am super new to scripting and failing to grasp using these functions properly let alone how this needs to be done to support MP play. Let me know if you need more details. I am very grateful for any advice/help you can provide me and I am eager to learn. Thanks in advance!
  9. I found something interesting with the 'attachTo' command recently, in order for the 'attachTo' command to work properly, an object must have a varName, not just an object reference. this means that the following code will not behave as intended: _object = createVehicle [args]: _object attachTo [args]; Instead i have to do something like below in order for it to work... _object = createVehicle [args]: _object setVehicleVarName "vehicle01"; _object attachTo [args]; I wish i knew this earlier.... Now it is entirely possible i am slow but i did not see anything about this on the community wiki or written down anywhere for that matter i dont know how to add it to the wiki myself or if i can add it myself, But adding this on the 'attachTo' wiki somewhere would be a great help in avoiding others slaving hours on a mod, just to find out that this is the issue. Thanks!
  10. Hi there, I'm trying to set up a script that will both change the state of a task and also display a separate hint for the players. If it's possible to have an addAction activate two functions I'm unable to figure out the syntax. Here's what I'm working with so far; this addAction ["Try Elevator Controls",{["EscapeCargo", "FAILED", True] call BIS_fnc_taskSetState}]; This function seems to work just fine with the task modules I've already set down with 3den editor. However I also want the same addAction to activate this; [hint "The Elevator Controls don't seemn to have any power"] I'm still working to try to wrap my ADHD brain around the code syntax for all of this but would greatly appreciate anyone's help on this. Edit: got the syntax sorted out now and definitely going to be reading up more on SQF syntax now as this seems like an incredibly newb question. ended up going with this; this addAction[ "Try Elevator Controls", { [ "EscapeCargo", "FAILED", true ] call BIS_fnc_taskSetState; hint "The Elevator Controls don't seemn to have any power"; sleep 15; hintSilent ""; }]; Many thanks!
  11. I'm totally new to scripting for custom missions in ArmA, and I'm running into an issue with the execution of a .sqf file. The game knows the file is where it's supposed to be but nothing happens after. execVM "SpecOps.sqf"; I put the above into the init boxes of several units but the commands I put in the file wont execute. This is how they are written verbatum spaces and all: player enablestamina false; player enablefatigue false; player setAnimSpeedCoef 1.1; player setUnitRecoilCoefficient 0; player setCustomAimCoef 0; I don't understand why they aren't working or how else to write them and i'd like it to only execute on certain units. I apologize for my ineptitude, i used the wiki but not very well apparently.
  12. Hi there, I'm a relative newbie to SQF scripting. I also have ADHD which presents other challenges when I'm trying to code things. I learn best by looking at examples of working scripts to learn how they function. A friend of mine gave me this script to use for a simple teleport addAction. I genuinely don't know what anything after the "teleportVariableName" bracket does, but it doesn't seem to work without it. this addAction [ "Teleport", { [player setPosAtl (getPosAtl teleportVariableName)]; }, nil, 5, true, true, "", "true", 5, false, "", "" ]; I've used it quite a bit to great effect, however on the current campaign I'm running it doesn't exactly work how I need. Normally we'll put down a flag pole or something simple for the re-insert point for players to teleport too so they can get back in the action. However with our current campaign my players are taking a vehicle around with them from our base so I figured it might be cool for them to just use that as the re-insert point instead of a flag pole or something else that I would need to move around manually. However upon testing I realized that it teleported them directly into the middle of the vehicle, and not like into a seat or anything. It simply puts them on the ground in the middle of the vehicle so that they're clipping through. I'm looking for something that would allow me to use the vehicle's position but like 5-10 meters behind it or something that would actually put them in a seat in the vehicle or anything like that. I was looking into using the regular SetPos function as it looks like you can modify it to fit this kind of purpose but I'm having trouble figuring out how to make that work. Any tips or advice are welcome as I'm trying to learn more about scripting to improve my missions. Thanks in advanced!
  13. I am pretty new to doing any sort of SQF/init scripting that isnt just frankensteining code together so I would appreciate any help! Simply put, I want to make a fun little roleplay mission where for that mission, a phrase comprised of multiple randomly selected arrays is generated. The Indfor act as captives that are all assigned ONE word from the phrase at random to keep secret. (This is where multiple arrays work better since you can just call the arrays by "word1", "word2", "word3". (I intend to have 4 words, 1 array for each.) And ontop of that I want the entire code phrase to be displayed in its entirety to the Blufor. For this to work, the result of the generation needs to only be prompted once and then have. TLDR: Server generates a code phrase from several arrays. I cant figure out the init code and they usually return as null no matter what I attempt. And to be exact, I dont want people to generate a phrase/array results every time they call; I simply want it generated, stored, and have players access the results. I dont know how efficiently this could be done whatsoever outside of theory crafting nonsensical code. If there is a better alternative please help me out. Please help, Working backwards I am trying to: I inserted the code into initServer.sqf for simplicity; Can execute it as a script later on? Or is a dedicated SQF necessary? This code is almost certainly full of wrong or incorrect syntax/formatting. This is just an outliner of what I am trying. If my method is wrong then please help me goal wise. 2. Have a way to display either a SINGLE result of that array on individual units, preferably just adding a action into their init boxes to get the array/codephrase. I want 2 UserActions I can insert into unit inits; One that displays the codephrase, and one that displays a single array's result- as hints.
  14. I don't understand how the rotation works. Specifically I made Airburst Mortar rounds and want to increase the kill zone by rotating the claymores: this addEventHandler ["Fired", { params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; nul = [_drone,_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle] spawn { params ["_drone","_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"]; waitUntil { sleep 1; getPos _projectile select 2 > 50 }; while { alive _projectile } do { waitUntil { getPos _projectile select 2 < 30 }; for "_i" from 0 to 3 do { _tungsten_fragments = createVehicle ["ClaymoreDirectionalMine_Remote_Ammo", [0,0,1000], [], 0]; _tungsten_fragments attachTo [_projectile,[0,0,0]]; _random =round (random 10) / 10; _tungsten_fragments setVectorDirAndUp [[0,0,_random], [0,0,_random]]; _tungsten_fragments setDamage 1; }; deleteVehicle _projectile; sleep 1; }; }; }]; I don't understand which numbers in the setVectorDirAndUp Array I need to change to rotate the claymores and what each number even does .
  15. How would I go about creating the replication methods for this class? class CustomClass { IEntity ent; string fName; }
  16. I know .sqf is generally better but i would like to save the props as a composition so i can just place it down in different missions. Is there a way to run loops in the init field WITH suspension. Sleep doesnt seem to work.
  17. Hi guys, I'm currently working on a script that will allow a player to shoot another unconscious player and then revive him immediately. I already have the revive system ready, but I haven't found a way to make it so that only the player who was shot is revived. Do you have an idea how I can make it so that the code is only executed on the player who was hit? I have already tried to rebuild a taser script but didn't really get anywhere. Thanks for your help!
  18. Hi, basically I'm trying to write a script to pickup and move nearby bushes - right now I've got it to the stage where it removes any bushes from a 10m radius around the player and I have the script for picking up and placing them pretty much ready, however I need a way of grabbing the p3d of the bush to spawn it in with the "pickup" script. (currently this spits out the error: Type Object, Expected Array,String) I also need a way of removing any tree p3ds from the script since some map makers put bushes in the same terrain class (not sure if that's the right terminology) as trees and so simply removing "tree" from the ["tree", "bush"] section of my script wouldn't work. Since all trees are named t_*treename* and all bushes are named b_*bushname* I have tried to stop them from being included in my script however I am completely lost. I would appreciate any help regarding the script - Cheers !
  19. FYI: Yes, I have googled and researched a lot about the issue I am having. Arma Discord, Enfusion Discord, ChatGPT, Bard, Forums and so much more and it appears that the coverage about my issue is either very hard to find or there isn't much on it. What have I done so far? Reinstalled the server. Restarted multiple times. Changed scenarios multiple times. What issues was I having before? My previous issue was that my server couldn't be connected too, Arma Reforger Server application was not listening on the correct port, I am unaware at this current time whether this is an issue with my hosting company (OVH), as we did research that they were using a switch. (Yes, I have opened the ports fully through the windows firewall for UDP port 2001, 17777, 50000-65000, 5678; however, this did not seem to work, it's as if the application itself is refusing to listen on that port). I am unaware of whether this issue is fixed yet or not as we cannot even get the server to appear online. What issue am I having now? I am receiving A LOT of script errors (logs attached below), these errors are now appearing to stop the server from fully becoming online and causing the server to crash upon start-up. What type of environment am I working on? Windows Server 2019 OVH Bare Metal Cloud Dedicated Server (AMD Ryzen 9 5900X - 12c/24t - 3.7 GHz/4.8 GHz, 64 GB ECC 3200 MHz, 2×1.92 TB SSD NVMe (Soft RAID), 500mbps up/down public bandwidth, 100mbps up/down private bandwidth) No mods installed or in my configuration. Latest version on both client and server. StartArmaReforgerServer.bat file attached. https://pastebin.com/UA0CJULZ UpdateArmaReforgerServer.bat file attached. https://pastebin.com/v3Xw9BUB config.json file attached. https://pastebin.com/De6pEbMH console.log file attached (server). https://pastebin.com/VriF7APR error.log file attached (server). https://pastebin.com/KGv8VBkJ script.log file attached (server). https://pastebin.com/ix9Bq5zp Arma Reforger Server folder structure. https://imgur.com/a/3sFImFE Any and all help would be appreciated, I have been at this for straight hours over days now.
  20. This is going to be a stupid easy question to answer, I know this is a very simple thing to do, but, I cannot figure this out. I have a trigger placed in editor, it is a 'restricted area'. When the player enters it runs my restricted area function. It will eventually be awesome, but first I need to pass parameters from the trigger to the script to define some things, because there will be multiple areas with different owners and be different sizes etc. So, my question is, how in the heck do I return triggerArea inside of the script from the trigger that exec'd it?? On Act: [independent, false] execvm "restricted.sqf"; restricted.sqf /* bunch of debug stuff here dont worry */ // variables _faction = _this select 0; _sendQRF = _this select 1; _zone = _this; _guards = units inAreaArray _zone select {side _x == _faction}; _bodies = allDead inAreaArray _zone; /* more awesome stuff later after I figure out triggerArea */ You see _zone needs to be the triggerArea, and the _guards are the AI inside the triggerArea (of the corresponding side). Once I figure out how to define these variables all my other code will work and I can place down a bunch of restriced areas and just pass the owner params. But I cant get a return of guards or deadBodies in the dang triggerArea. This is as close as I know how to tell the script that _zone should be the triggerArea of the editor placed trigger whatever size it may be. I have also tried the following: *_zone = _thisTrigger *_zone = _thisList *[independent, thisTrigger, false] execvm "restricted.sqf"; with _zone = _this select 1; None of the above works, keep getting syntax errors about arrays and elements provided. And yes, I have read the wiki and searched the interent for a similar script/solution. Please dont reply with the wiki pages and just tell me to 'read the wiki'. If I understood how to write C code or interpret the generous documentation that is published by Bohemia I wouldnt be posting in the forums for help. I have read and tried to the best of my scripting knowledge from the following: https://community.bistudio.com/wiki/triggerArea https://community.bistudio.com/wiki/inArea https://community.bistudio.com/wiki/inAreaArray https://community.bistudio.com/wiki/Magic_Variables Thank you to anyone who can help 👍
  21. So, I'm working on a mission for my group, and one of the objectives is to rescue a captive held by opfor. I want the captive to be injured, but in a way so that whilst they won't die, medics will need to treat them and they'll need a medevac sooner rather than later. I'm thinking severe bloodloss, severe pain, some bandaged wounds, a broken leg and a major wound TQ'd should do the trick. Rather than fuck about with trying to use ace_medical_fnc_addDamageToUnit to get sorta the right wounds, I've decided it would be simplest to just build the medical state I want as a JSON, and use ace_medical_gnc_deserializeState to apply said state to the unit. Most parts of the JSON file are fairly self explanitory, but I'm having trouble figuring out what the 4 numeric values for ace_medical_openwounds / ace_medical_stitchedwounds / ace_medical_bandagedwounds correspond to, and what those values represent, as there seems to be no documentation on it (at least, I've not been able to find any. maybe I'm just an idiot). I'm slowly "trial / error"ing my way through, but I'm wondering if anyone else knows / can explain these values, as it would save me a considerable amount of time.
  22. Hi, I thought I'd share this as I couldn't find anything useful other than someone on Reddit saying they'd made it work but not how. I managed to set up Land_Airport_01_hangar_F to open and close on a script. I have two sqf files, one is named Hang1close, the other is Hang1Open. In Hang1close: Hang1 animate ["Door_2_move",0]; Hang1 animate ["Door_3_move",0]; In Hang1Open: Hang1 animate ["Door_2_move",1]; Hang1 animate ["Door_3_move",1]; The building is named Hang1 in game, and I have two transfer switches (Land_TransferSwitch_01_F) on either side, as the door covers the outer one when open. These both have the same script: this addAction ["Open", "Hang1Open.sqf"]; this addAction ["Close", "Hang1close.sqf"]; Pretty simple, just thought as I couldn't find how to operate the doors on this particular building that I'd share with all. No idea why the didn't make it something that could be done on the doors in the game, as the animation is there. Cheers, LR
  23. Hello all, I have been trying to set up a script that destroys specific class names within an area for a community I am in. The idea is to eventually get the script as part of a module but I am unable to get the base script working yet. Any help reviewing my errors would be appreciated. PolterDrones = ["212th_UAV","212th_UAV_ATK"]; DeadDrones = PolterDrones; NearbyDeadDrones = nearestObjects [Jammer1, DeadDrones, 500, false, false]; { ExplodedDrones = typeOf _x; if (ExplodedDrones in PolterDrones) then { _x setDamage 1; }; forEach _NearbyDeadDrones; };
  24. Hello guys, I am looking for a method to save and edit data across mission restarts. We are currently scripting a round based multiplayer game mode. After each round, the mission is restarted and a winner and loser team is determined. Now we are looking for a way to track the won rounds per team and the team that has three points first is the winner. The problem is that with each the mission restarts, the variables are overwritten. Does anyone have an idea how to achieve it so that the points per round are counted regardless of the mission? Thanks for your help
  25. Hello guys, I have a strange problem with the following script: tsk = format ["tsk%1", random 100]; [allPlayers, tsk, ["Hack the watchtower to get information about the position of the opposing players!", "Watchtower", ""], laptop, "ASSIGNED", 99, true, "download", true] call BIS_fnc_taskCreate; [laptop, "Activate watchtower", "\a3\ui_f\data\igui\cfg\holdactions\holdaction_connect_ca.paa", "\a3\ui_f\data\igui\cfg\holdactions\holdaction_connect_ca.paa", "player distance laptop < 5", "player distance laptop < 3", {num = execVM "watchtower\durring.sqf";}, {}, {nul = execVM "watchtower\gegner_markieren_v3.sqf", nul = execVM "watchtower\sleep.sqf", [tsk, "SUCCEEDED", true] remoteExec ["BIS_fnc_taskSetState", 0, true], sleep 0.1, [tsk, allPlayers, true] remoteExec ["BIS_fnc_deleteTask", 0, true];}, {["Hacking canceled!"] remoteExec ["hintSilent", 0, true], sleep 1; [""] remoteExec ["hintSilent", 0, true], call{playSound "cancel";}, execVM "watchtower\deletion_sound.sqf";}, [], 15, 0, true, false] remoteExec ["bis_fnc_holdactionadd", 0, true]; With the script I add a holdaction function to a laptop. When I start the mission in the Eden editor in singleplayer or multiplayer everything works as it should. The script is executed by the init.sqf and the holdaction function is displayed on the laptop. When I complete it with the spacebar it disappears again as it should. However, when I host the mission on my dedicated Arma server, the holdaction appears twice for some reason. Once with text and once without. Both run the same code when I use it and then disappear, but reappearing twice when I run the script again. Can any of you help me further? And tell me why this happens? Thanks
×