

riouken
Member-
Content Count
570 -
Joined
-
Last visited
-
Medals
Everything posted by riouken
-
How can you add a sleep command inside a script for a section of code only!
riouken replied to avibird 1's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
http://community.bistudio.com/wiki/spawn Just spawn a new thread and then you can sleep in there. So your on activation would be something like this: "[] spawn { sleep 120;[color=#3E3E3E]player sideChat 'HQ INTELL REPORTS: Tank Platoon has been destroyed'; GroupTank exec 'HQ\support\donearmor3.sqf';[/color]};" -
It is possible, but it may not look as good as you hope. There are limited places where you can put pics and images. This command is normaly just used to change flag textures and post images on billboards, but you can give it a shot. http://community.bistudio.com/wiki/setObjectTexture
-
Players/NPCs respawning without weapons
riouken replied to kammorne's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This is not tested but should work. init.sqf (could be used init in other ways depending on your mission structure, but we would need more info. _index = _myPlayerName addMPEventHandler ["MPRespawn", { removeAllWeapons (_this select 0); removeAllItems (_this select 0); (_this select 0) addBackpack "TK_RPG_Backpack_EP1"; }]; -
adding a named object to an AI units' inventory
riouken replied to HFTB's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You can't, they are not actual objects you can refrence. You can only check if they have one of that type of classname in their inventory. http://www.kylania.com/ex/?p=124 There is also an rpg items mod that has a lot more items. Ill try and find a link ---------- Post added at 12:11 PM ---------- Previous post was at 12:08 PM ---------- Here is the rpg item mod. http://forums.bistudio.com/showthread.php?142673-Arma-Role-Playing-Items-ARP-Mod -
M252 mortar smoke rounds
riouken replied to Joe98's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No not for the 252, there are only the 8 round HE: http://community.bistudio.com/wiki/ArmA_2:_Weapons http://browser.six-projects.net/configclasses/CfgVehicles%3EM252/config?version=65 8Rnd_81mmHE_M252 edit. beaten to the punch. What ^ said. -
PvsP high command
riouken replied to DurbanPoison_VoD's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If i'm not mistaken its only one person per side at a time. But it is possible to change commanders mid mission with scripting, as far as I know there can be only one at a time per side. -
waituntil {!isnil "bis_fnc_init"} question
riouken replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No normaly you should just check at the begining of each script that has those calls in it. This is a black and white example, the bis_fnc_init but when you start coding where a var or condition is changing through out the mission, and your script could be called at any time, you will see why it pays to have good practices like this. -
waituntil {!isnil "bis_fnc_init"} question
riouken replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You don't have too, but its good practice. You could make one check at the begining, but that is not a good practice. It can lead to unexpected errors that are hard to track down. Now if you do go against that and want to check at the begining and only at the begining. You should NOT do it in the init.sqf. you do not want any sleeps or waituntil's in the init.sqf. it could cause timing issues with things being run out of order or not at all. The init.sqf is like a launchpad. Its your way to get things started in the begining of a mission. If you need to do other things like waituntil etc.. launch a new script from the init.sqf and have your sleeps and waituntils in there. If you take a look at some of the better scripters you will see they break it down even further to help control what is going on in the scripting process. For instance in my new mission I'm working on, in the init.sqf I only launch my other scripts from there. I have a client_init.sqf I have a server_init.sqf And I launch those from the init.sqf I hope that helps explane why you would want to code like that. -
AI Helicopter Engine
riouken replied to Ryousuke's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
In the init of the veh. [color=#000000][font=Lucida Console]this addEventHandler ["Engine[/font][/color][color=#000000][font=Lucida Console]", "if ((_this select 1) == False) then {[/font][/color][color=#000000][font=Lucida Console](_this select 0)[/font][/color][color=#000000][font=Lucida Console] engineOn true;};[/font][/color][color=#000000][font=Lucida Console]"][/font][/color] That should work, but I dont have time to test it. It adds an event handler that each time the engine state changes it fires the EH, then it checks if the engine is turning off, if it is then it turns the engine back on. This may not be pretty though, the AI might keep trying to turn it off over and over again. -
Instead of nearObjects how to get all objects
riouken replied to joikd's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yes that does work, but the problem is that its not always in the right spot, and some map makes don't even define it at all in there configs. My solution will always work even on custom maps that do not have all the location data configured. -
Instead of nearObjects how to get all objects
riouken replied to joikd's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Put a marker named "myMapCenter". near the center of your map. Then: _nearby = (getMarkerPos "myMapCenter") nearObjects ["building",20000]; if the map is bigger than 20 clicks then just bump up the distance. -
Passing trigger or variable to addaction script
riouken replied to stalkarn's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The part in red is the Array that will get passed to the script i.e.(evidence.sqf). evidence1 = evi1 addaction ["Collect evidence","evidence.sqf", [color=#ff0000][1,2,3][/color]]; in the trigger condition put this: [color=#FF0000]conv_move[/color] in evidence.sqf : // _this is the internal refrence to the array that we passed to the script. We can select items out of that array just like we would any other array. ie..(_this select _index) _passedarray = _this select 3; _myfirstvar = _passedarray select 0; _mysecondvar = _passedarray select 1; _mythirdvar = _passedarray select 2; // Do what ever you need to here use the var if (_myfirstvar == 1) then { [color=#FF0000]conv_move = true; publicVariable "[/color][color=#FF0000]conv_move";}; [/color] The only thing else you need to do is define the conv_move variable as false in the init.sqf so you do not get an undefined variable error. -
3x tank in a group, move to waypoint after X time.
riouken replied to craptakular's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Its not bugged, its not made for creating vehicles. So it doesn't work. Thankfully they made another command that might :): http://community.bistudio.com/wiki/createVehicle_array But your right, I like using bis_fnc_spawngroup for vehicles as well. -
Vehicle damage condition
riouken replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
this will make sure only vehicle's and not aircraft activate the trigger. condition: ("LandVehicle" countType thislist > 0) && count (thislist unitsBelowHeight 1) > 0 activation: {if (dammage _x > .05) then { nop = [_x] [color=#0000BB][font=monospace]execVM [/font][/color][color=#DD0000][font=monospace]"repair.sqf"};} forEach thisList;[/font][/color] -
Fill Vehicle with ammo?
riouken replied to Cards525's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm the one who wrote those scripts for the 15th. Here is an example mission(this is my new version with a gui) These have a few dependency's, like ACE and GLT. but these can easily be taken out. https://sites.google.com/site/armatutorials/home/videos/New_veh_Loadouts_ver_2.Takistan.7z?attredirects=0&d=1 Here is the old ones with just the addactions: https://sites.google.com/site/armatutorials/home/videos/truckloadouts.Takistan.zip?attredirects=0&d=1 Here is the nuts and bolts of it: (there is a lot of other code that sets all this up in the mission.) // Multi Load-out script for Vehicles. // Made for the 15th MEU(SOC) by Oliver. // Activate from trigger provided in example mission. // _truk addMagazineCargoGlobal["ACE_TOW_CSWDM",5]; // Used for adding Tow magazine, if needed by unit in the future. private ["_loader","_loadouttype","_truk","_truk_type"]; _loader = player; //if (vehicle _loader == player) exitWith{hint "Your not in a Vehicle!";}; _loadouttype = (lbCurSel 1564) + 1; _truk = vehicle _loader; _truk_type = typeof _truk; closeDialog 0; // Gambler 1 Loadout If (_loadouttype == 1) then { _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type]; sleep 3; _truk addWeaponCargoGlobal["ACE_M136_CSRS",1]; _truk addMagazineCargoGlobal["30rnd_556x45_stanag",16]; _truk addMagazineCargoGlobal["200rnd_556x45_m249",4]; _truk addMagazineCargoGlobal["HandGrenade_West",6]; _truk addMagazineCargoGlobal["ACE_Flashbang",12]; _truk addMagazineCargoGlobal["smokeshell",6]; _truk addMagazineCargoGlobal["smokeshellgreen",6]; _truk addMagazineCargoGlobal["smokeshellred",6]; _truk addMagazineCargoGlobal["1Rnd_HE_M203",6]; _truk addMagazineCargoGlobal["1rnd_smokered_m203",6]; _truk addMagazineCargoGlobal["ACE_MK19_CSWDM",4]; _truk addMagazineCargoGlobal["ACE_M2_CSWDM",4]; _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",4]; _truk addWeaponCargoGlobal["ACE_WireCutter",1]; _truk vehicleChat format ["Loading Complete %1..", _truk_type]; hint "Gambler 1 Gear Loaded"; }; // Gambler 4 Mortar Team If (_loadouttype == 2) then { _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type]; sleep 3; _truk addWeaponCargoGlobal["laserdesignator",1]; _truk addMagazineCargoGlobal["30rnd_556x45_stanag",30]; _truk addMagazineCargoGlobal["ACE_M224HE_CSWDM",100]; _truk addMagazineCargoGlobal["ACE_M224WP_CSWDM",100]; _truk addMagazineCargoGlobal["ACE_M224IL_CSWDM",100]; _truk addMagazineCargoGlobal["smokeshell",6]; _truk addMagazineCargoGlobal["smokeshellgreen",6]; _truk addMagazineCargoGlobal["smokeshellred",6]; _truk addMagazineCargoGlobal["ACE_Claymore_M",2]; _truk addMagazineCargoGlobal["laserbatteries",1]; _truk addMagazineCargoGlobal["ACE_Battery_Rangefinder",12]; _truk addWeaponCargoGlobal["binocular",1]; _truk addWeaponCargoGlobal["ACE_DAGR",1]; _truk addWeaponCargoGlobal["ACE_Rangefinder_OD",1]; _truk addWeaponCargoGlobal["ACE_WireCutter",1]; _truk addMagazineCargoGlobal["ACE_Bandage",10]; _truk addMagazineCargoGlobal["ACE_Morphine",5]; _truk addMagazineCargoGlobal["ACE_Epinephrine",5]; _truk addMagazineCargoGlobal["ACE_Medkit",5]; _truk addWeaponCargoGlobal["ACE_MX2A",1]; _truk addWeaponCargoGlobal["Laserdesignator",1]; _truk addMagazineCargoGlobal["Laserbatteries",1]; _truk addWeaponCargoGlobal["ace_arty_rangeTable_m224_legacy",2]; _truk addWeaponCargoGlobal["ACE_M224TripodProxy",1]; _truk addWeaponCargoGlobal["ACE_M224Proxy",1]; _truk vehicleChat format ["Loading Complete %1..", _truk_type]; hint "Gambler 4 Mortar Team Gear Loaded"; }; // Gambler 4 MG Team If (_loadouttype == 3) then { _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type]; sleep 3; _truk addWeaponCargoGlobal["ACE_M136_CSRS",2]; _truk addMagazineCargoGlobal["30rnd_556x45_stanag",50]; _truk addMagazineCargoGlobal["100Rnd_762x51_M240",25]; _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",4]; _truk addMagazineCargoGlobal["HandGrenade_West",12]; _truk addMagazineCargoGlobal["smokeshell",12]; _truk addMagazineCargoGlobal["smokeshellgreen",6]; _truk addMagazineCargoGlobal["smokeshellred",6]; _truk addMagazineCargoGlobal["1Rnd_HE_M203",12]; _truk addMagazineCargoGlobal["1rnd_smokered_m203",6]; _truk addMagazineCargoGlobal["1rnd_smokegreen_m203",6]; _truk addMagazineCargoGlobal["1Rnd_SmokeYellow_M203",6]; _truk addMagazineCargoGlobal["ACE_M2_CSWDM",12]; _truk addWeaponCargoGlobal["m240_scoped_ep1",1]; _truk addWeaponCargoGlobal["m240",1]; _truk addWeaponCargoGlobal["m16a2",4]; _truk addMagazineCargoGlobal["ACE_Claymore_M",4]; _truk addWeaponCargoGlobal["ACE_WireCutter",1]; _truk addMagazineCargoGlobal["ACE_Bandage",8]; _truk addMagazineCargoGlobal["ACE_Morphine",2]; _truk addMagazineCargoGlobal["ACE_Epinephrine",2]; _truk addMagazineCargoGlobal["ACE_Medkit",2]; _truk addWeaponCargoGlobal["ACE_MX2A",1]; _truk addWeaponCargoGlobal["Laserdesignator",1]; _truk addMagazineCargoGlobal["Laserbatteries",1]; _truk vehicleChat format ["Loading Complete %1..", _truk_type]; hint "Gambler 4 MG Team Gear Loaded"; }; // Gambler 4 Assault Team If (_loadouttype == 4) then { _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type]; sleep 3; _truk addMagazineCargoGlobal["30rnd_556x45_stanag",50]; _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",4]; _truk addMagazineCargoGlobal["HandGrenade_West",12]; _truk addMagazineCargoGlobal["smokeshell",12]; _truk addMagazineCargoGlobal["smokeshellgreen",6]; _truk addMagazineCargoGlobal["smokeshellred",6]; _truk addMagazineCargoGlobal["ACE_MK19_CSWDM",12]; _truk addWeaponCargoGlobal["m16a2",4]; _truk addMagazineCargoGlobal["ACE_Claymore_M",4]; _truk addMagazineCargoGlobal["ACE_C4_M",4]; _truk addWeaponCargoGlobal["ACE_WireCutter",1]; _truk addMagazineCargoGlobal["ACE_Bandage",8]; _truk addMagazineCargoGlobal["ACE_Morphine",2]; _truk addMagazineCargoGlobal["ACE_Epinephrine",2]; _truk addMagazineCargoGlobal["ACE_Medkit",2]; _truk addWeaponCargoGlobal["smaw",1]; _truk addMagazineCargoGlobal["smaw_heaa",20]; _truk addMagazineCargoGlobal["smaw_hedp",20]; _truk addMagazineCargoGlobal["ACE_SMAW_NE",20]; _truk addMagazineCargoGlobal["ACE_SMAW_Spotting",60]; _truk addWeaponCargoGlobal["ACE_MX2A",1]; _truk addWeaponCargoGlobal["Laserdesignator",1]; _truk addMagazineCargoGlobal["Laserbatteries",1]; _truk vehicleChat format ["Loading Complete %1..", _truk_type]; hint "Gambler 4 Assault Team Gear Loaded"; }; // Medical Team If (_loadouttype == 5) then { _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type]; sleep 3; _truk addMagazineCargoGlobal["30rnd_556x45_stanag",10]; _truk addMagazineCargoGlobal["smokeshell",10]; _truk addMagazineCargoGlobal["smokeshellgreen",10]; _truk addMagazineCargoGlobal["ACE_Bandage",100]; _truk addMagazineCargoGlobal["ACE_Morphine",100]; _truk addMagazineCargoGlobal["ACE_Epinephrine",100]; _truk addMagazineCargoGlobal["ACE_Medkit",100]; _truk addMagazineCargoGlobal["ACE_Bodybag",100]; _truk addMagazineCargoGlobal["ACE_Stretcher",4]; _truk vehicleChat format ["Loading Complete %1..", _truk_type]; hint "Medical Team Gear Loaded"; }; // CLB Team If (_loadouttype == 6) then { _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type]; sleep 3; _truk addWeaponCargoGlobal["ACE_M136_CSRS",1]; _truk addMagazineCargoGlobal["30rnd_556x45_stanag",16]; _truk addMagazineCargoGlobal["200rnd_556x45_m249",4]; _truk addMagazineCargoGlobal["HandGrenade_West",6]; _truk addMagazineCargoGlobal["ACE_Flashbang",6]; _truk addMagazineCargoGlobal["smokeshell",6]; _truk addMagazineCargoGlobal["smokeshellgreen",6]; _truk addMagazineCargoGlobal["smokeshellred",6]; _truk addMagazineCargoGlobal["ACE_MK19_CSWDM",4]; _truk addMagazineCargoGlobal["ACE_M2_CSWDM",4]; _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",4]; _truk addWeaponCargoGlobal["ACE_WireCutter",1]; _truk addMagazineCargoGlobal["PipeBomb",10]; _truk addMagazineCargoGlobal["ACE_C4_M",6]; _truk addMagazineCargoGlobal["ACE_ANM14",4]; _truk addMagazineCargoGlobal["ACE_M2SLAM_M",5]; _truk vehicleChat format ["Loading Complete %1..", _truk_type]; hint "Broadsword Gear Loaded"; }; // Charlie If (_loadouttype == 7) then { _truk vehicleChat format ["Loading Gear %1... Please Wait...", _truk_type]; sleep 3; _truk addWeaponCargoGlobal["ACE_M136_CSRS",1]; _truk addWeaponCargoGlobal["ACE_GlassesGasMask_US",5]; _truk addMagazineCargoGlobal["LASERBATTERIES",2]; _truk addMagazineCargoGlobal["30rnd_556x45_stanag",20]; _truk addMagazineCargoGlobal["200rnd_556x45_m249",5]; _truk addMagazineCargoGlobal["HandGrenade_West",12]; _truk addMagazineCargoGlobal["ACE_Flashbang",12]; _truk addMagazineCargoGlobal["smokeshell",6]; _truk addMagazineCargoGlobal["smokeshellgreen",6]; _truk addMagazineCargoGlobal["smokeshellred",6]; _truk addMagazineCargoGlobal["1Rnd_HE_M203",6]; _truk addMagazineCargoGlobal["1rnd_smokered_m203",6]; _truk addMagazineCargoGlobal["ACE_Battery_Rangefinder",2]; _truk addMagazineCargoGlobal["ACE_Bandage",10]; _truk addMagazineCargoGlobal["ACE_Morphine",5]; _truk addMagazineCargoGlobal["ACE_Epinephrine",5]; _truk addMagazineCargoGlobal["ACE_Medkit",5]; _truk vehicleChat format ["Loading Complete %1..", _truk_type]; hint "Highlander Gear Loaded"; }; -
High Command Module In MP
riouken replied to Kolmain's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You will lose your HC after respawn, buy you can re-sync the unit back with the HC Module with this: http://community.bistudio.com/wiki/synchronizeObjectsAdd You can create groups and add them to HC on the fly: http://community.bistudio.com/wiki/hcSetGroup In this script I am creating groups on the fly and adding them to HC for the commander.(Its not full stand alone, as there is a dialog and other parts that go with it, but you can see how it would work.) Here are some of the other HC commands: http://community.bistudio.com/wiki/hcAllGroups http://community.bistudio.com/wiki/hcGroupParams http://community.bistudio.com/wiki/hcLeader http://community.bistudio.com/wiki/hcRemoveAllGroups http://community.bistudio.com/wiki/hcRemoveGroup http://community.bistudio.com/wiki/hcSelected http://community.bistudio.com/wiki/hcSelectGroup http://community.bistudio.com/wiki/hcSetGroup http://community.bistudio.com/wiki/hcShowBar http://community.bistudio.com/wiki/hcShownBar -
dynamic marker not deleting
riouken replied to twisted's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Its because _MarkerE _markernameSPAWN are local references/variable's to the marker you created. Also not only are your var local to that instance of your script they are local to each scope, ie.. each if statement since you define them in there. http://community.bistudio.com/wiki/Variables#Namespace once you create the marker and then your script closes those local var are deleted. So when you call this script again with different input those references are no longer valid. You need to either make those makernames global(not recommended) or save the marker refrences to an array and then select them out of that array when you recall your script. -
Help For Machinima Recording Multiple Reruns of Multiple Angles
riouken replied to krytosss's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I would use sumatras sleep example, you will be able to dial in your conversations better. You can sleep for fractions of a second. Sleep 0.5; But irc the time command returns the time in seconds rounded off to the nearest second. I could be wrong but even if I am, the sleep command is just pausing the script, where as calling the time command in each cycle in a waituntil. I think the sleep would be less likley to get out of sync if the schedular starts to run behind. -
Advanced Help Needed (Tire and Fuel Randomization)
riouken replied to halex1316's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If you search google with "arma jerry can" this is the first link http://forums.bistudio.com/showthread.php?136552-Refueling-with-Jerry-can-problems-Trigger-not-attaching-to-vehicle There are atleast 5 other links that deal with it as well. I don't know why people have such a hard time finding stuff. -
Bad Benson, You will need to have a small amount of knowlage or be able to follow some sql setup guides. It can be ran on your local computer. If that's what your after I recomend: http://www.apachefriends.org/en/xampp-windows.html Xampp is what I use to test our dev locally before we push it to the dedi. It has mysql and phpadmin. The example mission is for weapon loadouts, it does not save your gear and then reload it when you connect. Its for users to make diffrent loadouts and they are saved to the database. They can then select and use them from the interface. You should take a look at the mso Jman linked too above it has a lot of the features your talking about. This is more of the base tool, for mission makers to build off of and provide persistiance in there missions.
-
How to make draggable image in a dialog with limited moving borders.
riouken replied to DZR_Mikhail's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Those are set up as objects within a dialog... like the map. Take a look here: http://community.bistudio.com/wiki/DialogControls-Objects -
add new abilities with backpacks
riouken replied to twisted's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You should take a look at Domination it has a bunch of stuff like that. For example here is the script for creating an MG nest for MG'rs. x_mgnest.sqf from Domination. // by Xeno #define THIS_FILE "x_mgnest.sqf" #include "x_setup.sqf" private ["_dir_to_set","_m_name","_marker","_d_mgnest_pos","_exit_it"]; if ((player call FUNC(GetHeight)) > 5) exitWith {"You must be kidding..." call FUNC(GlobalChat)}; _d_mgnest_pos = __pGetVar(GVAR(mgnest_pos)); if (count _d_mgnest_pos > 0) exitWith {"You have allready placed a mg nest. You have to remove it to build a new one." call FUNC(GlobalChat)}; _d_mgnest_pos = player modeltoworld [0,2,0]; _d_mgnest_pos set [2,0]; if (surfaceIsWater [_d_mgnest_pos select 0, _d_mgnest_pos select 1]) exitWith { "It is not possible to place a mg nest into water." call FUNC(GlobalChat); }; _exit_it = false; if (GVAR(with_ranked)) then { if (score player < (GVAR(ranked_a) select 14)) then { (format ["You need %2 points to build a mg nest. Your current score is: %1", score player,(GVAR(ranked_a) select 14)]) call FUNC(HQChat); _exit_it = true; }; }; if (_exit_it) exitWith {}; _helper1 = GVAR(HeliHEmpty) createVehicleLocal [_d_mgnest_pos select 0, (_d_mgnest_pos select 1) + 4, 0]; _helper2 = GVAR(HeliHEmpty) createVehicleLocal [_d_mgnest_pos select 0, (_d_mgnest_pos select 1) - 4, 0]; _helper3 = GVAR(HeliHEmpty) createVehicleLocal [(_d_mgnest_pos select 0) + 4, _d_mgnest_pos select 1, 0]; _helper4 = GVAR(HeliHEmpty) createVehicleLocal [(_d_mgnest_pos select 0) - 4, _d_mgnest_pos select 1, 0]; _exit_it = false; if ((abs (((getPosASL _helper1) select 2) - ((getPosASL _helper2) select 2)) > 2) || (abs (((getPosASL _helper3) select 2) - ((getPosASL _helper4) select 2)) > 2)) then { "Place not valid. Try another location to place the mg nest." call FUNC(GlobalChat); _exit_it = true; }; for "_mt" from 1 to 4 do {call compile format ["deleteVehicle _helper%1;", _mt]}; if (_exit_it) exitWith {}; if (GVAR(with_ranked)) then {[QGVAR(pas), [player, (GVAR(ranked_a) select 14) * -1]] call FUNC(NetCallEvent)}; player playMove "AinvPknlMstpSlayWrflDnon_medic"; sleep 3; waitUntil {animationState player != "AinvPknlMstpSlayWrflDnon_medic"}; if (!alive player) exitWith {"You died before your MG nest was ready." call FUNC(GlobalChat)}; _dir_to_set = getdir player; _mg_nest = createVehicle [GVAR(mg_nest), _d_mgnest_pos, [], 0, "NONE"]; _mg_nest setdir _dir_to_set; _mg_nest setPos _d_mgnest_pos; [_mg_nest, 0] call FUNC(SetHeight); __pSetVar ["mg_nest", _mg_nest]; player reveal _mg_nest; _d_mgnest_pos = position _mg_nest; __pSetVar [QGVAR(mgnest_pos), _d_mgnest_pos]; "MG Nest ready." call FUNC(GlobalChat); _m_name = "MG Nest " + GVAR(string_player); [QGVAR(p_o_a), [GVAR(string_player), [_mg_nest,_m_name,GVAR(name_pl),GVAR(player_side)]]] call FUNC(NetCallEvent); _mg_nest addAction ["Remove MG Nest" call FUNC(RedText),"x_client\x_removemgnest.sqf",[],-1,false,true,"","vehicle player == player"]; player moveInGunner _mg_nest; -
add new abilities with backpacks
riouken replied to twisted's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
A good place to start would be the wiki: http://community.bistudio.com/wiki/unitBackpack http://community.bistudio.com/wiki/ArmA_2_OA:_Backpacks -
help with debug marker
riouken replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I didn't test it but it should be close. But you really need to rethink all those spawns. You should pre-compile most of this and just call it. But you really shouldn't worry about that now, you need to take a look at how other scripts are structured and executed. You really need to understand the logic behind making scripting/programming work... http://community.bistudio.com/wiki/Control_Structures I would suggest you read through that and play around with simple examples of each one. JetMapPatrol ={ //hint "spawn a10"; _debug = true; _grp = createGroup east; _a10 = createVehicle ["Su34", getmarkerpos "Enemy_Airport", [], 250, "FLY"]; _a10 setDir 290; _dir = 290; _speed = 500; _a10 setVelocity [(sin _dir * _speed),(cos _dir * _speed), 0]; _a10 addEventHandler["killed", { (_this select 0) spawn JetDeathLoop; }]; //create pilot and move in plane _pilot = _grp createUnit ["RU_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"]; _pilot moveInDriver _a10; _pilot = driver _a10; _pilot setskill 1; _wp1 = _grp addWaypoint [getPos eair1, 0]; [_grp, 0] setWaypointType "SAD"; [_grp, 0] setWaypointCompletionRadius 200; _wp2 = _grp addWaypoint [getPos eair2, 1]; [_grp, 1] setWaypointType "SAD"; [_grp, 1] setWaypointCompletionRadius 200; _wp3 = _grp addWaypoint [getPos eair3, 2]; [_grp, 2] setWaypointType "SAD"; [_grp, 2] setWaypointCompletionRadius 200; _wp4 = _grp addWaypoint [getPos eair4, 3]; _wp4 setWaypointType "CYCLE"; _wp4 setWaypointCompletionRadius 200; [color=#ff0000] ////////=====> now the debug code <==////////////////////////////////////////////////////////////////////////[/color] [color=#ff0000] if(_debug) then { [/color] [color=#ff0000] hint "debug aircraft"; [/color] [color=#ff0000] markerfollow = {[/color] [color=#ff0000] _plane = _this select 0; [/color] [color=#ff0000] while {alive _plane} do [/color] [color=#ff0000] {[/color] [color=#ff0000] "debugjet" setMarkerPos getPosATL _plane;[/color] [color=#ff0000] sleep .5;[/color] [color=#ff0000] };[/color] [color=#ff0000] };[/color] [color=#ff0000] [/color] [color=#ff0000] _handle = [_a10] spawn markerfollow;[/color] [color=#ff0000] }; [/color] }; -
help with debug marker
riouken replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Please post e_air.sqf, but the problem is on or around line 32 of that script. It appears to be something wrong with your string statement. We wont know till we can take a look.