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


    • ARMA 3
    • DAYZ
    • ARMA 2
    • ARGO
    • YLANDS
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Die Hard OFP Lovers' Club's Topics
  • 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


PlayStation PSN














Found 216 results

  1. I am trying to set the players group to a separate group on side civilian when they are "dead" (alive on island) and then if revived have them rejoin their initial group on side east or west, but the initial group always returns grpNull deleteGroupWhenEmpty - Arguments and effects are global (wiki) ("initPlayerLocal" state) - - "initGroup" properly returns group at this point player setVariable ["initGroup", group player]; // Set the player group even when dead // Make sure group is not deleted when empty if (isGroupDeletedWhenEmpty (group player)) then { (group player) deleteGroupWhenEmpty false; }; (respawn event handler) - - "initGroup" returns grpNull (same result when 'player' is replaced with _unit or _corpse), as if it did not exist anymore params[["_unit", objNull], ["_corpse", objNull]]; if ((isNull _unit) || (isNull _corpse)) exitWith {}; // Set unit to civilian side _deadGroup = createGroup [civilian, false]; [_unit] joinSilent _deadGroup; // ... // Find inital group _initGroup = player getVariable["initGroup", grpNull]; // Set unit to initial group [_unit] joinSilent _initGroup; I simply want to be able to freely return the unit to and from his initial group
  2. Can someone please help me on the below: The script is working correctly bar one thing. When the marker is added to the map I want it to have in brackets (Marked by <playerName>) however currently it just adds "CAS Target (Marked by any)" Can someone explain why the name command is not returning the name of the player? I have in the Init box of the unit in the editor: nul = [this] execVM "scripts\add_markcastarget_action.sqf"; This is add_markcastarget_action.sqf _currentPlayer = _this select 0; _playerName = name _currentPlayer; sleep 10; fnc_addActionMP = { private["_object", "_screenMsg", "_scriptToCall"]; _object = _this select 0; _screenMsg = _this select 1; _scriptToCall = _this select 2; if(isNull _object) exitWith {}; _object addaction [_screenMsg,_scriptToCall]; }; [_currentPlayer, "<t color='#f20000'>" + "Mark CAS Target" + "</t>", { titleText ["Click to mark CAS Target location.", "PLAIN"]; openMap [true, false]; _attachedTo = (_this select 0); ["mk_cas", "onMapSingleClick", { titleText ["", "PLAIN"]; _markerName = "CASMARKER_" + (str _pos); _marker = createMarker [_markerName, _pos]; _marker setMarkerType "hd_destroy"; _marker setMarkerColor "ColorRed"; _marker setMarkerText format["CAS Target (Marked by %1)", _playerName]; ["mk_cas", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; true; }, [_attachedTo]] call BIS_fnc_addStackedEventHandler } ] remoteExec ["fnc_addActionMP"];
  3. Interesting problem I know. It probably is something quite simple but I can't figure it out. Now, I'm fairly new to scripting (about six months) so I'm not 100% sure what I should do. The basic premise is that the player has a UAV with an M136 launcher on it. The drone then fires that launcher. Got that part down. I've even got it so that the drone rearms when it goes back to "Home". Now, what I'd like to do is to have the players rearm it in the field. They can have a launcher on their back, bring the drone to them and then attach the launcher onto the drone. The drone has a new launcher and the player looses theirs. Here is the code that I have so far. I know that it must be very simple but any help is very much welcome in advance. For you're consideration, I'm using ACE, CBA, RHS (All four modules) and more quality of life mods. Nothing that would effect scripting in any way.
  4. Hello guys, I'm working on my own mission for multiplayer, actually on hostage rescue task. I've done triggers to make task accomplish when two insurgents are dead or failed if civs ( hostages ) are dead. Now I need your help. I need to solve out how to make hostages join group of player who saved them, maybe better by addAction in civs init and then leave player's group when hostages (civ1 and civ2) are present in trigger (base) I'm not much experienced with scripting, so I'm trying to make as much things as possible in editor by triggers. Still don't understand how to use scripts in sqf and sqs files. For example I did one action on laptop that spawn mk82 on given object ( this addaction "Blow off castle", "CastleBomb.sqf"; ) ( CastleBomb.sqf > CastleBomb01="Bo_Mk82" createVehicle (getPos CastleBomb01); ), that's only thing I understand in scripting, using these simple scripts. I can't use "if", "else", "then" and these things. Also if you could explain me how to make trigger if I want to make trigger triggered when three insurgents are dead. ( Actually I have done it by " !alive opf1 and !alive opf2 ", and I don't know how to make list of objects with combination of !alive ) So if anyone can help me: Civ1, Civ2 = Hostages Opf1, Opf2 = Insurgents Base = trigger ( triggered when hostages are present ) If you could explain me: Using multiple given objects with combination of !alive (I'd like to make for example "!alive civ1, civ2, civ3...." but not possible) How to make teleport action (on flag pole of OPFOR) hidden if BLUFOR is present in trigger around enemy weapon cache and then reveal if there's no BLUFOR anymore in trigger. ( Tried it by repeating trigger: Activation: "OPFORFlag removeAction 0;" Deactivation: "OPFORFlag addAction "Teleport to Weapon Cache 1", Teleport.sqf" but it worked one time and then it won't remove action but only adds action Using sqf or sqs and "if", "else", "then"... I think I could get it if you explain me some practical usage of these things. Thank you a lot!
  5. Hello, so i am trying to figure out the code behind checking whether or not an entire unit is dead Here is the code i tried but didn't have no success players = allPlayers; { if(side _x == west) then { //Exectute code for all dead. } } foreach _players allDead; can anyone help me?
  6. Hellow everybody. Can somebody advise how to make certain script: After killing 10 east faction units - spawn marker ONE, after killing 20 units - spawn marker TWO. Thanks. Ive tried this code, but it doesnt work properly (its repeating itself)
  7. _casSpawn = "B_RangeMaster_F" createUnit [_casPos, _casGroup]; So i have got the range master to spawn to the group civilian, I need to be able to use setDamage but i have nothing to assign the spawned range master to, there is no variable for the spawned ai, so I need your help to set damage and get a variable so I can also use other scripts on the spawned range master. felipe.
  8. Last content update: 6/10/2018 going through config files and getting details to sort what you want, using radius with addAction, params, and altering arrays with resize, pushBack, pushBackUnique, set, and append and going over to assist with resize count. Last content update: 5/27/2018 added GUI tutorial for how to make a weapon selector using cfgWeapon Last content update: 5/24/2018 added sector control tutorial Last content update: 5/21/2018 This is my arma 3 scripting tutorial series which is aimed to help both people getting into making their own scripts with fairly detailed simple tutorials as well as for the intermediate person looking to create their own features for their missions. The plans for this series is to almost fully cover everything behind the arma 3 missions that people play on a daily basis and have enough content provided in the videos where people can go off and make their own vision for their mission with the knowledge gained. Most of these videos are made on the fly at 1AM-4AM without any pretesting which should give someone the idea of what goes into finding syntax errors and narrowing down a bug that's causing your feature to not function properly. It is also an excuse for you to cut me some slack if you see mistakes :) . A lot of these tutorials are made with multiplayer in mind since I think most people want to play their missions online with their friends(which is why publicVariable has been utilized so much so new people can get a good grasp on the power those commands have). New videos are added to the playlist almost every day so if your stuck with something, maybe it has been covered in a video. If you have any requests on what you would like to see made then please suggest it here. topics covered so far Scripting tutorial playlist Database tutorials with INIDBI2 playlist GUI/Dialog tutorials playlist
  9. I am trying to make a script where I can teleport a whole unit "BLUFOR" or "OPFOR" which are players to a specific marker through an addAction. Here is my code, this links to an object, which is a flag pole. _players = allPlayers; { if(side _x == west) then { player SetPos getMarkerPos "marker1"; } } foreach _players; Can anyone help me fix my code so that it works?
  10. WORK IN PROGRESS https://www.youtube.com/watch?v=K6LDXK1URr8 I've decided to openly release a very basic version of iBuild for testing. The main reason for this is to test the underlying foundations and iron out any kinks before I start piling new features and content on top. It's very basic and rough, but it has enough content to give you an idea of where it's heading. The mod has evolved from the first conceptual prototype I put together, and I've lost count the amount of times I've started over, so I hope you guys enjoy what I've settled with. I'm still in the process of writing most of the documentation, which I suck at doing, but you can find what has been written so far organised into a drop-down menu under 'iBuild'. More info can be found in the description on Steam. >| Download Pre-Alpha |< About time! ;)
  11. Hey everyone, I've gone and created a pretty ambitious first mission with multiple paths depending on how effectively the player can assist ground forces. I've completed the mission but I want to refine one of my scripts. I've tried to educate myself as much as possible but I can't seem to find a tutorial/forum post for my specific problem. One of the objectives for the player to complete involves destroying reinforcements dropped off via helicopter. I had scripted the objective to be completed by killing the infantry and destroying their supporting gunship. However, I scripted it using specific names for each individual troop, ie !alive Heli_Troop1a && !alive Heli_Troop1b && !alive Heli_Troop2a etc etc. It was a brute force method to sort of get the effect I wanted and required specific units to be killed. I am looking for a way for each squad member to be counted, totaled, and compared against a desired value. I'm using 7 as that value as that is about 1/3 of all the troops. The script I have tried using in the trigger is: ({alive _x} count units Heli_Troops1 + Heli_Troops2 + Heli_Troops3) < 7 && !alive Heli_2 && triggerActivated Trig_Heli_Troops; The editor accepts the code but upon starting the mission I get an error message about a generic error in expression. I'm not sure what I'm doing wrong, but then again I barely know any real scripting beyond simple commands I can look up. I have also tried multiple different ways of writing the count units section of code including using && instead of + and separating each group name with (). None have worked. If anyone could help me out I'd greatly appreciate it. Edit: Disregard solved it! (({alive _x} count units Heli_Troops1) + ({alive _x} count units Heli_Troops2) + ({alive _x} count units Heli_Troops3)) < 7 && !alive Heli_2 && triggerActivated Trig_Heli_Troops; Still kind of a roundabout way I feel, but it works. Maybe this can help someone else.
  12. Hello at all who will read this at first, I am currently working on something called DCFDB a Dynamic campaign Framework for Arma 3. To keep things clear i will write some things about it. First of all there is no released Version right now so it is not avialble yet. The Target of it is to have a Dynamic Zeus Campaign with a saving function and other little extras for administrating the campaign. To achive this i am writting an Database in combination with extDB3. This Database should store the most if not all placable and doable things aswell as states. I started at some point to play Milsim Missions with Zeus and thought that it is somewhat sad that there is nothing really to safe the progress. Better said i am targeting a normal Arma 3 campaign as Zeus Campaign with the use of the Creativity from Community of Arma 3. Well with that said now i get to my problem: I am working right now to make it possible to use the Editor for the campaign that you aren't Limited to only Zeus. So i wanted to use the ID of the Mission.sqm to check if it is a Editor Object and later maybe call it by that or assign paralell a Id from the Database. The id of Item 59 ("I_Truck_02_box_F") would be the 409. Right now with the Knowledge i have i can get this variable by using: https://community.bistudio.com/wiki/get3DENEntityID But this is limited to the Eden Editor right now. I ask myself is there a way to get this exact Value in the mission while the Object "I_Truck_02_box_F" is selected with as an example: cursorobject. I already thought of another sollution of this by first calling all placed objects and extracting the ID in the middle of following: 13b57c080# 1675124: truck_02_box_f.p3d by using _editorID = str _vehicle splitstring ": " select 1; this gives me the 1675124 of the whole thing. I thought this number would be my solution but then i got informed that those numbers can change because of terrain modification like one tree more or less. So i can't use that. Now is the Question is there any other solution to get this ID or something which is also unique and won't change? Just as information NetID changes. Another thing i tried is to include the MissionSQM in the description.ext and work the parts out: class MissionSQM { #include "mission.sqm" }; and call it through: getNumber (missionConfigFile >> "MissionSQM" >> "version"); [this is not the path just as information this is just an example] but there is another problem i can't order the ITEM Class to the object if there is variable itself which it does not need everytime. class Attributes { name="beta_4"; } Without the name Attribut i can't order it corectly to the unit. Position is a bad option since those can change. The funny thing is i can call the object mentioned before with this script so this is why i tried the splitstring Part: [0,0,0] nearestObject 1675124; So i am with my knowledge at the End and wanted to ask if someone knows a command for declaring an unique ID which won't change and are passed on from the Editor. I searched the Internet up and down asked question in the Arma 3 scripting Discord channel. I think also you were able once to read out the 1675124 id with a command but this was discontinued due to the terrain change problems. Now the editor objects get their own ids which was once wanted but this can't be used in the Mission. I am at the point where i don't know what to do now. Maybe some of you has some answers. Would be glad.
  13. Hey folks, I'm a noob when it comes to scripting so please excuse my ignorance. To my understanding typetext & typetext2 are global events. The reason why I ask is because I want to be able to play out text to a player's client when they respawn in but not to the other clients on the server at the same time. Let me elaborate. Example: Player One dies in the field then respawns. Once he spawns only he sees the typetext2 notifying him of his location, but the other members of his squad out in the field don't see the typetext2 Player One sees. The idea is I want to avoid spamming players with type text each time a player is killed and respawns. Right now this is what I have in my OnPlayerRespawn.sqf //Loadout Previous kit saved from OnPlayerKilled.sqf removeAllWeapons player; removeGoggles player; removeHeadgear player; removeVest player; removeUniform player; removeAllAssignedItems player; clearAllItemsFromBackpack player; removeBackpack player; player setUnitLoadout(player getVariable["Saved_Loadout",[]]); // [ [ ["TAVANAKA AIRBASE,","align = 'center' = '1' size = '0.7' font='PuristaBold'"], ["TANOA","align = 'center' = '1' size = '0.7'","#aaaaaa"], ["","<br/>"], ["CHARLIE COMPANY OPERATIONS CENTER","align = 'center' = '1' size = '1.0'"] ] ] spawn BIS_fnc_typeText2; This works well and good but inevitably causes the aforementioned spamming when multiple players need to respawn. I looked at other work arounds like delaying the text from triggering again after say 300 seconds but I'm not entirely sure how to implement that, again I'm a bit of a noob but slowly learning. I hope I made my case clear and look forward to any guidance you guys can offer. Thanks!
  14. Next to already revealed an known https://community.bistudio.com/wiki/Category:Arma_3:_New_Scripting_Commands_List There are more script commands now :) + fixed http://feedback.arma3.com/view.php?id=12324 + only discussion related to new or changed Arma 3 Beta/Dev Scripting allowed
  15. So as the title states I'm curious what you all think about efficiency/optimizations when it comes to writing a lengthy script/mod for a mission. My current scripted mod is AC-C4I (Air Craft Command, Contol, Computers, Communications, & Intelligence). It has to do with sensors and targeting. The scripts have a lot of "waitUntil" commands for locking the targeting camera to screenToWorld amongst other functions. What would be the most efficient way to write this/integrate it into a mission. I can write the whole thing in one file and "call compile preprocessFileLineNumbers" on init. I can create a CfgFunctions.hpp and add it to the description.ext, or I could make it an FSM. I'd love to hear from you guys. Thanks.
  16. G'day guys, There has been a lot of new threads by newcomers that ask the same/similar questions, found in many other threads. If you are new to ArmA or want to get into scripting, welcome to the forums! :) As you know, there is a search box at the top of the page, it can be used to search throughout every thread what you are after. Bear in mind that it may sometimes not provide you with the proper answer. This, however, doesn't mean that another thread should be opened. In fact, there is a huge library of scripts you probably never heard of. Check it out, there is an abundant of examples provided in each script command: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 It is constantly being updated with new facts, info and scripts by many of our users such as KK. (Killzone Kid) Lastly, here are some basic info and tips on scripting. To create your own scripts, navigate to "My Documents\Arma 3\missions\your_saved_mission". Then, create a text document and rename the extension ".txt" to ".sqf". Once done, open it with Notepad or Notepad++. To run your script in the game, navigate to your mission folder and create a "init.sqf". Open it and put this in: [] execVM "myscript.sqf"; If you want to get a specific unit to do some action (e.g. setDamage or setFuel), give your unit a name but without spaces. Then in a trigger, put this in: myguy setDamage 1; The symbol ";" used after each command, is to separate the command from another. (Think of it as a period symbol)Also, if you are thinking that Steam Workshop is the only place for mods, addons, scripts, etc. Armaholic is the official site for releasing such. You can find it here, they also have a FAQ as well: http://www.armaholic.com If you want to convert a string to code, you can use call compile STRING. This is very handy (and sometimes a smart trick) when passing code around such as lbData. ;) This wraps up the introduction for those new to scripting. If you have any questions, concerns or ideas that may improve this thread, feel free to post here. ^_^ Happy Scripting, ;) Rawner135 ArmA 3 Tutorial Links: Arma 3 Scripting Tutorial For Noobs - forums.bistudio.com [Tutorial] Server Side Scripting - forums.bistudio.com Camera Scripting - www.armaholic.com KK's blog - ArmA Scripting Videos: Modding Tutorials by GameDev Byrne: https://www.youtube.com/playlist?list=PLqRU_EL4pwOHOJ6L2P5XlpfmNoWqulZqf Other Tutorial Links: http://www.kylania.com/ex/ Conversation System Mission Editor ArmA 2 Mission Editor Triggers OFPEC ArmA 2 Scripting Commands ArmA2 COMREF Forums Post - Classnames ArmA2 Library ArmAholic ArmA2 Moves ArmA2 Modules Description.ext Scripting Topics (Check All Links) Startup Parameters Crash Files Tasks ARMA 2 Functions PostProcess Effects
  17. I have a Minefield use'ing the A3 mine Module, but I have now idea to make a trigger fire when all the mines are deactivated. I know it needs to be something like this... if allMines are Active then don't activate... or something like that. My scripting is still very rough so I am just lost on where to start to get that to where I want it.
  18. Hi guys, I'm making a SP mission with quite a few cutscenes. In these scenes I'm using code like this: cutText ["", "BLACK FADED", 7]; [0,0,false] spawn BIS_fnc_cinemaBorder; sleep 2; Colonel playmove "Acts_B_hub01_briefing"; titleCut ["", "BLACK IN", 10]; sleep 4; player KbAddTopic ["introduction","texts.bikb","",""]; Colonel KbAddTopic ["introduction","texts.bikb","",""]; Colonel kbTell [player, "introduction", "speech2"]; hint "Listen carefully!"; sleep 55; [1,1,false] spawn BIS_fnc_cinemaBorder; combined with text.bikb it allows me to achieve: a cutscene with cinematic borders; fully voiced character with lipsync and animation; player can't move during scene. The issues I have: player still can use his weapon during the cutscene; I can't set other units in player's team to gather around him. like they're listening to briefing. Situation #2 I'm making an interrogation scene. Using this piece of code cutText ["", "BLACK FADED", 5]; [0,0,false] spawn BIS_fnc_cinemaBorder; Zhyrandole switchMove "Acts_ExecutionVictim_Loop"; sleep 5; titleCut ["", "BLACK IN", 10]; sleep 5; player switchMove "Acts_Executioner_Backhand"; Zhyrandole switchMove "Acts_ExecutionVictim_Backhand"; sleep 5; Zhyrandole switchmove "Acts_ExecutionVictim_Loop"; player KbAddTopic ["introduction","text2.bikb","",""]; Zhyrandole KbAddTopic ["introduction","text2.bikb","",""]; Zhyrandole kbTell [player, "introduction", "zhyrandole"]; hint "Listen carefully!"; sleep 5; player playMoveNow "AidlPercMstpSlowWrflDnon_G01"; sleep 15; [1,1,false] spawn BIS_fnc_cinemaBorder; it allows me to achieve: interrogated unit is on his knees; animation of hitting + reacting of both player and interrogated unit; interrogated unit spills information. The issues I have: Interrogated unit turns arround randomly, not facing player; player's transition to idle animation makes him draw his weapons(main and secondary); I can't set other units in player's team to gather around him. like they're taking part in the process. Will appreciate any help.
  19. I'm making a mission in which you control the camera of the MQ-4A-Greyhawk drone. It's flying at about 1000m altitude above an enemy base. You are supposed to identify a certain target and call a strike. The problem is the AI keeps spotting the drone, but I don't want them to do that. So what can I do to change that? I have tried editing with the advanced Eden mod, but I don't think it has the needed features. Ty :) Edit: more details on the symptoms (idk, maybe it's important). When the drone arrives you can see two patrols and some stationary dudes (more arrive by truck later). After some time they start looking up into the air in the direction of the drone (This is what I interpret as them spotting the drone). A little while later they break patrol and crouch/go prone while still looking in the direction of the drone, but From what I can tell, they never shoot at it though.
  20. Hi everyone, I am stuck on somethan. I'm making a mission in a pre defined area where a player can spawn ai via a addAction. My issue right now is, the player can spawn the mission over and over. That by itself will cause a lot of problems. Others might have a better idea on how to go about this but I thought it would be a good idea before the script spawns the mission it would check to see if there are any OPFOR Units Alive within the marker or a trigger area if there is the mission will not spawn, if there is'nt then the mission will spawn. I don't know how to successfully make a check for opfor units (not players, just AI). Any help would be very much appreciated thank you.
  21. Hello, is their anyone out there can help me with a script i'm setting up for a custom mission i'm making. I've been building a civilian story mission, and what i'm trying to do is block any player from getting ammunition from any AI that die, especially in the staged fire fights between opposing units. I've done my research and I just about understand the addMissionEventHandler and setting up required parameters and thanks to a Loot Stop script on here about the removeAllWeapons command which removes all weapons and magazines on the unit. However that removes the entire units inventory, when i would like players to still be able to pick up smoke grenades and medical equipment (I use ace, so no first aid kits), Is there a scripting command i'm missing, that will allow me to remove the specific primary weapon type ammo, from the units inventory on death, thus leaving the units primary weapon unloaded and no ammo available to pickup or will i need to use an item array, or add back in items to the units inventory if forced to use removeAllWeapons?
  22. Hello, I've been messing around with trying to make a simple firing range script that when activated puts the popup targets in down position. Then every let's say two seconds pops up a target, if not hit pop down and randomly select another target and repeat. If a target is hit have a counter count how many targets the player has hit then display at the end. This seems pretty straight forward but as I am new I am unable to successfully do this by myself. If anyone could help me make this I would be very appreciateive, thank you. I know there are a few other firing range scripts out there, I have tried a few such as moss targets and it is really nice, I am just looking to make my own simple one. score start at 0 count how many hits tgt1, tgt2 for knowing which targets to connect to.
  23. Hey guys, I want to create a Battle Royale Style PvP Mission for me and my friends. I want the mission to end when there is only one player left. If possible it should show the mission completed screen. My problem is that i have no idea how to script it. Ive tried googling but i couldnt find anything usefull. I hope you can help me. Vecto1511
  24. hello my Name is Ehab and I am looking for someone how can make or already have a good mission for arma 3 altis life that i can buy it i dont want any realssed old mission or somthing like that Its doesnot need to be the best mission but I want it to be good if you have what i want i can pay for the file I need the life server the sql datebase the mpmission file thank you please replay me soon
  25. Hi everyone, I'm trying to make a script that allows you to cancel a mission by clicking on a text that says CANCEL in the description of the task. Script: _descript1 = "<execute expression=' [1] call compilefinal preprocessFileLineNumbers'DMG\functions\fn_CancelM.sqf' '>CANCEL</execute>"; And then in the task: [blufor, ["Tarea_"+_IDTarea], [_descript1,_titulo,_marker], _posicion, true, 1, true] call BIS_fnc_taskCreate; If I put it in this way the result is that nothing comes out. Thanks for your help Spyke is my first post in this forum, if I do not have to say it here please tell me. I found it here: