Search the Community
Showing results for tags 'Script'.
Found 661 results
-
Correct use of airportSide and setAirportSide
initramfs posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
As part of a general vehicle operations script I have fixed winged aircraft land in aerodromes based on conditional code. One particular aspect regarding the choice of aerodrome to land at depends on the controlling faction of said aerodrome. To assert landing at the correct aerodrome I was attempting to use the airportSide script command to determine the side of a given aerodrome based on a previously assigned side with setAirportSide. However, no matter what combination or order of calls to airportSide and setAirportSide (whether dynamically attempting to change airport sides or via static assignment in init scripts), airportSide always returns nil. The only case where I could get a non-nil result back from airportSide is when I use the object-overload of airportSide with a carrier, i.e.: _carrierSide = airportSide aircraftCarrierObject where aircraftCarrierObject is the variable name for an aircraft carrier scenario object placed in via the editor. To clarify, the usage of airportSide or setAirportSide with numerical aerodrome IDs seem to do absolutely nothing (which is inconsistent with the calling parameters of landAt, which works with aerodrome IDs). To give an example: 0 setAirportSide east; _aerodromeSide = airportSide 0; isNil "_aerodromeSide"; // Returns true Am I using the script command incorrectly in any way? Can anyone advise on what I am doing wrong? EDIT: To further clarify, I am attempting to get the Number/ID variant of airportSide/setAirportSide to work. I've already had success with the object-based overloads of those scripting commands, the only caveat being I do not know a way of deriving an "Object" out of Location entries on a map. The script command has been tested on Stratis, Altis and Tanoa with the same non-functional result. -
Prohibit unit to enter vehicle after leaving it
jts_2009 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello. I have following problem: I put AI into vehicle with moveindriver command. After some event he should leave it by: unAssignVehicle sct1; [sct1] orderGetIn false; sct1 action ["GetOut", vehicle sct1]; And after some times he should enter another vehicle by: [sct1] orderGetIn true; sct1 assignAsCargo EscapeBoat; but that ass go back to the first vehicle and enters it. I tried 'allowGetIn false' command. But after I write allowGetIn true, he goes back to the first vehicle. I don't know whats wrong with that vehicle-crap... He just goes back to the first vehicle and enters it even after unAssign commands and other... -
Hi all, First off, I am sorry if this is a known issue or if I am just plain wrong: I am new to scripting. I looked on the web but couldn't find anything about this topic... For context, I am trying to create a permanent smoke grenade from script. From the editor, it is straightforward: place a "smoke grenade" module and enable "permanent effect". This -if I am not mistaking- changes the variable "repeat" from 0 to 1. Makes sense. To make sure, I created a smoke grenade module and put "this setVariable ["repeat",1];" in its "init" module. Became permanent. The weird part now is that when I try to set this variable in a script, even though it changes the variable, the grenade pops out of existence after it's normal duration... So I guess this has to be set in the object's "init". But how do you access this init field since setVehicleInit has been disabled? Or do I get the problem wrong? To create the grenade from script and try to make it permanent: smoke_grenade = "SmokeShellGreen" createVehicle _atPosition; smoke_grenade setVariable ["repeat", 1]; As a disclaimer, I am aware that there are workarounds involving while loops, I am not interested in a workaround for this problem; I am trying to understand how Arma3 works.
- 4 replies
-
- setvariable
- script
-
(and 3 more)
Tagged with:
-
How to trigger player's insert marker on map
Nag's FoV posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello,I want to trigger when the player insert a marker on his map in a specific area, like in the prologue mission, where you have to find AAF position (youtube link : ).If you have any link or answer which can help me, please post it!Thanks. -
I have a co-op mission for up to 9 players and I have respawn enabled. When I start the mission in MP, everyone starts off dead unlike the AI. . . Also my script for allowing loadouts to be persistent even after dying and respawning isn't working. Any help would be appreciated and I can go further into detail about the mission if need be. Thanks
-
Locking UAV's cam turret on target via script?
Rydygier posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
1.66 stable, I have two crewed objects in the editor: Slammer tank and Darter UAV. Both have same init code: this doWatch player; doWatch does good job for my old autonomous turret script for UGVs and static unmanned MGs. At preview tank turns his turret at me (then starts constant 360 horizon scan, which isn't good too BTW), UAV does nothing. Also nothing happens for doTarget (expected). Same for spawned and crewed Darter. Same for (gunner this) doWatch player;. I'm positive, invisible UAV's gunner is manning the only UAV's turret. If I take remote control over this turret and change its direction, after releasing control turret turns back to initial direction. Meanwhile UGV Stomper RCWS behaves same, as Slammer. Is there any way to actually rotate UAV's cam turret (and reliably lock on for, say lasing the target) pointed object/position via script? To change UAV's cam turret direction at all with SQF? -
How to make a script trigger once task complete
Vontickle posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys, Hoping someone out there knows what i'm trying to achieve and knows the solution I'm looking for. So I have a map i'm working on, and there is a "Warlord" task where you have to kill him, which all works fine, What i'm wondering is how can i get a script or trigger to work so when he is dead another script with activate? Thanks in advance. -
Having Trouble Getting Convoy Moving Post-Attack
Zaptoman posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys. Need some assistance. I've got a convoy travelling down the road. I've scripted them to switch group leader to the next available hunter if one is destroyed. However, often they just sit in place after combat. Hence I'm trying a new script to get them moving again. This is my code so far. if (!alive cvoy1) then {cvoy setleader cvoy2}; if ((!alive cvoy1) and (!alive cvoy2)) then {cvoy setleader cvoy4}; if ((!alive cvoy1) and (!alive cvoy2) and (!alive cvoy4)) then {cvoy setleader cvoy6}; if ((units cvoy) findNearestEnemy cvoy=null) then {units cvoy doFollow leader cvoy}; However I can't get it to work. Do I need to define an object in the mission's init.sqf? -
It is a convoy mission, and the players are allowed to use whatever path they want. This makes me often loose them. But here is the issue. I want to be able to teleport to players as Zeus, but stuff placed in editor cannot be edited by Zeus. Is there a way to spawn PLAYABLE units in-game, so that i can just use them like normal ones? Or is there a way to go around the issue, for example by using some kind of a script?
-
I have been making a mission involving the Nimitz and a squad that is tasked to take a boat to this island (Map is Kerama Islands for those curious) and blow up AA defenses so F18s can do the rest. I have 3 objectives for the 9 man squad (Each member's Variable Name is F1-F9). The objectives are A.) Get in the boat B.) Unload at the shore/Rearm if needed C.) Take down AA I have C.) finished but I am having an issue with A.) For the objective I have set down the "Create Task" module titled "Get in the ship" and its state is "Assigned" with an always visible marker on the boat. Synced to the "Create Task" module I have a Trigger that has a timer for the Objective to be assigned (Like 2 seconds just so the notification pops up). next I have the "Set Task State" module in the state of completed. There is a trigger synced to the "Set Task State" module. The Trigger has Activation set to "Any Player" and Activation Type "Present" the Condition Script box has the following code: allInTheVehicle = false; while {(not allInTheVehicle)} do {allInTheVehicle = true}; {if (!alive f1 && f2 && f3 && f4 && f5 && f6 && f7 && f8 && f9 || vehicle truck1 != myVehicle) then {allInTheVehicle = false;}} forEach playableUnits; globalAllInTheVehicle = true; My friend supplied me with this script but we couldn't figure out why the objective will not render as completed when all playable units take a position within the boat (Driver, Navigator, Gunners, Etc). Any help with this would be grateful since I am still new to scripting.
-
Im looking for a script that allow players in a dedicated srv spawn custom tasks with a map click for location. A few years ago I played with a unit that uses a script to generate practice tasks. It was very simple, you interact with an object then choose a task type from a lists and then just click on the map to generate the task. It was very simple: click on the flag, click on the Tasks Options screen, click on map, play!
-
insurgency script Insurency mission scripts
timebomb18 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello everyone, I'm working on an insurgency mission, I'm doing it on the map Fallujah, I've done all the spawn part of AI (ALIVE) only missing the main one: A script for AI to drop intel to reveal ammo cache and another to spawn The ammo cache. I tried copying from "ALiVE Insurgency Revived by Hazey", but it does not work ... Grateful- 8 replies
-
- insurgency
- intel
-
(and 3 more)
Tagged with:
-
Player Movement Speed [Walk, Strafe, Sprint] How to Customize?
BlueArrow posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Hey guys, spent some time searching the forums for info on configuring or setting Movement speed values for the player, or all players, infantry or civilians. Specifically Tactical, Walk, Strafe and Sprint speeds. I can't seem to find any commands related to this, whether console commands or creating a custom script. All I found was for vehicles or setVector commands. I couldn't find anything anywhere for player movement speeds, nothing in the forums, nothing on youtube, no mods anywhere either. At this point I'm wondering if its hardcoded and there's no way to change these values for soldiers. -
How to execute multiple .sqf's through custom GUI
SnakeDocc posted a topic in ARMA 3 - QUESTIONS & ANSWERS
So I'm trying to create a custom GUI I can open through an addAction on an object, and through that GUI be able to select different .sqf's via tick boxes and then execute multiple of them through a separate button, as well as having another button for executing an .sqf and one for closing the GUI (example GUI linked below), I've created the GUI and understand how to make it show up in game, but I can't work out how you then tie all the separate .sqf's to the separate buttons. Could anyone with experience explain what the next steps are or link me to a forum post I've missed, below I've linked my GUI EDITOR OUTPUT as Classes and exported Styles sheet below. GUI Editor Output https://pastebin.com/C2fHnjyu Styles Sheet https://pastebin.com/qFQrb3QX -
Toni's Barrier Menu v1.0 Alpha Q: What is it? A: It is a Small script contained within an Addon that allows users to spawn barriers. Its good for anything from Milsim to Roleplay to just messing around in the Editor. Q: Didn't Someone Already Make a Script Similar to this? A: Yes, Warnerm14 did for Altis Life Framework but his was based on AddActions. Mine is A full GUI based solution and its modular (Can be used as a standalone addon or ported into a mission framework) Features: Inventory button for easy access, Simple to use GUI, Fully customizable, Portable to a mission file if the addon is not what you need. Download/View Source Code From Github Download From Google Drive Lemme know what you all think and feel free to leave a reply with opinions. Please Report issues on Github! :)
-
Just wanted to post this script in case it's helpful for people. For our Arma 3 Linux server (headless) we use: LinuxGSM - for Arma 3 server startup and updating Arma3Sync - for providing delta diffs of mods Apache - for serving up mod files Steam - for updating Arma 3 server and downloading mods from the workshop I wrote a little Python script that automates the updating of mods via Steam workshop, copies keys, updates mods via Arma3Sync and then restarts the server all via the command-line. No more manually downloading and extracting files! If you have suggestions or improvements, feel free to fork the file or post here.
-
Using multiple hintC back-to-back not working
COL Alexander posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am having some trouble with the hintC function and navigating some of its quirks. Here are the scripting requirements for the text I need to display to the user. 1. Must be structured text 2. Must prompt the user to click to continue 3. Must be able to display messages back-to-back (after each click to continue)_ Trying to keep the issue pure, here is the essence of what I am trying to do: //call function to show all course results _action1 = player addAction ["View Completed Courses", "functions\fn_NAV_adminReport.sqf",1]; [fn_NAV_adminReport.sqf] _allCourses = [_course1, _course2, _course3,..._courseN]; //each _course is a TEXT object (i.e structured text) for "_i" from 1 to count _allCourses do { // if there are syntax errors here its because i wrote it in this editor...its the concept that matters "myTitle" hintC parseText _myArray[_i-1]; sleep .1; }; The issue is that only the first hint displays. I use sleep .1 following Worldeater's advice on the BSwiki HintC page...but doesn't work. This also happens with something as simple as this: "title" hintC "FIrst"; sleep 1.5; "title" hintC "Second"; as well as the alternative version (I can't use this version as it doesn't accept structured text): hintC "FIrst"; sleep .1; hintC "Second"; Any advice on how to make hintC display back-to-back or any alternative methods I can use to accomplish my objectives? -
createVehicle dedicated server problem
dlegion posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
hi guys ! i've found an awesome script to enable dual primary weapons, that works really good, but has a little problem i noticed only after hours of play. here the script: ...at start it works perfectly, i can die & respawn, go on vehicles or on foot, do everything and it works perfectly. BUT.....after maybe 20 minutes i noticed my "weapon on back" was gone, and script bugged (doesnt asked me to put my weapon on back, as usually. from that day, it happened many other times, in fact i never noticed when the weapon disappear exactly, i just notice it only when i try to switch to my back weapon after many play time. i've tracked down the problem standing still with a "weapon on back" for a long time, and seems it disappear at some point, removing the weapon model and the actions to "take weapon back" or "put weapon on back". i'm pretty sure the problem is the loop that stop working, or maybe something to do with game auto-cleaner removing unused objects. any idea? thanks !- 9 replies
-
- createvehicle
- dedicated
-
(and 1 more)
Tagged with:
-
Show BIS_fnc_typeText2 to all Players
Justin Bottenbruch posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
So, i'm pretty new in the Arma 3 Mission edeting and scripting, or at least for Multiplayer. My problem is, that in my Singleplayer Missions i could just use BIS_fnc_typeText2 and everything worked just fine, but now I'm trying to do this and other Stuff like Hints etc. in a Multiplayer Mission, but it only is Shown to Host or when i put it on my Linux Root Server, to no one. All the triggers Work just how I want them to, New Tasks get Assigned and everything that has to be done by Server (like let NPC eject via script and stuff like this) work also. Only Issue I have is that Hint's and BIS_fnc_typeText2 etc. are not shown to the Players except host if launched local. What i did is Adding eventhandlers that get active if you kill the Guy you have to Start the Actual Mission. this addEventHandler ["killed", {[] exec "Missionflow.sqs"}]; The Code below is executed, but hints and Stuff is only shown to host. <Missionflow.sqs> [[["Bluefor", "align = 'center' size = '0.7'", "#0000FF"], ["", "<br/>"], ["Im Anflug für ''Para-Drop''", "align = 'center' size = '1.0'"]]] spawn BIS_fnc_typeText2; ~30 [[["OPFOR", "align = 'center' size = '0.7'", "#FF0000"], ["", "<br/>"], ["Im Gebiet", "align = 'center' size = '1.0'"]]] spawn BIS_fnc_typeText2; ~110 [[["WARNUNG", "align = 'center' size = '0.7'", "#FF0000"], ["", "<br/>"], ["Jets im Anflug", "align = 'center' size = '1.0'"]]] spawn BIS_fnc_typeText2; ~120 [[["EVAC", "align = 'center' size = '0.7'", "#FF0000"], ["", "<br/>"], ["Ist unterwegs", "align = 'center' size = '1.0'"]]] spawn BIS_fnc_typeText2; hintSilent "Achten sie auf Feinde"; And all this is only shown to Host, i dont know what to do about this, how am I getting this to work in Multiplayer so all are seeing this. What I also tried is giving the Playable Characters Variable Names (a to d) and then did this: this addEventHandler ["killed", {[a] exec "Missionflow.sqs"}]; this addEventHandler ["killed", {[b] exec "Missionflow.sqs"}]; this addEventHandler ["killed", {[c] exec "Missionflow.sqs"}]; this addEventHandler ["killed", {[d] exec "Missionflow.sqs"}]; I also tried adding a trigger and set Trigger owner to the Guy you have to kill, and set Activation on not Present, which works for ingame modules to become active very good for me. And in "On Activation" i put: [] exec "Missionflow.sqs"; // and also again with the Player Variables [a] exec "Missionflow.sqs"; [b] exec "Missionflow.sqs"; [c] exec "Missionflow.sqs"; [d] exec "Missionflow.sqs"; Hope someone can Help me, didn't found anything that seems to work for me so I'm asking here now.- 7 replies
-
- script
- multiplayer
-
(and 1 more)
Tagged with:
-
script Can someone help me with this sound replacement script? for the mx
cheif22 posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Can someone help me with this. I'm Kinda new to the whole sound mod but am interested, I have no idea but gotten this far and im just Confused on how to proceed from this point on how i can even get sound through. if someone could help me Thank you. the export for the file is .wss mono out of a pcm 16bit mono wave file. the script is in a config.cpp file. class CfgPatches { class mx { units[]={}; weapons[]={}; requiredVersion=0.1; requiredAddons[]= { "A3_Data_F", "A3_Sounds_F", "A3_Weapons_F" }; version="1"; author="cheif22"; }; }; class CfgSoundShaders { class MX_Closure_SoundShader { samples[]= { { "\mx\shots\closure1", 1 }, { "\mx\shots\closure2", 1 } }; volume=0.17782794; range=5; }; class MX_closeShot_SoundShader { samples[]= { { "\mx\shot\closeshot1", 1 }, { "\mx\shot\closeshot2", 1 }, { "\mx\shot\closeshot3", 1 } }; volume=1; range=50; rangeCurve="closeShotCurve"; }; class MX_midShot_SoundShader { samples[]= { { "\mx\shot\midshot1", 1 }, { "\mx\shot\midshot2", 1 }, { "\mx\shot\midshot3", 1 } }; volume=0.79432821; range=1800; rangeCurve[]= { {0,0.2}, {50,1}, {300,0}, {1800,0} }; }; class MX_distShot_SoundShader { samples[]= { { "\mx\shot\distshot1", 1 }, { "\mx\shot\distshot3", 1 }, { "\mx\shot\distshot3", 1 } }; volume=1; range=1800; rangeCurve[]= { {0,0}, {50,0}, {300,1}, {1800,1} }; }; };- 1 reply
-
- sound enhancement
- mod
-
(and 3 more)
Tagged with:
-
Need Help! How to make damage x useful in If type.
vallfield posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, I wanted to use in my code something like this: if (damage x > 0) then {//code }; But seems like it doesn't work like that, someone could explain? -
Damage hull and engine after x roadkills
Goro posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, everyone! Basically, what I want to do is to damage vehicle's chasis (hull) and engine after x roadkills (let's say the count will be 15). I want to prevent player from using it as a ramming device. If this is going to help you out somehow, the vehicle name would be SUV, and the enemy is OPFOR side. Thank you all in advance for replies! -
Detect name of player and select the box
bullkanox posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi, i need to know if i can detect what player is executing the script, and then depending of the name of the player send it to the box. thanks for support!!! _fnc_group = [["player_1", box_1], ["player_2", box_2]]; _fnc_select = (_fnc_group select 0) select 1; if (cash< 100) then { hint "no money to buy this!" } else { cash = cash - 100; _fnc_select addWeaponCargoGlobal ["rhs_weap_m4a1_blockII_bk", 1]; _fnc_select addMagazineCargoGlobal ["rhs_mag_30Rnd_556x45_Mk318_Stanag", 1]; hintSilent parseText format["<t color='#00FF3C'>thanks for for you buy</t>"]; }; -
Trigger script not working correctly in MP
Luckyas posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello everyone. I am trying to make a small minigames to play with my friends. The gamemode is pretty much the same as battle royal. A FFA arena where you have to kill everyone, and stay in the zone that is shrinking constantly. I got everything working now except for the triggers. My script is creating 2 triggers at the same place. The first trigger is getting activated when "ANY PLAYER" is "NOT PRESENT". It will then give you a hint that you should return to the zone in 10 seconds. The second trigger is getting activated when "ANY PLAYER" is "NOT PRESENT". It will then kill the player if he is out the zone and the "TIMEOUT" has reached 10 seconds. When testing this with my friend I found out that it is working correctly for me, but not for my friend. The triggers doesn't affect him. Could anyone please help me out? trg1 = createTrigger ["EmptyDetector", getMarkerPos "Marker1"]; trg1 setTriggerArea [500, 500, 0, false]; trg1 setTriggerActivation ["ANYPLAYER", "NOT PRESENT", true]; trg1 setTriggerStatements ["this", "hint 'You have 10 seconds to get back in the zone!'", "hint ''"]; trg1kill = createTrigger ["EmptyDetector", getMarkerPos "Marker1"]; trg1kill setTriggerArea [500, 500, 0, false]; trg1kill setTriggerTimeout [10, 10, 10, true]; trg1kill setTriggerActivation ["ANYPLAYER", "NOT PRESENT", true]; trg1kill setTriggerStatements ["this", "player setDamage 1", ""];- 35 replies