fight9
Member-
Content Count
382 -
Joined
-
Last visited
-
Medals
Everything posted by fight9
-
Delete for markers using ctrlMapMouseOver
fight9 replied to saetheer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Something cool I found the other day: if you want to print the current server time rather than the elapsed time, use: [daytime] call BIS_fnc_timeToString This will return the current time in 00:00:00 format, rather than the daytime command alone that returns time in 00.0000 format. Or the time command the returns the elapsed time since mission start. This way, you don't have to mark or remember the start time, you can just look at your watch and see how long it has been since the marker was created. Just some useful information I decided to share. -
How to I set a UAV Control Terminal?
fight9 replied to twiddlingthumbs's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I don't have the definite answer for that. I'm on stable. Last time I spawned an AR-2 via scripts I created the crew. I didn't even try without. I think I read somewhere that you don't have to though. That's something to test for sure. -
How to I set a UAV Control Terminal?
fight9 replied to twiddlingthumbs's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The command connectTerminalToUav was updated on Dev branch to accept "objNull" for a disconnect. Woot woot! To OP: if you spawned units factions AR-2 already assembled, you can use that command to start the game with the terminal connected. -
It sounds like he uploaded a pre-made mission that included VAS restrictions. If that is the case, then use a program (ie. Eliteness) to dePBO the mission file, open it in the editor, grab the VAS download the thread and add in some new boxes yourself, following the instructions. Or attempt to revert the changes, like Blasturbator said. @Blasturbator Not everyone is as well versed in Arma scipting as the some of us. A little patience goes a long way to help.
-
Start here: http://forums.bistudio.com/showthread.php?144954-Dialog-Tutorial-For-Noobs-By-A-Noob (Use the GUI editor to output your basic defines instead of taking them from the post. They'll be more complete.) Then here afterwards: http://killzonekid.com/tag/gui/ Wiki resources: https://community.bistudio.com/wiki/Dialog_Control You can always ask questions here on the forums, just try to make it about a specific problem and not a whole process of learning and creating.
-
Changing Vehicle Color via Script, possible?
fight9 replied to spanishsurfer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes you can change the textures on the vehicle as long as hidden selections are enabled (most vehicles do) with the setObjectTexture command. https://community.bistudio.com/wiki/setObjectTexture As for using vehicles of another faction, you'll have to test. I know using a enemy vehicle will still show red, but not sure what you see when the enemy uses your vehicle. Edit: Na_Palm beat me to it. I'll leave what I wrote though. -
setVehicleAmmo currently does not work in some cases
fight9 replied to jacmac's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Arma 3 is having some strange locality issues. This issue might be a result of that. I'm seeing the same thing with setFuel while a dedicated server has ownership. The level will go to 1 for a few seconds and then drop back to where it was before. I've tried all sorts of solutions from broadcasting the command globally, locally, shifting ownership, and using public variables from one of KKs blog posts. Nothing has worked. -
Saving progress in an Insurgency Mission MP
fight9 replied to yomato26's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Are you trying to do it with the @A3MP mod? Saving is not currently possible with that mod. "CA_" is the prefix for the Arma 2 PBO files that A3MP "says" it requires. Using All In Arma instead would probably fix the issue. -
New flyby script, I need your help! :) Switches and Cases
fight9 replied to LtShadow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here you go. I cleaned up the formatting a bit and changed a few things to help performance. The inner while wont start until the vehicle is within 500m. I removed the "_flyby = false;" since there was no condition that resulted in it being true. I changed it to "_startDist = 500;". It definable at the top along with the sleep/refresh time. I removed the "_vehicle", and the "_unit", and "_ex". Since you are only sending one variable to the script (the aircraft), that becomes "_this", which you have already changed. The "_ex" variable wasn't being used at all and wasn't doing anything. What it was checking for was whether the player was not in the aircraft ("_this") and is not in any sort of airplane. Its a little redundant but I trust that's what you wanted. "_unit" and "_vehicle" were also no longer needed since they were not being used. I moved the "_sleepTime" to outside of the last if condition. Before it would have only hit if the aircraft was over 200m away. I added a small sleep to the outer while loop to help performance a tad. Well, here it is. // init = "(_this select 0) execVM ""\f4phantom_rs\scripts\init1.sqf"";"; private ["_sleeptime","_startDist","_start","_dist","_speed"]; _sleepTime = 19; _startDist = 500; while {alive _this} do { _start = player distance _this; while {(_start <= _startDist) && (_this != vehicle player) && !(vehicle player isKindOf "Plane")} do { _dist = player distance _this; _speed = speed _this; if (_dist < 200) then { // if dist is under 200 then if (_dist > 100) { // if distance is over 100 so 100-200 if (_speed > 300) then { // if speed is over 300 playSound "file1a"; // over 100 dist, over 300 speed } else { // if speed is under 300 playsound "file1b"; // over 100 dist, under 300 speed }; } else { // if dist is under 100 - so 0-100 if (_speed > 400) then { // if speed is over 400 playSound "file2a"; // under 100 dist, over 400 speed } else { // if speed is under 400 playsound "file2b"; // under 100 dist, under 400 speed }; }; } else { // if dist is over 200 if (_dist < 500) then { // if under 500, but wont hit if under 200 - so 200-500 dist if (_speed > 300) then { // if soeed is over 300 playSound "file3a"; // 200-500 dist, over 300 speed } else { // if speed is under 300 playSound "file3b"; // 200-500 dist, under 300 speed }; }; }; sleep _sleepTime; }; sleep 5; }; -
Mission End after all Tasks Complete and Return to Base
fight9 replied to rtek's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The method you explained should work, like Grumpy said. If you want another method to try, look at the triggerActivated command. https://community.bistudio.com/wiki/triggerActivated -
New flyby script, I need your help! :) Switches and Cases
fight9 replied to LtShadow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That might work. I'll look at it later tonight when I get home to make sure you don't have any extra brackets at the end. It kind of looks like you do but I won't know until I put it into Notepad++. That's one of the greatest features of that editing program; it tells you where brackets open and close. -
New flyby script, I need your help! :) Switches and Cases
fight9 replied to LtShadow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Assuming the script works at all, that would be it. I kind of think it will only work once and then stop. Might have to add a while loop to it. That eats a lot of resources though. There has got to be a better way. Have you considered looking into how JSRS or SoundMod do their scripting? -
New flyby script, I need your help! :) Switches and Cases
fight9 replied to LtShadow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You listed very specific scenarios with a lot of gaps between them. I filled them in with different sound files for now. The switch, as it turns out, is not needed at all. You can just use nested IF statements to play the sound. To me, adding a switch would be extra clutter and CPU usage. But I could see where it might make things easier to edit down the line. I'll post both shortly. Without Switch: // Speed and Distance for Sound for LtShadow // By Fight9 // <200 dist, >300 speed, file 1 // <100 dist, >400 speed, file 2 // <500 >200 dist, >300, file 3 _vehicle = _this select 0; _unit = player; _dist = _vehicle distance _unit; _speed = speed _vehicle; if (_dist < 200) then { // if dist is under 200 then if (_dist > 100) { // if distance is over 100 so 100-200 if (_speed > 300) then { // if speed is over 300 playSound "file1a"; // over 100 dist, over 300 speed } else { // if speed is under 300 playsound "file1b"; // over 100 dist, under 300 speed }; } else { // if dist is under 100 - so 0-100 if (_speed > 400) then { // if speed is over 400 playSound "file2a"; // under 100 dist, over 400 speed } else { // if speed is under 400 playsound "file2b"; // under 100 dist, under 400 speed }; }; } else { // if dist is over 200 if (_dist < 500) then { // if under 500, but wont hit if under 200 - so 200-500 dist if (_speed > 300) then { // if soeed is over 300 playSound "file3a"; // 200-500 dist, over 300 speed } else { // if speed is under 300 playSound "file3b"; // 200-500 dist, under 300 speed }; }; }; With Switch: // Speed and Distance for Sound for LtShadow w/ switch // By Fight9 // <200 dist, >300 speed, file 1 // <100 dist, >400 speed, file 2 // <500 >200 dist, >300, file 3 _vehicle = _this select 0; _unit = player; _dist = _vehicle distance _unit; _speed = speed _vehicle; _case = if (_dist < 200) then { // if dist is under 200 then if (_dist > 100) { // if distance is over 100 so 100-200 if (_speed > 300) then { // if speed is over 300 1a; // over 100 dist, over 300 speed } else { // if speed is under 300 1b; // over 100 dist, under 300 speed }; } else { // if dist is under 100 - so 0-100 if (_speed > 400) then { // if speed is over 400 2a; // under 100 dist, over 400 speed } else { // if speed is under 400 2b; // under 100 dist, under 400 speed }; }; } else { // if dist is over 200 if (_dist < 500) then { // if under 500, but wont hit if under 200 - so 200-500 dist if (_speed > 300) then { // if soeed is over 300 3a; // 200-500 dist, over 300 speed } else { // if speed is under 300 3b; // 200-500 dist, under 300 speed }; }; }; switch (_case) do { case 1a: {playSound "file1a";}; // over 100 dist, over 300 speed case 1b: {playsound "file1b";}; // over 100 dist, under 300 speed case 2a: {playSound "file2a";}; // under 100 dist, over 400 speed case 2b: {playsound "file2b";}; // under 100 dist, under 400 speed case 3a: {playSound "file3a";}; // 200-500 dist, over 300 speed case 3b: {playSound "file3b";}; // 200-500 dist, under 300 speed }; I wrote it in my editor this time instead of directly in the forums. That's why you see the indented formatting. It makes things a lot easier to read and I should have done that from the start. -
New flyby script, I need your help! :) Switches and Cases
fight9 replied to LtShadow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm gonna have to rewrite most of what I posted to accommodate all that you want. Give me a list of what scenarios (speed & distance) you want covered and I'll write the switch/if statements accordingly. The reason I say this is because I had 100 as the base speed. Considering we are talking about jets, 100 should be one of the lesser speeds instead. -
New flyby script, I need your help! :) Switches and Cases
fight9 replied to LtShadow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It depends on how you call the script. At the top of your script, you have "_vehicle = (_this select 0)". This is a variable sent to the script. 0 = [VehicleName] execVM "scriptName.sqf"; See the VehicleName in the brackets? That is "_this select 0". The variable sent to the script becomes a "_this select #". For example, look at: 0 = [VehicleName, UnitName, Distance, Speed] execVM "scriptName.sqf"; "_this select 0" is VehicleName "_this select 1" is UnitName "_this select 2" is Distance "_this select 3" is Speed See the pattern? So, when the script starts, you see "_vehicle = _this select 0;", but the game see's "_vehicle = VehicleName;". The pattern continues for all the variables sent to the script. You would have to use more if/then statements. Your format above is wrong. You have left out then "then" and "else" ("else" not required) in your statements. You have "if (_dist < 100 $$ (_speed < 100))" and that is it. That will fail. You need to complete the statement. "if (_dist < 100 && (_speed < 100)) then {playsound "1"} else {playsound "2"}". There are many more things wrong with your script. Here is a list of what I see, quickly looking. 1. "_dist" is not defined. That is a local variable that has no meaning at the moment. You would need "_dist = player distance _vehicle;" to be called before "_dist" later. 2. "_speed" is not defined. See #1. "_speed = speed _vehicle;" 3. You are missing many ";" (semi-colons) at the end of your lines. Your script would fail at line 1. 4. You have "$$" in a few places instead of "&&". 5. You are missing the "then" in your "if" statements. See above. 6. Your conditions are conflicting within your "switch". case a: { if (_dist > 100 && _dist <= 1000 $$ (_speed > 100)) playsound "close_fb"; _flyby = true // code for Distance and speed over 100 See the above statement from your post. I commented "// code for Distance and speed over 100", then you added an extra "if (_dist > 100 && _dist <= 1000 $$ (_speed > 100))". Speed and distance over 100 have already been discovered. That's why it is case "a". A second "if" statement is useless there. Also, look at "_dist > 100 && _dist <= 1000". That pretty much says "if distance is over 100, and if distance is over 1000". Well, if distance is over 1000, then for sure it is over 100. Its (again) useless to have there. Then "(_speed > 100)"; speed has already been discovered to be over 100, that's why it is case "a". To use what I posted, you have to define statements BETWEEN what I have already done. Second statements saying the same thing are unneeded. _vehicle = _this select 0; // <-- no "()" needed, but ";" required _unit = player; _dist = _vehicle distance _unit; // <-- Define "_dist" _speed = speed _vehicle; // <-- Define "_speed" _case = if (_speed > 100) then { if ((_dist > 100) then {a} else {b}; } else { if ((_dist > 100) then {c} else {d}; }; switch (_case) do { case a: { // <-- code for Distance and speed over 100 if (_dist < 200) then { // <-- now that distance/speed are over 100, what about 200. "if distance is less than (<) 200 THEN "playsound1" ELSE (if over 200) "playsound2";" playsound "distance100-200"; } else { playsound "NoSound"; // <-- over 200m from player. "playsound "NoSound";" would not work. I just used that as an example to explain things. }; }; case b: { // code for speed over 100, distance less than 100 }; case c: { // code for speed less than 100, distance over 100 }; case d: { // code for speed and distance under 100 }; }; Look at switch "a". Speed and distance have already been defined by "_case". In this case, both are over 100. So, again I use an "If" statement. If distance is less than 200, then play sound "distance100-200" ELSE (if distance is over 200) then playsound "NoSound" aka nothing. That's how you would nest more "if" statements into a switch. -
New flyby script, I need your help! :) Switches and Cases
fight9 replied to LtShadow's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I find switches are best when simple. Use if statements (nested if need be) to determine a condition. _case = if ((speed _vehicle) > 100) then { if ((_vehicle distance _unit > 100) then {a} else {b}; } else { if ((_vehicle distance _unit > 100) then {c} else {d}; }; switch (_case) do { case a: { // code for Distance and speed over 100 }; case b: { // code for speed over 100, distance less than 100 }; case c: { // code for speed less than 100, distance over 100 }; case d: { // code for speed and distance under 100 }; }; -
Need helpt with Retexturing / Custom Police Uniforms in altis Life
fight9 replied to derLandvogt's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Uniforms work the same way UnitName setObjectTextureGlobal [0,"texture.paa"]; Just be aware that you can only change the uniform this way. Vests and helmets require an addon since there is no hidden selection available. -
getpos player in multiplayer
fight9 replied to HatchetJesus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You'll need to do it from an external SQF file. -
What did BIS use to place objects (precisely) in campaign EPs?
fight9 replied to Polygon's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you want another option, the MCC mod has a very nice 3D editor and a save to mission.sqm function. -
How do I make a an object emit more light?
fight9 replied to Ghostwolf's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yeah, you'll have to execVM it. //Put this in INIT of cone/object >> null = [this] execVM "lights.sqf"; //Then make a file called "lights.sqf" in your mission folder and paste this text. _point = _this select 0; _light1 = "#lightpoint" createVehicle position _point; _light1 setLightBrightness 0.6; _light1 setLightAmbient[0.99, 0.99, 0.74]; _light1 setLightColor[0.0, 0.0, 0.0]; _light1 lightAttachObject [_point, [0,0,0]]; -
How do I make a an object emit more light?
fight9 replied to Ghostwolf's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You could, try this: _light1 = "#lightpoint" createVehicle position this; _light1 setLightBrightness 0.6; _light1 setLightAmbient[0.99, 0.99, 0.74]; _light1 setLightColor[0.0, 0.0, 0.0]; _light1 lightAttachObject [this, [0,1.65,1]]; -
How do I make a an object emit more light?
fight9 replied to Ghostwolf's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can create a new lightsource on the cone. _light1 = "#lightpoint" createVehicle position _object; _light1 setLightBrightness 0.6; _light1 setLightAmbient[0.99, 0.99, 0.74]; _light1 setLightColor[0.0, 0.0, 0.0]; _light1 lightAttachObject [_object, [0,1.65,1]]; -
That video posted works in Arma 3 (no function module). Follow the steps exactly and it should work. It did for me. If you still can't get it to work, I'll post an example mission when I get home late tonight .
-
How to disable street lights?
fight9 replied to roguetrooper's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok I upgraded the script a little bit to be more universal. This way, you can use it multiple times with different markers or objects. Of course, if you want you want to use the defaults, that's fine too. Basic usage: Make a marker named "lightsmarker" and make a trigger with 0 = [] execVM "lights.sqf"; in the On Act. Simple as that. Will cut all lights 1000m around "lightsmarker". Use 0 = [0] execVM "lights.sqf"; to turn lights back on. Advanced usage: _this select 0 (optional): Damage, 0 for ON, 0.95 for OFF - Default 0.95 _this select 1 (optional): Distance - default 1000 _this select 2 (optional): Position - position objectName for object, getMarkerPos "markerName" for marker - Default getMarkerPos "lightsmarker" Examples: 0 = [0.95, 100, position generator] execVM "lights.sqf"; - cut the lights 100m around object named "generator" 0 = [0, 500, position lightswitch] execVM "lights.sqf"; - restore the lights 500m around object named "lightswitch" 0 = [0.95, 1000, getMarkerPos "townMarker"] execVM "lights.sqf"; - cut lights 1000m around marker named "townmarker" 0 = [0, 250, getMarkerPos "powerplant"] execVM "lights.sqf"; - restore lights 250m around marker named "powerplant" Script: Make a file called lights.sqf and paste the following _onoff = [_this, 0, 0.95, [0]] call BIS_fnc_param; _distance = [_this, 1, 1000, [0]] call BIS_fnc_param; _marker = [_this, 2, getMarkerPos "lightsmarker", ["",[],objNull]] call BIS_fnc_param; _types = ["Lamps_Base_F", "PowerLines_base_F","Land_LampDecor_F","Land_LampHalogen_F","Land_LampHarbour_F","Land_LampShabby_F","Land_NavigLight","Land_runway_edgelight","Land_PowerPoleWooden_L_F"]; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { _lamps = _marker nearObjects [_types select _i, _distance]; sleep 0.1; {_x setDamage _onoff} forEach _lamps; }; I take no credit for the original script. I've seen it passed around so much, I'm not sure who first shared it. All I did was make some simple edits to help make it more universal. This has been asked about a lot lately, so I thought I would share. -
How to disable street lights?
fight9 replied to roguetrooper's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok, here is an example mission with two different options. Use the laptops in the building to turn the power on and off, or blow the transformers (sign actually) and it will kill the power. There are instructions while playing on what to do. I might edit the script later to be more universal with optional distance and placement variables. Maybe... https://dl.dropboxusercontent.com/u/17023300/lightsoff.Altis.zip