fight9
Member-
Content Count
382 -
Joined
-
Last visited
-
Medals
-
Trouble figuring out a script error
fight9 replied to conz's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Should be isPlayer _x -
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.
-
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.
-
Determining if an item is "assignable"
fight9 replied to chronicsilence's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Start vehicle "wrecked"?
fight9 replied to kocrachon's topic in ARMA 3 - MISSION EDITING & SCRIPTING
http://killzonekid.com/arma-scripting-tutorials-how-to-make-a-wreck/ dont know about the crater -
lbData Sring to Object (on dedicated)
fight9 replied to cruoriss's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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; -
Mission Template Stand Alone GAIA - Make missions FAST by using MCC GAIA engine
fight9 replied to spirit6's topic in ARMA 3 - MISSION EDITING & SCRIPTING
(group [color="#B22222"]_group1[/color]) setVariable ["GAIA_ZONE_INTEND",["area2", "MOVE"], false]; Thats what the error message says is wrong anyways. -
BIS_fnc_MP addAction and removeAllActions
fight9 replied to barbolani's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's probably easier to just always have both actions but broadcast a condition variable rather than running the addAction each time. -
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.
-
Ah... Length of selection, not index position to finish. Good catch, I guess.
-
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"]
-
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"]
-
[SNIPPET] Export Ranked CfgWeapons by Mass
fight9 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
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: -
Dumb (effcient) debug question by scripting newbie.
fight9 replied to gameboi's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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... -
Restart the server at the end of a countdown
fight9 replied to raptor2x's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I thought it restarted the server by I am probably wrong.