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
    • 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
  • 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
  • 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

XBOX Live


PlayStation PSN


Origin


PlayFire


SoundCloud


Pinterest


Reddit


Twitch.Tv


Ustream.Tv


Duxter


Instagram


Location


Interests


Interests


Occupation

Found 244 results

  1. 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
  2. So I'm not sure if this has been asked or what but from searching i haven't found it yet. So here is my question is it possible to add the animation/movement controls of a infantry and apply it to a vehicle like for instance; infantry gets into vehicle and said vehicle is basically a super sized infantry. The reason i ask is because i would like to add mechs/mech-type vehicles and i under stand the basics of coding from some other projects i have worked on for fun. I just kinda wonder/hoping that you would be able to apply the Infantry game controller to a vehicle profile so that it can have Armor/components that can be destroyed and repaired.
  3. Hey guys, the title pretty much says it all. I have a pretty heavy amount on mission making under my belt and this is a question I have wondered for quite some time. On many of my missions I have a "recruiter" NPC that has addaction commands to recruit a variety of friendly infantry units to join the player squad. I'd love to have a way to set a "cost" for this function based on the players score (say 10 kills to recruit an AI squadmate). I am aware of the "Set Cost" module for zeus but I dont think that can be used in this way. I know that such things are possible with heavy scripting (thinking about the DUWS mods) , wondering if anyone has any semi straightforward solutions to this...
  4. Hi there people, Is there a way to make a static artillery emplacement such as a mortar have an infinite range across an entire map via a script? I don't like using the virtual combat support modules as I like to hear/see the artillery being fired from a base camp far from the front lines. I've used the ALiVE mod and MCC forward observer artillery interface before however these both still require the artillery gun to be in range. I don't want to have to move Artillery vehicles across the map to get within range ya see. Thanks in advance, - Jack
  5. Hi there people, Is there a way to make a static artillery emplacement such as a mortar have an infinite range across an entire map via a script? I don't like using the virtual combat support modules as I like to hear/see the artillery being fired from a base camp far from the front lines. I've used the ALiVE mod and MCC forward observer artillery interface before however these both still require the artillery gun to be in range. I don't want to have to move Artillery vehicles across the map to get within range ya see. Thanks in advance, - Jack
  6. I have recently encountered some odd behavior in one of my scripts. I thought I had a pretty good grasp of this command but it has stopped behaving in the usual way. consider the following: {_x setUnitPos "UP"}forEach units group squad1; In the past and indeed up until a few minutes ago in my script, this yielded the expected behaviour of each member of squad 1 standing up. Then I got a typerror . Type group, expected object. So then I removed the word group from the command: {_x setUnitPos"UP"}forEach units squad1; And NOW it works again. Does anyone know what is going on with this? Thanks for the help.
  7. Intercept is a C/C++ binding interface to the Arma 3 engine (internally referred to as the Real Virtuality or RV engine). It's goal is to provide easy to use library for addon makers to develop addons in a native language, or to develop language extensions for the Arma 3 engine. In a nutshell, Intercept provides a full C/C++ binding system for calling the base C++ functions which are declared in RVEngine for SQF functions. All SQF functions within the RVEngine are actually native code, which is called by SQF via the function names. Intercept bypasses SQF entirely, allowing native C++ plugins to seamlessly interact with the game engine. In essence, Intercept allows for expansions of the game engine, calling internal functionality of the engine which has been exposed via SQF functions. This was the idea behind the intended Java implementation by Bohemia Interactive in Take On Helicopters and was planned for, but never implemented in Arma 3. Intercept not only completes the intended functionality of what Java was meant to provide but has gone much further, including returning data to SQF and multithreaded addons. Intercept works on a host/client based system, in which the host, Intercept itself, hosts client DLLs that implement the Intercept library. The Intercept host handles access to the RV engine by clients through a layer that provides thread concurrency, memory handling, and event dispatching. Client DLLs are then able to be written in a way that can safely ignore most internal nuances of handling data in the RV engine and work with standard C++ STD/STL data types, and only a few specialized objects specific to the game engine. The Intercept library also provides raw C bindings to the C++ versions of SQF functions, so it is entirely possible to use Intercept as the basis for writing in additional scripting languages to the RV engine, such as Python or Lua. You can find more information on our GitHub project page. Technical Details Intercept works by making direct calls to the SQF functions in the RV engine. These functions are themselves C++ functions which are then exposed to SQF for allowing interaction with the underlying game engine; Intercept completely bypasses SQF and allows C++ plugins to interact with the engine directly. User created threads can even be created and by properly using the provided thread concurrency functionality it is possible to execute game functionality safely and concurrently. Intercept clients are able to invoke through the host these commands by provided wrapper functions that replicate and emulate the SQF command namespace (minus some unneeded functionality, like arrays or control structures). These wrapper functions take standard inputs, such as simple primitives like float or bool, and standard std::string arguments and convert them into the proper SQF command variables, providing a seamless layer to the clients. An example of a very simple client that invokes nular, unary, and binary SQF functions (aka functions that take no arguments, a right side argument only, and both a left and right side argument respectively) is demonstrated below and a more examples can be found here. #include <Windows.h> #include <stdio.h> #include <cstdint> #include <sstream> // the Intercept library, only one include required. #include "intercept.hpp" // required exported function to return API version int __cdecl intercept::api_version() { return 1; } // This function is exported and is called by the host each frame. void __cdecl intercept::on_frame() { // get the player object and store it intercept::types::object player = intercept::sqf::player(); // get the post of the player intercept::types::vector3 pos = intercept::sqf::get_pos(player); // build a string... std::stringstream side_chat_msg; side_chat_msg << "Hello Arma World, here is the player pos: " << pos.x << "," << pos.y << "," << pos.z; // send it to the binary SQF sideChat command intercept::sqf::side_chat(player, side_chat_msg.str()); } // Normal Windows DLL junk... BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } Completion Status As of now (3/13/16) Intercept is over 82% language feature complete. You can view the progress of wrapper completion here. Almost all normally used SQF functions are available to the end user, and with the added ability of writing inline SQF code, you can call any function that has not had a wrapper written for it yet (though with a small performance penalty). We will post a release thread when we start releasing builds of the host. Contributions Feel free to contribute as much as you want to this project in terms of time and code. The goal of this project is to be a tool for the community to provide better performing and more complex addons for the Arma 3 platform. If you would like to contribute or want more information please join our Slack channels and get involved! License Intercept is licensed under the MIT license. You can find the full license in the LICENSE file. Prior to commit f9fe4d5 the project was licensed under the GNU/GPL v2 license and continues to be for any commit prior to that.
  8. I have searched both google and the forums for this and see a couple answers to this question that do not make sense to me. I have a couple different firing ranges for my unit that are run via script. They work correctly in both hosted and on the dedi with one small exception. The rangemaster - which is a recording of one of our members played in the script - only executes on the player that activated the firing range, even though the range itself is working for every player on the server. I am 100% sure that it is a locality issue, as the addAction that calls the sqf is located in the init.sqf of the mission. I keep finding answers that have things like this: [Computadora1, ['Disparar a Barco',{<your code here>}] ] remoteExec ["addAction",0,true]; But I do not understand exactly what it all means as most people just provide a script and not an explanation of why it fixes the issues. My question is: how do I execute the addAction in game via remoteExec so that all players can both see the range and hear the rangemaster? Below is a snippet of my range code that involves the recordings - just to ensure that I haven't made a boneheaded error. init.sqf range4.sqf (partial) Thank you all in advance for the help!
  9. Voronoi diagram using Fortune's algorithm Here's a set of functions developed for my current project to generate Voronoi diagrams in SQF without the need for addons. What does it do? The code generates the edges of the Voronoi diagram from a given set of sites (positions). If you do not yet know what a Voronoi diagram is or what it's uses are check out https://en.wikipedia.org/wiki/Voronoi_diagram. Example: Using the Altis towns as sites How do I use it? Installation: Download the example mission to get the code. Copy the voronoi folder to your mission. In your missions CfgFunctions class include "voronoi\cfgfunctions.ext" like so: class CfgFunctions { #include "voronoi\cfgfunctions.ext" }; Execution: The only included function you will need to call is VOR_fnc_getEdges: private _edges = [_sites, _width, _height] call VOR_fnc_getEdges; VOR_fnc_getEdges takes an array of sites (position2Ds), and width and height in meters for the area to scan. All sites must be inside the rectangle [0,0] and [width, height]. The function returns an array of edges that constitute the Voronoi diagram. Each edge is an array composed of: [ EDGE_START, - Start position EDGE_END, - End position EDGE_LEFT, - Site on the left EDGE_RIGHT, - Site on the right EDGE_NEIGHBOUR, - Internal usage EDGE_LINE_F, - f in the function for the edge's line: y = fx + g EDGE_LINE_G, - g in the function for the edge's line: y = fx + g EDGE_DIRECTION - 2-dimensional direction vector of the ray going from start to end, not normalized. ] Where do I get it? Link (voronoi_example.Altis.zip) Examples Known issues In some cases some edges may not find an intersection and only intersect with the bounding box. I haven't managed to isolate the issue yet but it seems to be a precision error in the intersection check. Suggestions are welcome. It's slow. For 50 sites a call in-mission takes about ~0.5 seconds which is very slow compared to good c++ code. Not entirely sure yet if it's because of my implementation or just SQF having a hard time with the complexity. In my in-mission testing 50 sites took about 0.5 seconds in an unscheduled environment and in scheduled took 1-2.5 seconds. During mission init the code is significantly faster, clocking in 150 sites in about 0.5 seconds. I can put this down partly to the way I handle data but not sure how much quicker I could make it. If anyone has the energy to dissect the code I'd love hear your input. Feedback Constructive feedback is always welcome. I've probably missed cases where the code will break. If you're reporting a bug please if possible also submit the following: The complete set of sites passed. Height and width passed.
  10. Hi fellow scripters, Initially we had hoped to release the major upgrade to our scripting technology with Patch 1.03, but we were not able to get it fully implemented in time. Therefore we're pushing the ability to use Java to the next patch Java is available since beta patch rev. 89707 (documentation) Why is this awesomeâ„¢? Using a widespread, proven and robust language with loads of documentation and tutorials. Using IDEs such as NetBeans and Eclipse for development and debugging. Using Object-Oriented programming architecture and design. Using generally much higher performance script execution. Using many standard Java libraries instead of reinventing the wheel. Note: this will not replace SQF scripting, so the transition should be smooth.
  11. I have run into a fairly frustrating problem involving AI helicopter pilots and squads attempting to board helicopters. The situation is as follows: I have a helicopter with its engine on waiting on the ground. Then, I order my squad members to board that helicopter, but as soon as I do the helicopter takes off, goes to about fifty meters, and then lands again to allow my squad members to enter. This also occurs with editor-based waypoints. As soon as an AI squad activates a 'Get In' waypoint, the AI flying the helicopter shoots up into the air and then lands again. Is there any way to force the AI helicopter to not do this, and stay on the ground instead? I have tried everything from synchronizing load and get-in waypoints (with a condition to wait for the units to get in), using disableAI "ALL", disabling the simulation of the helicopter's pilot, placing an invisible helipad directly under the helicopter, etc., but nothing works. Note that it is necessary for the helicopter's engine to be on to achieve the necessary effect as this takes place during a cutscene. Any suggestions would be greatly appreciated.
  12. 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
  13. I am just curious on how you might actually use the position command to find the position of a location of one of the major towns such as Athira or Sofia, clearly the locations are marked out somewhere because the editor already has a list of locations and 3D markers placed. I simply could not find a way to do this, so I've come to the people of the forums to save me. Just to be clear, I don't want to find the location of the nearest town based on an object or a marker, just if it is possible from the built in game locations Thank you, Pizza Man
  14. I´m having an idea. In Arma (in game) i wanna make a tablet, and with this tablet i could take a picture, view it, and send to another unit that are in possesion of a similar tablet. Problem is, i only have a little coding experience in pyhton, so i'm shooting from the hib in reguards to the execution of this project. I'm thinking this would be possible by making a script that can take a picture in-game, Convert said picture to pbo, Store it in your profile folder, And finally transfer this through the in-game connection to the intended unit(player) with similar tablet and store picture in his local system thereby making it accessable to him. Q: Is it possible to import pbo's while in-game? Q: Is it even possible to transer information like pictures while in-game?? Q: Does this sound plain stupid???
  15. Gentlemen, I am looking for a way to pull one array each for Uniforms, vests, backpacks, headgear and so on from configfile, similar to below example for weapons. I would like to pull all equipment items, and then pick out all uniforms or vests or.... (whatever group of items that I want to make an array for) by filtering it by the "parent" name. (eg, below example "if "rifle" in _parents) Now I tried to find the correct parents in config viewer by placing an uniform in eden editor and then rightclick + show in config viewer, but i think i get the wrong parents there (maybe just the vehicle for the placed uniform / "groundweaponholder"?) Anyway none of the parents work and i wonder where i am going the wrong way. For backpacks for example, I selected a backpack from the cfg vehicle list in the config viewer and found the parent "Bag_Base" (or something like that) and it would return an array of backpacks, however, many of the backpacks would contain items. Is there a way to avoid this? In the end I only want each array to contain empty vests/uniforms/backpacks. I think my problem is that I use the wrong method to search for an example classname in config viewer and therefore it provides me with wrong parents. I would appreciate any help or guidance in that respect;) Thanks VD
  16. Hi. Anyone know how to make these animated/clickable markers on the map..? Like in arma 2 warfare for example where you select respawn location. I don't know where to start with it Never dealt with it before
  17. Okay, so i'm trying to get drawIcon3D to work the same way as the code below, however this only shows the units drawicon3d if the player's eyes are in view of the unit. I would like for it to be in the view of the players camera (internal or external) rather than the eye position of the player, thanks in advance to anyone willing to help me as it has been annoying me for a long time. if (!(lineIntersects [eyePos vehicle cameraOn, eyePos _unit, vehicle cameraOn, _unit]) && isNull objectParent _unit) then { drawIcon3D['', _colour, _pos, 0, 1.0, 0, _name, 1, 0.0345, "RobotoCondensed", "center", false]; };
  18. Hey, all. Just wrote this event handler script the other day, and I hope to eventually implement it into a multiplayer mission. Now, I want the event handler to assign to all players on the server, so I thought I'd just create a forEach loop with the allPlayers array. The problem is, when I make reference to the _z variable within the loop it seems to mess with the commands and produce all kinds of compiling errors. As a bit of a run down, the event handler activates when the player fires their weapon. If there is a civilian in a vehicle, within 20 meters, who possesses a detonator, as well as an explosive device attached to his car, there will be a 75% chance they will detonate it. In addition, if there is a civilian driver within 50 meters, who merely carries a gun, he will be assigned to an enemy side and made enemy to the player. Now, the obvious issue is, throughout the code, the variable "player" is used, and from what I understand, it is no recommended to use it in multiplayer, hence the "forEach allPlayers" loop. Now, I thought it was merely a matter of substituting the player variable with _z, which represents a player from the allPlayers array. However, like mentioned above, it seems to cause quite a long list of errors. To be clear, the code as depicted below works flawlessly in the editor environment. Here is the code: { // All Players _z = _x; _z addEventHandler["Fired",{ _obTemp = nearestObjects [player, ["Car"], 50]; _manTemp = nearestObjects [player, ["Man"], 50]; { // All vehicles in a 50 meter radius of the player _y = _x; _hasWeap = false; if (! isnull (driver _y)) then { if ("ACE_M26_Clacker" in items driver _y && count (attachedObjects _y) > 0) then { if ((random 100) > 25 && (player distance _y < 20)) then { [(attachedObjects _y select 0), 1] call ace_explosives_fnc_scriptedExplosive; }; }; }; { // The occupants of the aforementioned vehicles _w = _x; { // The weapons of the aforementioned occupants if (_x != "" && side (driver _y) == civilian) then {_hasWeap = true}; [east, "HQ"] sideChat format ["%1", _x != ""]; } forEach weapons _w; } forEach crew _y; if (_hasWeap) then { _agGroup = createGroup (selectRandom [WEST, INDEPENDENT]); crew _y joinSilent _agGroup; { // Members of the new hostile group _x enableAI "ALL"; } forEach units _agGroup; _agGroup leaveVehicle _y; }; } forEach _ObTemp; { // All AI units in a 50 meter radius of the player _y = _x; _hasWeap = false; _unitAr = []; { // The weapons of the aforementioned AI if (side _y == civilian && _x != "") then {_hasWeap = true}; } forEach weapons _y; if (_hasWeap) then { _x enableAI "ALL"; _unitAr = _unitAr + [_y] }; } forEach _manTemp; _agGroup = createGroup (selectRandom [WEST, INDEPENDENT]); _unitAr joinSilent _agGroup; }]; } forEach allPlayers; Fair warning: I know nearly nothing about all of the multiplayer scripting quirks (and am only a beginner at programming in general), and have very little knowledge on what should be executed on solely the server, or what should be executed globally, or what should be executed by the clients, etc.. So, and pointers are more than welcome. at this point, I just need to know if I am barking up the right or wrong tree with how I am doing things.
  19. Hello, To start off I'm new to scripting and just starting dabbling in it. I'm currently making a basic script as I'm learning and it's going around finding boxes and every time you find one it adds it to the total of found boxes. I've got my box script which is this: I've got it repeating for all the boxes that I've got and I'm just not sure how to include a count when you interact with the box and I've had a google and just can't find anything. I'll also got the start to the counting script but it's not really much at this stage: I hope that someone knows how to solve this and I'm currently going through Fockers Arma Scripting PDF and KK's arma scripting blog.
  20. I get this error everytime the game starts up & when a mission is being startup. But only if i own the apex dlc! https://steamuserimages-a.akamaihd.net/ugc/964224088525703614/C8AB26D25C26A6AE7CF500F5286D1056D72CDCD7/ I have put disableSerialization in every of the 3 script files but it doesnt work either. Then i just moved every control over to uinamespace but it still is the same. What did i overlook? The script works anyway but the warning message is annoying for every subscriber ofcourse. Heres the workshop btw. The first script/function is loaded from the config: class initCompass {postInit = 1;}; here is initCompass sqf disableSerialization; waitUntil {!isNull player}; UGTX_needCompass = true; UGTX_toggle = true; UGTX_posTop = true; UGTX_imgCompImg = "\MyProject\compass\imgs\default-sfp.paa"; UGTX_imgScrollLock = "\MyProject\compass\imgs\key-scrolllock.paa"; UGTX_imgEnd = "\MyProject\compass\imgs\key-end.paa"; UGTX_imgPgUp = "\MyProject\compass\imgs\key-pageup.paa"; [] spawn { disableSerialization; while {true} do { waitUntil { UGTX_toggle && (!UGTX_needCompass OR (UGTX_needCompass && ("ItemCompass" in (assignedItems Player)))) }; _compassInit = [] spawn UGTX_fnc_showCompass; waitUntil { !UGTX_toggle OR (UGTX_needCompass && !("ItemCompass" in (assignedItems Player))) }; ["864", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; GTX_ctrlGrp = uiNamespace getVariable "GTX_ctrlGrp"; GTX_compNeed = uiNamespace getVariable "GTX_compNeed"; GTX_grpBg = uiNamespace getVariable "GTX_grpBg"; ctrlDelete GTX_ctrlGrp; ctrlDelete GTX_compNeed; ctrlDelete GTX_grpBg; };}; GTX_ctrlGrp = uiNamespace getVariable "GTX_ctrlGrp"; GTX_compNeed = uiNamespace getVariable "GTX_compNeed"; GTX_grpBg = uiNamespace getVariable "GTX_grpBg"; UGTX_fnc_keyDown = { switch (_this select 1) do { case 70: { UGTX_shift = true; _title = "<t color='#fbfbfb' size='1.3' shadow='1' font='PuristaSemiBold' shadowColor='#000000' align='center'>VoyagerCompass Lite</t><br/><br/><br/>"; _text = "<img image='"+ UGTX_imgScrollLock +"' size='2' /> + <img image='"+ UGTX_imgEnd +"' size='2'/> Toggle Compass<br/><br/>"; _text2 = "<img image='"+ UGTX_imgScrollLock +"' size='2'/> + <img image='"+ UGTX_imgPgUp +"' size='2'/> Toggle Position<br/><br/>"; _needcomp = ""; if (UGTX_needCompass) then { _needcomp = "Compass in inventory required!"; }; hint parseText ( _title + _text + _text2 + _needcomp); }; case 207: { if (UGTX_shift) then { if (UGTX_toggle) then { UGTX_toggle = false; }else{ UGTX_toggle = true; };};}; case 201: { if (UGTX_shift) then { if (UGTX_posTop) then { { _x ctrlSetPosition [(ctrlPosition _x) select 0, 0.93 * safezoneH + safezoneY, (ctrlPosition _x) select 2, (ctrlPosition _x) select 3]; _x ctrlCommit 0.1; } forEach [uiNamespace getVariable "GTX_ctrlGrp", uiNamespace getVariable "GTX_compNeed", uiNamespace getVariable "GTX_grpBg"]; UGTX_posTop = false; }else{ { _x ctrlSetPosition [(ctrlPosition _x) select 0, 0.01111 * safezoneH + safezoneY, (ctrlPosition _x) select 2, (ctrlPosition _x) select 3]; _x ctrlCommit 0.1; } forEach [uiNamespace getVariable "GTX_ctrlGrp", uiNamespace getVariable "GTX_compNeed", uiNamespace getVariable "GTX_grpBg"]; UGTX_posTop = true; };};};};}; UGTX_fnc_keyUp = { switch (_this select 1) do { case 70: { UGTX_shift = false; };};}; waituntil {!isnull (finddisplay 46)}; disableSerialization; (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call UGTX_fnc_keyDown;false;"];//["KeyDown", "hint str _this"]; (findDisplay 46) displayAddEventHandler ["KeyUp","_this call UGTX_fnc_keyUp;false;"]; systemChat "@VoyagerCompass-Lite 2.2 Addon:: Press [SCROLL LOCK] Key."; here is showCompass sqf disableSerialization; _comp = [] call UGTX_fnc_compileCompass; GTX_compImg = uiNamespace getVariable "GTX_compImg"; ["864", "onEachFrame",{ _sPos = screenToWorld [0.5,0.5]; _pPos = getPos player; _dir = (((((_sPos select 0) - (_pPos select 0)) atan2 ((_sPos select 1) - (_pPos select 1))) + 360) % 360)/100; _stripe = 0.96 * safezoneW; _calc = ((_stripe/570) * _dir)* 100 + (_stripe/570) * 45; GTX_compImg ctrlSetPosition [_calc - _calc*2,-0.01,_stripe,1.8 * safezoneH]; GTX_compImg ctrlSetText UGTX_imgCompImg; GTX_compImg ctrlCommit 0; }] call BIS_fnc_addStackedEventHandler; and the last one is compileCompass sqf disableSerialization; ("compassTitle" call BIS_fnc_rscLayer) cutRsc ["RscTitleDisplayEmpty", "PLAIN", -1, false]; with uiNamespace do { disableSerialization; _display = uiNamespace getVariable "RscTitleDisplayEmpty"; GTX_ctrlGrp = _display ctrlCreate ["RscControlsGroup", 7634]; GTX_ctrlGrp ctrlSetPosition [0.4 * safezoneW + safezoneX,0.01111 * safezoneH + safezoneY,0.2 * safezoneW,10 * safezoneH]; uiNamespace setVariable ["GTX_ctrlGrp", GTX_ctrlGrp]; GTX_ctrlGrp ctrlCommit 0; GTX_grpBg = _display ctrlCreate ["RscStructuredText", 7635]; GTX_grpBg ctrlSetBackgroundColor [0, 0, 0, 0.1]; GTX_grpBg ctrlSetPosition [0.4 * safezoneW + safezoneX,0.01111 * safezoneH + safezoneY,0.2 * safezoneW,0.038 * safezoneH]; uiNamespace setVariable ["GTX_grpBg", GTX_grpBg]; GTX_grpBg ctrlCommit 0; GTX_compImg = _display ctrlCreate ["RscPicture", 7636, GTX_ctrlGrp]; GTX_compImg ctrlSetText "\MyProject\compass\imgs\default-puristax2.paa"; uiNamespace setVariable ["GTX_compImg", GTX_compImg]; GTX_compImg ctrlCommit 0; GTX_compNeed = _display ctrlCreate ["RscStructuredText", 7637]; GTX_compNeed ctrlSetPosition [(0.5 * safezoneW + safezoneX)- 0.05,0.01111 * safezoneH + safezoneY,0.1,0.09 * safezoneH]; GTX_compNeed ctrlSetStructuredText parseText ("<t shadow=1><t align='center' size='0.4' font='PuristaLight'>I"); uiNamespace setVariable ["GTX_compNeed", GTX_compNeed]; GTX_compNeed ctrlCommit 0; };
  21. Hey, all. I've been attempting to create a mission for some time now, and every problem I've encountered so far, I have been able to solve... until today. Context: Simply put, the mission uses ACE, which has its own explosive framework, and to that end the ACE site does provide some useful information. Specifically, I've been using 'ace_explosives_fnc_scriptedExplosive'. The good news is, it works like a charm. The catch is that it only seems to work for explosives which are spawned in through the editor, and not those created by scripts. In my scenario, there is a trigger (code below). The idea is to have an area where all cars driven by blufor units have a demolition charge spawned and attached to said vehicle, then have it explode. The problem is the line '[_newEp, -3] call ace_explosives_fnc_scriptedExplosive;'. For whatever reason, it works wonders with explosives placed within the editor (and subsequently attached to vehicles), but doesn't do a thing for any explosive spawned in via script. I was hoping any of you, who are more versed in scripting, could shed some light on the subject. I am by no means an experienced script writer/programmer, and most of what I know is from hours of messing around, so any advice would be much appreciated. Condition Code executed by the trigger: count (nearestObjects [trig2, ["Car"], 50]) > 0; On Activation code executed by the trigger (via script): _carlist = _this select 0; { if (side (driver _x) == west) then { hint "true"; _newEp = "DemoCharge_F" createVehicle [0, 0, 0]; _newEp attachTo [_x, [0, 0, 0], "driverview"]; [_newEp, -3] call ace_explosives_fnc_scriptedExplosive; } else { hint "false" }; } forEach _carList; Where _carList is: nearestObjects [trig2, ["Car"], 50] If I had to chance a guess at what was happening, I'd wager that ACE is only applying its explosive framework to the explosives placed in the editor, while those spawned via script maintain their vanilla class attributes.
  22. Hello everyone! I've recently started my first very own A2:OA Dayz Epoch server. It's all going well and I'm loving it, so I was trying to make some improvements and learn SQF scripting. I've found this mod on this forum some time ago: https://github.com/FullyGored/Cherno-Train-Service and I decided to implement it on my server. It really worked well. The only thing I didnt like about it, is the fact that the wagon is actually the Ikarius bus, so that the players can actuall get in (because normal wagons are not "proper" vehicles - you can get inside of it by climbing the ladder but you can't sit inside of it like you do in a car). It just looked silly to me and wasn't really immersive, so I decided to do something about it. So if you look at the Train_Start.sqf file, in line 32 it's actually spawning the Ikarius Bus. I replaced it with the wagon and added my custom init script to it. _wf = "Land_wagon_box" createVehicle _pos; _wf setVehicleInit "nul = this execVM ""scripts\Train\InitWagon.sqf"";"; processInitCommands; which contains the following: _this addAction ["<t color='#FF0000'>Get on the train</t>", "scripts\Train\GetOn.sqf", [], 6, true, true, "","alive _target"]; the GetOn.sqf just attaches the player to the wagon: _wagon = _this select 0; _action = _this select 2; player removeAction _action; player attachTo [_wagon, [1, -2, -0.85]]; player setDir 270; player setVariable ["isOnTrain", true, true]; So, here comes my first problem: why does the action menu disappear once the user is attached to an object? That would make the whole thing 10x easier, because I would just add an action to get off the train and the problem would be fixed. I tried many approaches, trying to detect key presses, etc. Basically I've been fighting with this script for 2 weeks time and gotten almost there. User can get on the train but can't get off. I tried doing this: I introduce a public variable on the top of the script after line 4: trainCurrentStation = "Berezino Start"; publicVariable "trainCurrentStation"; Then, on top, under line 19 I added all station names where the train stops (check _stops variable - it holds all rail names which should ) _stopNames = ["Berezino Station", "Berezino", "Nizhnoye", "Solnichiy", "Solnichiy Factory", "Solnichiy Factory 2", "Kamyshovo", "Skalisty", "Elektrozavodsk", "Prigorodki", "Chernogorsk", "Balota", "Komarovo", "Kamenka"]; So then, since the variables are not too descriptive, I figured I can add this piece of code to line 142 - to execute that code every train stop if (_i in _stops) then { [_train] spawn _horn; _currentStop = _stopNames select _b; trainCurrentStation = _currentStop; publicVariable "trainCurrentStation"; }; And then, I added a script for the clients to init.sqf which, I assumed, would listen to the changes in the trainCurrentStation variable and then react to it waitUntil { !(isNil "trainCurrentStation") }; "trainCurrentStation" addPublicVariableEventHandler { _station = _this select 1; _isOnTrain = player getVariable "isOnTrain"; if (!isNil "_isOnTrain") then { _hintText = format ["Thank you for choosing Cherno train services.\n Current station: %1 \n If you'd like to continue your journey, get back on the train.", _station]; titleText [_hintText, "PLAIN DOWN"]; detach player; sleep .3; player setVariable ["isOnTrain", nil, true]; player setVariable ["st_mh6_enhance_ffv_active",false]; }; }; I put into the init.sqf this way: if (!isDedicated) then { // other DayZ init scripts // init train scripts execVM "scripts\Train\clientInit.sqf"; // other DayZ init scripts } But this script does basically nothing. No script errors in the console (I'm connecting with the -showScriptErrors parameter), players are still stuck on the train forever (or unless you abort and re-join the game). The script is getting executed though! I tested that and it runs, but just does nothing for some reason. Any clue what I'm doing wrong? Is there a better way of doing all this stuff? Any clue if I can find another workaround (or just enable the action menu when the player is attached to an object?). I was thinking on attaching the player and then forcing the player to sit down in the train and then wait for the change in his stance (if he gets up, then detach from the train) but I'm not quite sure how to do that. Sorry for the long post, hoping someone can help with it.
  23. Hello everyone, My problem that I want to unlock a gate door only if player has specific item. I use a Trigger for that: Activation for AllPlayer, present. In the condition line I put this: (Player need to have the Ace Cellphone to open gates). "ACE_Cellphone" in items player; In the On Activation line : house1_1 setVariable ['bis_disabled_Door_1',0,true]; house1 setVariable ['bis_disabled_Door_1',0,true]; house1 and house1_1 are 2 concrete wall gates. In my init.sqf file, I put this: house1 setVariable ['bis_disabled_Door_1',1,true]; house1_1 setVariable ['bis_disabled_Door_1',1,true]; There a no problem, It's works fine! My problem is how can the doors stay locked if the player loses or puts down the phone? I try this In a new trigger, but it don't work, !("ACE_Cellphone" in items player;); Somebody can help me??? ;)
  24. Original post: "Is there any way to make backpacks accessable only when they are on ground or by other players using 'Open Backpack' action? The goal is to make player drop the backpack to get access in its inventory and so make them more realistic." UPDATE 15th Sept. -18: An addon version made! Script provided by @pierremgi PBO provided by @HazJ Download: https://hazjohnson.com/ArmA/@realisticBackpacks.zip Addon is now signed with key and bikey.
  25. Last content update: 6/13/2018 showing how to use the radius for addAction, using params instead of select, adding to arrays with various commands, altering arrays with various commands, get/setUnitLoadout 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
×