brians200
Member-
Content Count
285 -
Joined
-
Last visited
-
Medals
Everything posted by brians200
-
How to retrieve clan name set by Squad.xml?
brians200 replied to brians200's topic in ARMA 3 - MISSION EDITING & SCRIPTING
BIS added a new command that finally gives this information. https://community.bistudio.com/wiki/squadParams -
Randomly generated roadside IEDs
brians200 replied to brians200's topic in ARMA 3 - ADDONS & MODS: COMPLETE
Can you send me your mission and links to download any mods you are trying to use? -
Randomly generated roadside IEDs
brians200 replied to brians200's topic in ARMA 3 - ADDONS & MODS: COMPLETE
Arma has a maximum number of particles that can be rendered on the screen at a time. This number is determined by your graphics settings. If you go over this limit, it automatically deletes the oldest particles, so I highly doubt the particles are causing a problem. If you believe the number of fragments are a problem, you can try lowering them. The numbers are in this section. https://github.com/Brians200/EPD-IED/blob/master/EPD/IED/ExplosionFunctions.sqf#L67 -
Randomly generated roadside IEDs
brians200 replied to brians200's topic in ARMA 3 - ADDONS & MODS: COMPLETE
The section names are randomly generated each time, so make sure you are using the correct section name. This name is the return value when call the create function. -
Grimes Simple Revive Script
brians200 replied to KC Grimes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Do you have any plans to make the MRV actually look deployed, ie objects around it? Here is an example with the mission my server currently has up. http://i.imgur.com/M6OEbLd.jpg http://i.imgur.com/rpkb1hR.jpg The outhouse even has a "urinate" addaction that plays a sound ;) -
Grimes Simple Revive Script
brians200 replied to KC Grimes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Glad to see this come out! -
can some post link to 3d editors
brians200 replied to dr death jm's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here is one of them. http://forums.bistudio.com/showthread.php?160709-GID-Object-Positioning-System Requires placing things in the game. Then you write it out to a log file. Then you copy paste it into your mission files. -
You could follow the code and see where it is going after the publicVariableServer in BIS_fnc_MP ... Which finally ends up in BIS_fnc_MPexec. See the if statement towards the bottom. /* Author: Karel Moricky Description: Execute received remote execution Parameter(s): _this select 0: STRING - Packet variable name (always "BIS_fnc_MP_packet") _this select 1: ARRAY - Packet value (sent by BIS_fnc_MP function; see it's description for more details) Returns: BOOL - true if function was executed successfuly */ private ["_params","_functionName","_target","_isPersistent","_isCall","_varName","_varValue","_function"]; _varName = _this select 0; _varValue = _this select 1; _mode = [_varValue,0,[0]] call bis_fnc_param; _params = [_varValue,1,[]] call bis_fnc_param; _functionName = [_varValue,2,"",[""]] call bis_fnc_param; _target = [_varValue,3,true,[objnull,true,0,[],sideUnknown,grpnull,""]] call bis_fnc_param; _isPersistent = [_varValue,4,false,[false]] call bis_fnc_param; _isCall = [_varValue,5,false,[false]] call bis_fnc_param; if (typename _target == typename []) then { //--- Multi execution { [_varName,[_mode,_params,_functionName,_x,_isPersistent,_isCall]] call bis_fnc_MPexec; } foreach _target; } else{ //--- Single execution if (ismultiplayer && _mode == 0) then { private ["_ownerID","_serverID"]; _serverID = owner (missionnamespace getvariable ["bis_functions_mainscope",objnull]); //--- Server ID is not always 0 //--- Server process switch (typename _target) do { case (typename ""): { _ownerID = owner (missionnamespace getvariable [_target,objnull]); }; case (typename objnull): { private ["_targetCuratorUnit"]; _targetCuratorUnit = getassignedcuratorunit _target; if !(isnull _targetCuratorUnit) then {_target = _targetCuratorUnit;}; _ownerID = owner _target; }; case (typename true): { _ownerID = [_serverID,-1] select _target; }; case (typename 0): { _ownerID = _target; }; case (typename grpnull); case (typename sideUnknown): { _ownerID = -1; }; }; BIS_fnc_MP_packet = [1,_params,_functionName,_target,_isPersistent,_isCall]; //--- Send to clients if (_ownerID < 0) then { //--- Everyone publicvariable "BIS_fnc_MP_packet"; } else { if (_ownerID != _serverID) then { //--- Client _ownerID publicvariableclient "BIS_fnc_MP_packet"; }; }; //--- Server execution (for all or server only) if (_ownerID == -1 || _ownerID == _serverID) then { ["BIS_fnc_MP_packet",BIS_fnc_MP_packet] spawn BIS_fnc_MPexec; }; //--- Persistent call (for all or clients) if (_isPersistent) then { if (typename _target != typename 0) then { private ["_logic","_queue"]; _logic = missionnamespace getvariable ["bis_functions_mainscope",objnull]; _queue = _logic getvariable ["BIS_fnc_MP_queue",[]]; _queue set [ count _queue, +BIS_fnc_MP_packet ]; _logic setvariable ["BIS_fnc_MP_queue",_queue,true]; } else { ["Persistent execution is not allowed when target is %1. Use %2 or %3 instead.",typename 0,typename objnull,typename false] call bis_fnc_error; }; }; } else { //--- Local execution private ["_canExecute"]; _canExecute = switch (typename _target) do { case (typename grpnull): {player in units _target}; case (typename sideUnknown): {(player call bis_fnc_objectside) == _target}; default {true}; }; if (_canExecute) then { _function = missionnamespace getvariable _functionName; if (!isnil "_function") then { if (_isCall) then { _params call _function; } else { _params spawn _function; }; true } else { ["Function '%1' does not exist",_functionName] call bis_fnc_error; false }; }; }; };
-
That fifth parameter is relativelynew to the wiki. (March 31st) Is there anything in the dev branch logs indicating a change?
-
Blurry vision like in campaign.
brians200 replied to Icaruk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This thread talks about one instance of the blurred vision during the campaign. http://forums.bistudio.com/showthread.php?172864-Any-idea-how-this-was-done&p=2618743 If you remove this line, titleCut ["", "WHITE IN", 5]; You won't have the bright white flash -
Hello, I have a function that takes in several parameters in an array. The first parameter represents an angle. When I call this method with a for loop, the angle should remain consistent while the rest of the parameters change. However, I am getting 3 different values out of it. For example, if the angle is 380, I am getting 380, 0, and -380 being passed in, even though I am not modifying the variable that represents this angle. I have made a simplified version of the code here, demonstrating the problem. If I have a marker with the angle 380, I get 380 and -380 printed out. (Not sure where the zero is coming from in the original...) METHOD1 = { _angle = markerdir "testMarker"; for "_i" from 0 to 400 do{ [-1*_angle] call METHOD2; }; }; METHOD2 = { _angle = _this select 0; player sidechat format["%1", _angle]; }; This also produces the same result. METHOD1 = { _angle = markerdir "testMarker"; for "_i" from 0 to 400 do{ [_angle] call METHOD2; }; }; METHOD2 = { _angle = -1*(_this select 0); player sidechat format["%1", _angle]; }; I realized I could multiply by the -1 before the loop, but in the more advanced version of my code, it is producing the same result either way. Is there any reason this is happening? Is this a bug?
-
Inconsistent function parameters
brians200 replied to brians200's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That seems to be correct IndeedPete. https://community.bistudio.com/wiki/Variables "In functions you should additionally mark variables as local using the command private. Otherwise you may modify local variables of the calling script that are visible in the function." Thanks for your help seba1976 and IndeedPete. -
Finding roads inside of a rotated ellipse
brians200 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, I am trying to find all the roads inside of rotated ellipse. The ellipse comes from a map marker that is created by the user. I have tried implementing the answer from here to determine if a point is in an ellipse. _u = cos(_angle) * (_ellipseX - _pointX) + sin(_angle) * (_ellipseY - _pointY); _v = -sin(_angle) * (_ellipseX - _pointX) + cos(_angle) * (_ellipseY - _pointY); _dSqr = (_u/_sizeA)*(_u/_sizeA) + (_v/_sizeB)*(_v/_sizeB); _dSqr <= 1; However, when I try this, it only works when the angle is 0, 90, 180, or 270. Any other angle produces what I can only describe as a scissor effect. Here is a series of pictures from 0 to 90 degrees, increasing the angle by 15 degrees. The green dots are the roads that the code is returning as "in the ellipse". 0 Degrees 15 Degrees 30 Degrees 45 Degrees 60 Degrees 75 Degrees 90 Degrees I also tried implementing the answer from here, and got the same results _left = (cos(_angle)*(_pointX - _ellipseX) + sin(_angle) * (_pointY - _ellipseY))/_sizeA; _right = (sin(_angle)*(_pointX - _ellipseX) - cos(_angle) * (_pointY - _ellipseY))/_sizeB; _left*_left + _right*_right <= 1; Does anybody know what is wrong with the math? The angle and ellipse size are taken from the marker using markerDir and getMarkerSize -
Finding roads inside of a rotated ellipse
brians200 replied to brians200's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That fixes the problem! I guess it is because as you increase your angle when using North/South/East/West, you rotate clockwise. However, when working with a unit circle, you rotate counter clockwise. Thanks for your help, Väinämöinen. -
What a battle been trying for 3 days to get this to work. cant get script to run
brians200 replied to B00Ts-SA's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_newUnit = "className" createUnit ......; null = [_newUnit] execVM "shaun.sqf"; You would have to post code if you wanted more help. I would also recommend that you use "compile preprocessFileLineNumbers" in your init and call that instead of execvm, so it doesn't have to compile the code every time you call it. -
BTK Immersive Mine Detector
brians200 replied to sxp2high's topic in ARMA 3 - ADDONS & MODS: DISCUSSION
Yes, if you provide details on how you are detecting the mines, I could support you from my end. I will send you a pm @LordHeart, It looks like he is just using getVariable on the objects. I propose we both create a variable called "_isIED" on the object that represents the IED. Then the value can be a unique identifier to you and me, in case somebody wants to differentiate. -
BTK Immersive Mine Detector
brians200 replied to sxp2high's topic in ARMA 3 - ADDONS & MODS: DISCUSSION
Would love to work with you to get this working on my Random IED script. -
Triggering a range of IEDs using setDamage?
brians200 replied to GoodKnight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_number = 5; for "_i" from 1 to _number do{ call compile format["IED_%1 setDamage 1;", _i]; }; IED setDamage 1; -
Trouble intertwining string/format/objects
brians200 replied to KC Grimes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes, the order of the apostrophe and quotation marks can be mixed. I have always done it the way I wrote it, so it was easier for me to comprehend the overall code that way. If you want to get it to be more confusing, you can even use """words""" inside of a " block. :D Ultimately, I was trying to reduce the complexity of your original code so we could break it down into what isn't working. So you will see I ended up formatting a bit less than you did, which ultimately helped. One thing you might check is how setVariable works after death. I haven't used it enough to know fully. -
Scripting (for randomness) in multiplayer
brians200 replied to SilentSpike's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you are just doing this on the server, you are fine, as only 1 client is generating the number. So for your case, only one client should be moving the units around. This client is the server. 1. The server picks a random number up to 100 2. The server does calculations on that number 3. The server places units accordingly This will be fine. The note is for EVERYBODY generating a random number. For example, my computer might choose 94 and your computer might choose 21 at the same time. If you had some code that relied upon that number being the same.. well it wouldn't work very well. -
Trouble intertwining string/format/objects
brians200 replied to KC Grimes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Does this look about right? http://i.imgur.com/AMSI8uv.jpg http://i.imgur.com/akXqFd0.jpg You can clean it up and check for edge cases, but it seems to be working. I obviously don't have the wounding part and what not, so I can't test that. You are going to want to move the _text = ... code inside of the addMissionEventHandler (so the distance value gets updated), but you don't need to make it as complex as you were trying to do earlier. private ["_text"]; G_Unit_Marker_Exec = { _unit = _this select 0; _i = _this select 1; (player getVariable 'otherUnits') set [_i, _unit]; /****ADDED TO TEST ****/ player setVariable ["G_Side", side player]; _unit setVariable ['G_Unconscious', false]; _unit setVariable ["G_Side", side _unit]; /****END ADDED TO TEST****/ if (G_Unit_Marker_ShowDistance) then { _text = format['%1 (%2m)',name _unit,ceil(_unit distance player)]; } else { _text = name _unit; }; addMissionEventHandler['Draw3D', format[' private ["_color", "_height", "_alpha","_distp"]; _unit = (player getVariable "otherUnits") select %1; _distp = _unit distance player; if ((_distp <= G_Unit_Marker_Distance) and ((player getVariable "G_Side") == (_unit getVariable "G_Side")) and (_unit isKindOf "CAManBase")) then { _alpha = (-0.02*(_distp))+(0.025*(G_Unit_Marker_Distance)); if(_unit getVariable "G_Unconscious") then { _color = [1,0,0,_alpha]; } else { _color = [0,0.85,0,_alpha]; }; _height = 0.0053*(_distp)+2; drawIcon3D ["", _color, [(visiblePosition _unit) select 0, (visiblePosition _unit) select 1, _height], 0, 0, 0, "%2", 0, 0.035]; }; ',_i, _text]]; }; /****ADDED TO TEST ****/ G_Unit_Marker_Display = 2; G_Unit_Marker_ShowDistance = true; G_Unit_Marker_Distance = 75; /****END ADDED TO TEST****/ player setVariable ['otherUnits', []]; switch (G_Unit_Marker_Display) do { case 0: { /************HANDLE THIS CASE**************/ }; case 1: { /************HANDLE THIS CASE**************/ }; case 2: { _i = 0; { [_x,_i] call G_Unit_Marker_Exec; _i = _i + 1; } forEach allUnits; }; }; Good luck on your finals! -
Trouble intertwining string/format/objects
brians200 replied to KC Grimes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have gotten the text to show up for a split second, before receiving an error. So making some progress. Will let you know what I figure out. EDIT: The way I am doing it isn't going to work either, at least not more than 1 frame. The fun part about this issue is that you can't use objects passed in to call compile format. So that approach isn't going to work in the second bit of code you have. Looking at the first one now. The other fun part is that you can't directly pass inputs into the "command" of addMissionEventHandler without call compile format. However, you can't pass objects in that way. The final fun part is that local variables declared before the addMissionEventHandler call don't exist inside the "command" part. -
Trouble intertwining string/format/objects
brians200 replied to KC Grimes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Without going into the new code, is there any reason you can't pass the distance into format? { _dist = ""; //variable needs to be created before the next line so it exists afterwards call compile format["_dist = %1",_x distance player]; //you really don't even need call compile format anymore... player sidechat str _dist; } forEach allUnits; I will look into trying to actually use a player object now. ****************************************** First error I see is this _color = call compile format['[1,0,0,%2]',_alpha]; //%2 refers to the second input, which you don't have -
Trouble intertwining string/format/objects
brians200 replied to KC Grimes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
How soon after mission load are you running the loop? I have had trouble with sidechat showing up on my ied script if I use it early in the mission... Try using a hint and seeing if you hear the 4 beeps, or store the values in an array and check it with the debug console. -
Trouble intertwining string/format/objects
brians200 replied to KC Grimes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Why not put the sidechat part into the format? { call compile format["_dist = %1 distance player; player sideChat _dist",_x]; } forEach allUnits; The original version of my ied script did that with several commands chained in a format from time to time, since each ied object was named ied_%1. However, I was able to reference each of those variables again later, so I am not sure why it isn't working for you. When I referenced them again, they were inside of another format, so that might be something to look into. For example call compile format ['ied_%1 = _iedType createVehicle _iedPos; ied_%1 setDir (random 360); ied_%1 enableSimulation false;', iedcounter]; /// Then I used it later on call compile format ['[[ied_%1, t_%1],"Disarm", true, true] spawn BIS_fnc_MP;', iedcounter]; I did end up moving away from this type of programming though. If you have errors in your statement, they won't get reported in the .rpt file and that can be frustrating to debug. However, for some stuff, it is absolutely necessary.