riouken
Member-
Content Count
570 -
Joined
-
Last visited
-
Medals
Everything posted by riouken
-
call bis_fnc_taskPatrol globally for every unit
riouken replied to katipo66's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I dont think you can change the waypoint speed with out editing the function. But you could try this ( Im not sure if this will work but its worth a shot.) _sm = ["LIMITED","NORMAL","FULL"]; { _dist = (floor(random 950)) + 50; [_x, (getPos(leader _x)), _dist] call bis_fnc_taskPatrol; _spd = (_sm select (floor(random 2))); _x setSpeedMode _spd; } forEach allGroups; fyi setSpeedMode -
call bis_fnc_taskPatrol globally for every unit
riouken replied to katipo66's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No problem. If you want to randomize the distance for each group you could do this: { _dist = (floor(random 950)) + 50; [_x, (getPos(leader _x)), _dist] call bis_fnc_taskPatrol; } forEach allGroups; That will give you give you a min patrol distance of 50 m. and a max of 1000 m. -
call bis_fnc_taskPatrol globally for every unit
riouken replied to katipo66's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It is group based but yes you could use allGroups and apply it to each one. ------------------------------------------------ This is not tested but something like this should work. { [_x, (getPos(leader _x)), 1000] call bis_fnc_taskPatrol; } forEach allGroups; -
Several editing problems (ACM and rearming)
riouken replied to helling3r's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You cant call mission peramiters directly like that, select them first and assign them to a var. Then you can use the info from them. example: init.sqf mymissionvar = paramsArray select 1; [mymissionvar, BIS_ACM1] call BIS_ACM_setIntensityFunc; Just use paramsArray select 0 (Red number is what ever index in the paramsArray your peramiter is. -
General script for Teleport
riouken replied to Thamu's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You need to use the argument parameters for addAction's. this addAction ["Go to Arty Field","teleport.sqf",1]; this addAction ["Go to Mars","teleport.sqf",2]; this addAction ["Go Home","teleport.sqf",3]; then in teleport.sqf: _telepos = _this select 3; switch (true) do { case (_telepos == 1) : { player setPos (getPos base1);}; case (_telepos == 2) : { player setPos (getPos tank_battle);}; case (_telepos == 3) : { player setPos (getPos campo_tiro2);}; default {hint "Please select a location.";}; }; ------ Lol too slow, thats what I get for afking during my post. -
Problem with the condition in addAction
riouken replied to fusionofp's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The condition field is very picky about code from my experience, try using the special caller var for addActions "_this" -- or use "_target" if it will be attached to the player. "(count (nearestObjects [[color="Red"]_this[/color], [""mine""], 2])) != 0" also please use blocks for your code, it makes it so much easier to read. -
Query user created map markers in MP
riouken replied to VictorFarbau's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You might want to take a look in the MSO missions. There is a support feature for JIP Markers that are persistent. I dont know if it is exactly what your looking for but it may give you some inspiration. -
Create custom unit on trigger activation
riouken replied to last_apoc's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You should look at using this: BIS_fnc_spawnGroup Make sure you put a functions module down on your map. On Trigger Act. mycustomplanegrp = [getMarkerPos "myplanespwn", east, ["myplane"]] call BIS_fnc_spawnGroup; -
call BIS_fnc_spawnVehicle;
riouken replied to dale0404's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I have used BIS_fbc_spawnGroup to spawn Addon vehicles manned so I would venture to say yes you can use BIS_fbc_spawnVehicle to do that as well. I have just not tested it. -
Only Pilots can Fly,Only Crewman can Crew
riouken replied to sgt_hawkins's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It is local: It uses the multi-player framework. Quote from there: All hints are local. But with the multi player framework you can remotely execute the hints on other clients based of the conditions that you set. But in this case it is local to the pilot of the veh. I just like to use "RE" for all my hints in multi-player to avoid locality problems. -
Odd helicopter extraction bug
riouken replied to acoustic's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If you would take the time to read the first post in the thread I linked you you would see that this is in fact a "script" package. From one of the best scripters in this community. His solution does work(I use it all the time in some of my missions.) I was being nice, but your thread is pointless becasue if you would have used the Search ; the first three threads give you more information on this topic than you can probably digest. -
Odd helicopter extraction bug
riouken replied to acoustic's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You might want to look at this script. http://forums.bistudio.com/showthread.php?t=106653 getting the AI to fly correctly is very difficult. -
Weaponholder Multiplayer Synchronisation
riouken replied to abdecken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You need to use addWeaponCargoGlobal now in multi player so that it syncs with all clients. Thats why its doing that. Any object added after mission start, in or out of a cargo space, then you need to use the new Global commands to make sure what ever is taken or placed is synchronized across all clients. -
How do I activate Init.sqf?
riouken replied to failtolawl's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Are you trying this from the editor? If so hold Shift and press preview to view then briefing in the editor. -
AI Rooftop Insertion
riouken replied to Cpt.Mouse's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
First you will need a bottle of vodka, Then you will need a big hammer... Ok just kidding, but seriously your in for a whole lot of frustration. AI + Pilot does not equal precision flying lol. My best guess would be to try using an invisible H-pad on top of the roof. Do a search for heli insertion and you will see a lot of examples of hot lz AI heli insertions. I would take one of those and adapt it to work for you. -
The best approach...
riouken replied to Kolmain's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yes, test it out, its a bit touchy to get working(just remember your code has to return either true or false.) but once you get it going it works great. Just think of it like a trigger condition field. -
Zone restriction
riouken replied to bulletoothdan's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
What you looking for is either DAC or MSO. DAC and here MSO and here -
The best approach...
riouken replied to Kolmain's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Add the actions from the start but use the condition feature with the addAction to only show them when you need them. You could probably just use a variable, if its true show the action if false dont show. -
Only Pilots can Fly,Only Crewman can Crew
riouken replied to sgt_hawkins's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If you just need it for a few vehicles then you can use this set up I made. Its really simple. Make sure you have a functions module down for the rHint's. I made this for a helo but you can change it to suit your needs. In the init an array of your allowed crew. init.sqf: h1pilots = [p2,p3,p4]; create a trigger set on repeated activation. In the condition field: (h1 is the name of the vehicle) !isNull driver h1 in the onactivation field: drivr = driver h1;if !((driver h1) in h1pilots) then {drivr action ["eject", h1];[nil,drivr,"loc",rHINT,"You cannot operate this vehicle."] call RE;}; If you use ACE then use this: drivr = driver h1;if !((driver h1) in h1pilots) then { [h1, drivr] execVM "x\ace\addons\sys_eject\jumpout.sqf";[nil,drivr,"loc",rHINT,"You cannot operate this vehicle."] call RE;}; Now this is really just best for a few vehicles and simple set ups, but it does work in in mp and it will even work for re-spawning vehicles if you use a script like simple vehicle re-spawn that sets the name back to the same. -
Keeping Practice Targets down until activated
riouken replied to bigshotking's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
He probably thought that because you said you were wanting them to pop up. You could probably script something to work using normal targets but it would be a lot easier if you use popup targets. Here is a script that will work for you if you use popup targets: rco2 is the name of what ever object or person you want the actions on. init.sqf: rco2 addAction ["Hogans Alley Lane 1 Up","popup.sqf",1]; rco2 addAction ["Hogans Alley Lane 2 Up","popup.sqf",2]; rco2 addAction ["Hogans Alley Lane 3 Up","popup.sqf",3]; rco2 addAction ["Hogans Alley Lane 4 Up","popup.sqf",4]; rco2 addAction ["Hogans Alley Lane 5 Up","popup.sqf",5]; rco2 addAction ["Hogans Alley Lane 1 Down","popup.sqf",6]; rco2 addAction ["Hogans Alley Lane 2 Down","popup.sqf",7]; rco2 addAction ["Hogans Alley Lane 3 Down","popup.sqf",8]; rco2 addAction ["Hogans Alley Lane 4 Down","popup.sqf",9]; rco2 addAction ["Hogans Alley Lane 5 Down","popup.sqf",10]; popup.sqf // Put your Target names in these arrays. One array for each firing "Lane" or group. _targets0 = [t_1_1,t_1_2,t_1_3,t_1_4,t_1_5,t_1_6,t_1_7,t_1_8,t_ 1_9,t_1_10,t_1_11,t_1_12,t_1_13,t_1_14,t_1_15,t_1_ 16,t_1_17,t_1_18,t_1_19,t_1_20,t_1_21,t_1_22,t_1_2 3,t_1_24]; _targets1 = [t_1_1_1,t_1_2_1,t_1_3_1,t_1_4_1,t_1_5_1,t_1_6_1,t_ 1_7_1,t_1_8_1,t_1_9_1,t_1_10_1,t_1_11_1,t_1_12_1,t _1_13_1,t_1_14_1,t_1_15_1,t_1_16_1,t_1_17_1,t_1_18 _1,t_1_19_1,t_1_20_1,t_1_21_1,t_1_22_1,t_1_23_1,t_ 1_24_1]; _targets2 = [t_1_1_2,t_1_2_2,t_1_3_2,t_1_4_2,t_1_5_2,t_1_6_2,t_ 1_7_2,t_1_8_2,t_1_9_2,t_1_10_2,t_1_11_2,t_1_12_2,t _1_13_2,t_1_14_2,t_1_15_2,t_1_16_2,t_1_17_2,t_1_18 _2,t_1_19_2,t_1_20_2,t_1_21_2,t_1_22_2,t_1_23_2,t_ 1_24_2]; _targets3 = [t_1_1_3,t_1_2_3,t_1_3_3,t_1_4_3,t_1_5_3,t_1_6_3,t_ 1_7_3,t_1_8_3,t_1_9_3,t_1_10_3,t_1_11_3,t_1_12_3,t _1_13_3,t_1_14_3,t_1_15_3,t_1_16_3,t_1_17_3,t_1_18 _3,t_1_19_3,t_1_20_3,t_1_21_3,t_1_22_3,t_1_23_3,t_ 1_24_3]; _targets4 = [t_1_1_4,t_1_2_4,t_1_3_4,t_1_4_4,t_1_5_4,t_1_6_4,t_ 1_7_4,t_1_8_4,t_1_9_4,t_1_10_4,t_1_11_4,t_1_12_4,t _1_13_4,t_1_14_4,t_1_15_4,t_1_16_4,t_1_17_4,t_1_18 _4,t_1_19_4,t_1_20_4,t_1_21_4,t_1_22_4,t_1_23_4,t_ 1_24_4]; _lane = _this select 3; // Lane 0 Up If (_lane == 1) then { {_x animate["terc", 0];} forEach _targets0;}; // Lane 1 Up If (_lane == 2) then { {_x animate["terc", 0];} forEach _targets1;}; // Lane 2 Up If (_lane == 3) then { {_x animate["terc", 0];} forEach _targets2;}; // Lane 3 Up If (_lane == 4) then { {_x animate["terc", 0];} forEach _targets3;}; // Lane 4 Up If (_lane == 5) then { {_x animate["terc", 0];} forEach _targets4;}; // Lane 0 Down If (_lane == 6) then { {_x animate["terc", 1];} forEach _targets0;}; // Lane 1 Down If (_lane == 7) then { {_x animate["terc", 1];} forEach _targets1;}; // Lane 2 Down If (_lane == 8) then { {_x animate["terc", 1];} forEach _targets2;}; // Lane 3 Down If (_lane == 9) then { {_x animate["terc", 1];} forEach _targets3;}; // Lane 4 Down If (_lane == 10) then { {_x animate["terc", 1];} forEach _targets4;}; In the init lines of one (Just one) of the popup targets: nopop = true; -
Zone restriction
riouken replied to bulletoothdan's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Create an array in your init.sqf with the names of the allowed memebers. zrgrp = [guys,that,are,allowed]; Set up the trigger to activated repeatedly for everyone. that covers the area you want to restrict. In the on activation of the trigger: {if (_x !(in zrgrp)) then {_x setpos [pos,where,they should go];};} forEach thisList; This is not tested but should work. -
Change a public Variable
riouken replied to unknownx9's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You make variable's private to keep them from corrupting other variables in the same script but in a different scope if (blabla) then { private "_myLocalVariable"; _myLocalVariable = "this and that"; }; This does work, you must be having some other type of error. Please post your whole script so we can view it. set in script1.sqf globalVariable = 0; in script2.sqf its changed with: globalVariable = 1; -
Createvehicle through IsServer, Addaction to object so player can use JIP HELP!
riouken replied to daimyo21's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Change this: [] spawn { waituntil {!isnil "SHK_pv_foodAction";}; { _x addAction[("<t color=""#FF0000"">" + ("Take Food!") +"</t>"),"example_scripts\take_food.sqf", [], 1, false, false, "", ""]; } foreach SHK_pv_foodAction; }; To this: [] spawn { waituntil {!isnil "SHK_pv_foodAction";}; [color="Red"] {[nil, _x, "per", rADDACTION, ("<t color=""#0F81EB"">" + ("Take Water!") +"</t>"),"example_scripts\take_water.sqf", [], 1, false, false, "", ""] call RE;} foreach SHK_pv_foodAction[/color]; }; -
Resource CommanderVoteMenu not found...
riouken replied to SysterYster's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Forgive me, but why are you trying to put an un-pbo'd editor module in your mission folder? If you want to use the warfare interface, you know you can just drop the module in in the editor right? -
Several editing problems (ACM and rearming)
riouken replied to helling3r's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
#1. Im not sure about this I have never used the ACM, But I was under the impression that it did not work in multilayer. #2. The Support trucks have always been very problematic to use. I dont bother with them, I just use a script to do the same task. Here is xeno's great script for this: Just put a trigger down over your heli pad. In the condition: ("Helicopter" countType thislist > 0) && count (thislist unitsBelowHeight 1) > 0 onactivation: nul0 = [(thislist select 0)] execVM "x_reload.sqf"; x_reload.sqf : // by Xeno private ["_config","_count","_i","_magazines","_object","_type","_type_name"]; _object = _this select 0; _type = typeof _object; if (_object isKindOf "ParachuteBase") exitWith {}; if (isNil "x_reload_time_factor") then {x_reload_time_factor = 1;}; //if (!local _object) exitWith {}; if (!alive _object) exitWith {}; _object setFuel 0; _object setVehicleAmmo 1; // Reload turrets / drivers magazine _type_name = typeOf _object; _object vehicleChat format ["Servicing %1... Please stand by...", _type]; _magazines = getArray(configFile >> "CfgVehicles" >> _type >> "magazines"); if (count _magazines > 0) then { _removed = []; { if (!(_x in _removed)) then { _object removeMagazines _x; _removed = _removed + [_x]; }; } forEach _magazines; { _object vehicleChat format ["Reloading %1", _x]; sleep x_reload_time_factor; if (!alive _object) exitWith {}; _object addMagazine _x; } forEach _magazines; }; _count = count (configFile >> "CfgVehicles" >> _type >> "Turrets"); if (_count > 0) then { for "_i" from 0 to (_count - 1) do { scopeName "xx_reload2_xx"; _config = (configFile >> "CfgVehicles" >> _type >> "Turrets") select _i; _magazines = getArray(_config >> "magazines"); _removed = []; { if (!(_x in _removed)) then { _object removeMagazines _x; _removed = _removed + [_x]; }; } forEach _magazines; { _object vehicleChat format ["Reloading %1", _x]; sleep x_reload_time_factor; if (!alive _object) then {breakOut "xx_reload2_xx"}; _object addMagazine _x; sleep x_reload_time_factor; if (!alive _object) then {breakOut "xx_reload2_xx"}; } forEach _magazines; // check if the main turret has other turrets _count_other = count (_config >> "Turrets"); // this code doesn't work, it's not possible to load turrets that are part of another turret :( // nevertheless, I leave it here if (_count_other > 0) then { for "_i" from 0 to (_count_other - 1) do { _config2 = (_config >> "Turrets") select _i; _magazines = getArray(_config2 >> "magazines"); _removed = []; { if (!(_x in _removed)) then { _object removeMagazines _x; _removed = _removed + [_x]; }; } forEach _magazines; { _object vehicleChat format ["Reloading %1", _x]; sleep x_reload_time_factor; if (!alive _object) then {breakOut "xx_reload2_xx"}; _object addMagazine _x; sleep x_reload_time_factor; if (!alive _object) then {breakOut "xx_reload2_xx"}; } forEach _magazines; }; }; }; }; _object setVehicleAmmo 1; // Reload turrets / drivers magazine sleep x_reload_time_factor; if (!alive _object) exitWith {}; _object vehicleChat "Repairing..."; _object setDamage 0; sleep x_reload_time_factor; if (!alive _object) exitWith {}; _object vehicleChat "Refueling..."; while {fuel _object < 0.99} do { //_object setFuel ((fuel _vehicle + 0.1) min 1); _object setFuel 1; sleep 0.01; }; sleep x_reload_time_factor; if (!alive _object) exitWith {}; _object vehicleChat format ["%1 is ready...", _type_name]; if (true) exitWith {};