Jump to content

fight9

Member
  • Content Count

    382
  • Joined

  • Last visited

  • Medals

Everything posted by fight9

  1. fight9

    Arma 3 Dialogs help

    Errors in the description.ext (including your dialog) will cause the game to crash. It should tell you the line and error in the message. But, as said above, can't do much without seeing your code.
  2. fight9

    Scripting Etiquette?

    You can write your code anyway you want. If you don't want to capitalize, comment, or space things... Then don't. Name your folders, files, and functions anyway you like, as well. It's all up to the scripters or users preference. I will advise to keep things neat and commented. Makes it much easier to read and understand later on. Especially when you start writing super complicated scripts over hundreds of lines. I think neat code is 100x more useful then the negligible about of time gaine on preprocessing.
  3. The bino slot (rangefinder included) is the wildcard in there. You have to use addWeapon and assignItem for it. Kind of annoying. This is how I tested for it in the past when adding assigned items back to the player. _items = assignedItems player; { if (([(configFile >> "CfgWeapons" >> _x),"optics",0] call BIS_fnc_returnConfigEntry) > 0) then { player addWeapon _x; player assignItem _x; } else { player linkItem _x; }; } forEach _items; Larrows configClasses code will do that.
  4. fight9

    Start vehicle "wrecked"?

    http://killzonekid.com/arma-scripting-tutorials-how-to-make-a-wreck/ dont know about the crater
  5. I like to use BIS_fnc_objectVar instead of setVehicleVarName (it does it for you). It has always worked for me when I require vehicles to have a name. It can accept a pre-made name or create one for you. It will then return that name in string format. Use call compile or getVar to access that vehicle. let function assign a name: _varName = _object call BIS_fnc_objectVar; _vic = call compile _varName; or assign the name yourself _varName = [_object,"TheName"] call BIS_fnc_objectVar; _vic = missionNamespace getVariable _varName;
  6. (group [color="#B22222"]_group1[/color]) setVariable ["GAIA_ZONE_INTEND",["area2", "MOVE"], false]; Thats what the error message says is wrong anyways.
  7. It's probably easier to just always have both actions but broadcast a condition variable rather than running the addAction each time.
  8. fight9

    FSM Tutorial

    Damn, where was this a coulple weeks ago when I was learning FSMs. It's nice to see some new information... Everything out there is from OFP days. I won't be able to see it until I get home from work later... But hopefully you speak about selecting a compiler... That's one thing I had to figure out on my own. FSMs are my new go-to for endless-loop style scripts with conditions. It's super easy to write with that visual representation. Thanks for the share. Hopefully you can teach me something new.
  9. fight9

    Separating Strings

    Ah... Length of selection, not index position to finish. Good catch, I guess.
  10. fight9

    Separating Strings

    sure, I hope this helps _fnc_cutString = { private "_i"; // the string will be _this, no need for (_string = _this select 0) or similar _i = _this find " "; // find will return the index position of " ", -1 if not found if (_i < 0) exitWith {[_this,""]}; // if -1 (not found), exit fuction with the array [ string, "" ] [_this select [0,_i],_this select [_i + 1,count _this]] // end the function with array of two strings // select command can be used to cut string ( string select [start,length] ) // [ string select [0(beginning),index(position of space)] , string selct [index + 1(1 after space), end(total string count)] ] }; I'm trying to write a function to cut a string at all the spaces but havent figured it out yet ---------- Post added at 19:34 ---------- Previous post was at 19:30 ---------- BIS already has a function that can do this. You dont even need what I have above _return = ["my new string"," "] call BIS_fnc_splitString; // returns ["my","new","string"]
  11. fight9

    Separating Strings

    Pretty easy _fnc_cutString = { private "_i"; _i = _this find " "; if (_i < 0) exitWith {[_this,""]}; [_this select [0,_i],_this select [_i + 1,count _this]] }; "my string" call _fnc_cutString; // returns: ["my","string"]
  12. This was something I wrote quickly to see how mass is configured through different CfgWeapon Items. I thought I would share in case some one else was interested. Hopefully this can help someone else down the line - maybe not with mass, but sorting configs in general. Just spawn or execVM the code Export example: Code:
  13. You are gonna have to restart the game over and over again. Its the nature of the beast. Missions you can drop into your missions folder and just reload, mods that change or add things will require a restart. There will be nights that you restart the game well over a hundred times. Its a bitch...
  14. I thought it restarted the server by I am probably wrong.
  15. Yup, Jshock has it right. Make a document in your servers arma 3 root... in the userConfig folder (make one if you dont have it already). arma 3\userConfig\myPass\myPass.hpp Then in that file, just put your server.cfg password in quatations // \userConfig\myPass\myPass.hpp "mypassword1" Then, to restart the server... call this code on the server if isServer then { _myPass = call compile preprocessFileLineNumbers "\userConfig\myPass\myPass.hpp"; _myPass serverCommand "#restart"; }; This way, if someone looks inside your mission, they wont get your password.
  16. The above will just end the mission, not restart the server. I think the command you are looking for is serverCommand. Combined with a configured password, it should be able to do the trick. Be careful how you do that though, you don't want to give your admin password to anyone who looks inside your mission... Perhaps you can store the password in a userConfig document on the server and have a script (executed on the server) retrieve it for use by that command.
  17. fight9

    EndGame Source Code

    oh damn.. that is tricky. Thanks!
  18. fight9

    EndGame Source Code

    Its probably locked in the missions_f_mark.ebo, but can find a lot of the functions used in the function viewer (ie revive, group manager, shared objectives). You just have to look through it.
  19. fight9

    Shared Objectives?

    I found this in the function viewer. BIS_fnc_sharedObjectives
  20. Use lbSetData & lbData to give your list items a string value and then use that in your switch-case. That way it doesn't matter what index position they are in. _ctrl = _display displayCtrl 1500; // list items _index = _ctrl lbAdd "Item 1"; _ctrl lbSetData [_index,"item"]; _index = _ctrl lbAdd "Thing 2"; _ctrl lbSetData [_index,"thing"]; /////////////////////////////// /////////////////////////////// // get items _item = switch (_ctrl lbData (lbCurSel _ctrl)) do { case "item": {"Item 1"}; case "thing": {"thing 2"}; default {"Nothing"}; }; hint format ["I have %1"_item]; You could almost do the same thing using lbText. Return the displayed text from the index postion of the currently selected item. It all depends on what you are trying to do.
  21. fight9

    Shared Objectives?

    Its probably in one of the encrypted EBOs. My guess would be missions_f_mark.ebo. You might have to wait until the framework is introduced completely.
  22. fight9

    DLC detection

    try getDLCs. Read the comments.
  23. I think it would be easier to use enableRopeAttach on vehicles entering and exiting the zone rather than trying to use the eventHandlers. Command works on both attaching and attached vehicles.
  24. fight9

    Dialog Errors

    YOu need to use class controls, I think... class AUSMD_Inv { idd = 12085; movingEnable = false; moving = -1; onLoad = ""; onUnload = ""; controlsBackground[] = {}; class Controls { class myItems: RscListbox { idc = 1500; x = 6.5 * GUI_GRID_W + GUI_GRID_X; y = 4 * GUI_GRID_H + GUI_GRID_Y; w = 11.5 * GUI_GRID_W; h = 10 * GUI_GRID_H; }; //..... //..... };
×