Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Everything posted by Kingsley1997

  1. Kingsley1997

    Virtual Arsenal multiplayer problem

    Oh I didn't know they had a new one, will have to check that out thanks
  2. You don't need to call initPlayerLocal. It is a "magic" file that is executed by the game automatically. See https://community.bistudio.com/wiki/Event_Scripts
  3. Don't worry about asking questions on these sorts of things, everyone's gotta start somewhere. I'll try to explain this as simply as I can. What you're looking at from the wiki is SQF code. SQF is the scripting language used for altering the game / mission. The code on the wiki is not generally used directly inside the mission editor. Instead code is put into .sqf files which can then be executed (run) by either the client (player on the mission) or the server (computer hosting the mission). There are some guides out there to help you understand the basics of SQF scripting and how to properly integrate it with your missions. Here's one I just found from a quick Google search: http://www.armaholic.com/page.php?id=9220 Your problem with the waypoints though seems to be solvable through only SQF scripting as I do not see an option in the waypoints to turn off the text. For an in-editor alternative, look at the task modules under (F7) Modules > Intel. Here's an example init.sqf file which you would place inside your mission directory with the mission.sqm. The init.sqf is executed for each player every time they join. I've commented the code so you can see what each line does. In this file is where you could place the waypoint code from the wiki, however for large scale missions, breaking your code up into separate files and folders is best practice. init.sqf if (isServer || isDedicated) then { // This top line is an IF statement. It reads like English that if the computer executing this file (init.sqf) is either a server or is dedicated, then run the code below. // Server Code // This is where you place code only the server should execute // Use this bit for spawning enemies, objects etc. } else { // This is the else part of the IF statement, again it reads like English so you should be able to get the idea. // This part of the code is only run on client machines (people actually playing the mission) waitUntil {!isNull player}; // This will wait until the player is actually spawned in waitUntil {time > 0}; // This will wait until the time is greater than 0 - used for making sure the player is spawned and is visible // Now onto the waypoints // _waypoint is a local variable (only usable in this script/scope (Google what a scope is, it's kinda simple)) // "leader group player" is a collection of commands written by BIS. "leader" returns the leader of the group. "group player" return the group the player is assigned to. // "getMarkerPos" will return the position of the marker. The "waypoint1" is the name of your marker. The brackets ( ) are used just like in BIDMAS (Maths). _waypoint = leader group player addWaypoint [(getMarkerPos "waypoint1"), 0]; // The 0 at the end is the index. This essentially says which order is this waypoint in. 0 is first, 1 is second etc. // The rest is just code from the wiki related to waypoints. _waypoint holds the object (newly created waypoint) and it then uses the command in the middle to set whatever the command is to the value to the right. [group player, 0] setWaypointVisible false; _waypoint setWaypointBehaviour "CARELESS"; _waypoint setWaypointCombatMode "RED"; _waypoint setWaypointCompletionRadius 0; _waypoint setWaypointFormation "NO CHANGE"; _waypoint setWaypointSpeed "FULL"; _waypoint setwaypointType "MOVE"; // You'd then copy and paste that waypoint code again but instead of puting 0 in the addWaypoint line, you'd increment it. }; Note that I haven't actually tested the above code so if it doesn't work don't worry, just tell me what happens/doesn't happen and I'll amend it. I do recommend you read up on SQF scripting and then see if you understand the code inside the file better however. I often find if you just Google "arma 3 ...." the .... being the command name or function you're trying to make work, it will give you a good description of it, what data is returns, what arguments you need etc.
  4. I've got the definitions for my dialog tree, but how do I add items to it and control what goes on? I'm building a group manager so it needs to list groups and their members (players). ---------- Post added at 21:57 ---------- Previous post was at 21:45 ---------- Never mind, I figured it out using Karels template mission For anyone interested, here's some commands related to the Tree: https://community.bistudio.com/wiki/tvAdd
  5. Kingsley1997

    Virtual Arsenal multiplayer problem

    No the _unit is a local variable that references _this select 0 which references the units object. You don't need to set each units name in the editor. Read up on some SQF to fully understand how these variables work and what _this means.
  6. Kingsley1997

    Is it possible to remove bird on death?

    In ArmA 3 you can change the respawn type to spectate which will not spawn birds, and instead let dead players spectate alive players (you can also set it to lock them to their side). In ArmA 2 I'm not sure, haven't played that game in years... I don't think you can remove the birds altogether though. Look at this: https://community.bistudio.com/wiki/Arma_3_Respawn
  7. Kingsley1997

    Animations and BIS_fnc_MP

    First off be careful of the arguments you set in the BIS_fnc_MP. The last three boolean arguments are all set to true in your example which is in my opinion a bad thing based on what you're doing. I'm not too sure how the BIS_fnc_MP works with sleeps if they're not executed inside its scope, but here's what I'd do instead: then { [ [player, _unitActionName], "switchMove", true, false, false ] call BIS_fnc_MP; [ [_target, _targetActionName], "switchMove", true, false, false ] call BIS_fnc_MP; sleep _unitAdditionalDelay; detach _target; }
  8. Kingsley1997

    Arma missions on a grand scale?

    I've played EUTW quite a bit, it's sometimes large scale and sometimes small scale depending on the mission the server selects. It doesn't utilize the whole map, but with the right teamwork it can feel like a huge objective. http://www.eutw.net/
  9. I wish SQF had the += -= and ++ and -- operators :(
  10. Kingsley1997

    Virtual Arsenal multiplayer problem

    Yes but make sure you change all the "this" in the script to _unit. "this" refers to the object it's in, so when it's used in the init box of a unit, it refers directly to that unit, but when executing a script, you have to pass it that object, and reference it in whatever you choose, could be _unit or could be _aCrazyLongPointlessVarNameWhichIsAnnoying.
  11. Yeah I've got my function fn_devLog running all over the place which will print out the given text in side chat and all I see is a bunch of messages executing way more than they need to. I've got a feeling that it's creating multiple triggers and so the trigger activation runs multiple times. Although I can't see how it would create multiple triggers because that code isn't even in a dodgy loop...
  12. Here's what my problem is and what I'm doing at the moment in my code to handle it, but there are problems with it... In the mission there are FOB's placed around the map (markers names fob1..fob10 etc). When the player clicks the "request deployment" action they will be teleported to a random FOB. The server will then spawn random zones using selectBestPlaces and create AI units at them. The server will also create a marker and a trigger with the settings that if EAST are NOT PRESENT then it will execute sfn_handleZone on the server (sfn meaning server function). sfn_handleZone then sets that zone's marker to ColorWEST and deletes the trigger. After that it will check the other zones by looping from 0 to 10 (or however many maximum zones can spawn) and if one of the zones's marker color is NOT set the WEST then it will not set the "allZonesComplete" variable to true. After that loop finishes, it will check if allZonesComplete is true, if it is it will then find a good spot for an LZ near the zone, it will then spawn a Huron helicopter at a specified marker and then set the heli to go and LOAD at that LZ position. The problem I am having is that the helicopter is spawning infinitely, spawning every few seconds. From what I see in the server's RPT log is that the sfn_handleZone is being called far too many times based on the actual number of zones. If there are only 3 zones (which there usually is) then sfn_handleZones should only be called a maximum of 3 times, surely? Anyway, I've posted my code below, not all of it is relevant and one thing to note is I am using iniDBI to store zone information and restore it. sfn_createZones.sqf sfn_handleZone.sqf If you have any suggestions on the logic of my mission, even if it involves me re-writing all of it, please let me know! This is a mission I'm making for the public as a persistent military simulator with different deployments, player progression etc. so hopefully when it all works, you can play it, not just me :D
  13. Kingsley1997

    Virtual Arsenal multiplayer problem

    So are you trying to get different units to have different loadout's that you've exported from the virtual arsenal? ---------- Post added at 19:41 ---------- Previous post was at 19:30 ---------- This script should simplify things, but again I'm not sure what you're after. private ["_unit", "_type", "_defaultType"]; _defaultType = "rifleman"; _unit = [_this, 0, player] call BIS_fnc_param; // If no unit is given in the parameters, use player instead _type = [_this, 1, _defaultType] call BIS_fnc_param; // If no type is given in the parameters, use the default instead /* Call this script by placing the following line in the units init: null = [this, "yourType"] execVM "theScriptName.sqf"; If you want to use it in the init.sqf use the following code: if (local player) then { _null = [player, "yourType"] execVM "theScriptName.sqf"; }; */ removeAllWeapons _unit; removeAllItems _unit; removeAllAssignedItems _unit; removeUniform _unit; removeVest _unit; removeBackpack _unit; removeHeadgear _unit; removeGoggles _unit; switch (_type) do { case "sniper": { // Add your exported arsenal code here, but replace this with _unit! }; case "medic": { // Do the same here, but for the medic loadout etc. }; case "rifleman": { // Do the same here, but for the medic loadout etc. }; default { // Type used wasn't defined in the switch statement, do the default }; };
  14. You could do this with a waitUntil if you just set a variable to false, then sleep for X amount of seconds, then when that variable is true, the waitUntil can then proceed to the code that lets the vehicle move.
  15. Kingsley1997

    Virtual Arsenal multiplayer problem

    For multiplayer scripting it's best practice to use the init.sqf as appose to placing code inside each units init box. Something like this in your init would create a virtual arsenal on a unit named "arsenalBox"; if (isServer || isDedicated) then { ["AmmoboxInit", [arsenalBox, true]] call BIS_fnc_arsenal; }; Now that my brain has caught up I understand your problem and yes, R3vo suggestion is probably best
  16. Putting the %1 in quotes did the trick, thanks Schatten :)
  17. I'm passing a string variable through BIS_fnc_MP but on the receiving end for some reason whenever I use the variable to change the marker colour, it doesn't do it. I assume this is because it's not a string, because it certainly can find the marker with that name. So I tried putting "str" before it and wrapping it in "(" and ")" but it still doesn't work (perhaps because str works out the value of the variable and in this case would return null?). Here's my trigger act string that I give to the trigger when I make it: _trgAct = format ["[%1, 'sfn_handleZone', false, false, true] call BIS_fnc_MP;", _zonName]; _zonName is the marker name of the zone in the format of "fob10_aiZone_0" (the 10 and 0 being different depending on the FOB and zone interval) On the receiving end at sfn_handleZone: _zonName = _this; _zonName setMarkerColor "ColorWEST"; What am I doing wrong? I've been trying to find a solution all day and now this is just aggravating me...
  18. I changed my logic completely. This thread is no longer of use.
  19. I have no idea how this code is not working... It's supposed to check a "zone" every 5 seconds, checks if there aren't any enemies in it. If there aren't any enemies within the given radius of the zone (marker) then it will mark that zone as complete in the DB. It then checks the rest of the other zones, and if they are ALL complete, then it will proceed to the end process which is to spawn a helicopter (Huron) and waypoint it to the chosen LZ position. The problem is, no matter how I end the "while" loop with either a variable switch or a "breakOut" it will still continue and spawn more helicopters causing them to hilariously crash into each other... Any suggestions? Code below. EDIT - The code below is being executed on the server!
  20. Kingsley1997

    Default ArmA 3 Styles for Dialogs?

    Copying the parent classes from the GUI editor worked a treat, thanks! ---------- Post added at 12:27 ---------- Previous post was at 12:07 ---------- Looks pretty now :)
  21. I'm creating dialogs and the one thing I don't seem to understand is how to get it to look like Arma 3's UI? At the moment the styling of my dialog's GUI is all gross and has shadows, gross text etc.. Where as in Arma's GUI such as the main menu, and even in the VAS script, the buttons and elements look clean, simple and all follow a constant design. Is there a default defines.hpp that I need that has these styles defined or do I HAVE to build them myself?
  22. Kingsley1997

    Default ArmA 3 Styles for Dialogs?

    Perfect cheers!
  23. Is there a way to remove all of the respawn points added through BIS_fnc_addRespawnPosition? For example... [_myGroup, "hq_spawn"] call BIS_fnc_addRespawnPosition; [_myGroup, "fob"] call BIS_fnc_addRespawnPosition; ... and so on ... // LATER ON IN THE MISSION [_myGroup] call BIS_fnc_removeAllRespawnPositions; I've got it at the moment to add respawn positions to a player's namespace but it's too clunky. Ideally I'd like to remove all respawn positions and then I can do whatever...
  24. I've tried all your suggestions, nothing's working :( I'm just gonna revisit this when I'm not tired, maybe I'm doing it wrong...
  25. Thanks, I'll save this. I'm currently trying it with markers. It's quite a complicated respawn system though, since if groupA is at fobA, they should only be allowed to spawn at fobA, but groupB can spawn at fobB and so on etc.