riouken
Member-
Content Count
570 -
Joined
-
Last visited
-
Medals
Everything posted by riouken
-
Change a public Variable
riouken replied to unknownx9's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I think you miss-understand how publicVariable works. All variables are either local or global there are no "true" public variable's in arma. global _local The command publicVariable just broadcasts a variable across the network. ie... If you change your global variable on one machine you have to tell all the others about the change. publicVaraible is how you do that. http://community.bistudio.com/wiki/Variables http://community.bistudio.com/wiki/publicVariable -
Broadcast MP messages
riouken replied to RonnieJ's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Just use a regular trigger. Hint is a local command. It will only work where the hint is local. Triggers are created for the server and the client. Triggers are set off locally. It will get executed on the client and the server. But the hint will do nothing on the server. This is a good thread on this subject to help you under stand more: http://forums.bistudio.com/showthread.php?t=96812 -
insertions in exec "ca\*;.....
riouken replied to pch91's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If you have combined opps, in your base arma 2 folder: common\air2.pbo I dont remember where it was in stand alone arma 2. -
Combat range/MOUT courses
riouken replied to bulletoothdan's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here are some posts that I made, all include examples of popup scripts and controlling them. http://forums.bistudio.com/showpost.php?p=1900882&postcount=12 http://forums.bistudio.com/showpost.php?p=1902405&postcount=14 http://forums.bistudio.com/showpost.php?p=1890005&postcount=3 If you have any questions feel free to ask. -
Unit Init GroupCommands
riouken replied to Skagget's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If your doing it for player controlled units, you can put it in a simple script and execute it like this: init.sqf execVM "myscript.sqf"; That will get executed on everyones client. If you wanted to do something to all units you could use this array: allUnits {removeAllWeapons _x;} forEach allUnits; You could do that in the init.sqf or a trigger or an object init. -
Where should i start?
riouken replied to Psychology's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here is some more helpful links: http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2 This is a great guide to get you started, its for Arma 1 but most of it is still relavent: http://www.armaholic.com/page.php?id=4847 This is where I started. As to what type of missions to start on. Make something you would like to play:). Its really up to you. -
Spawning Enemies at different specific locations.
riouken replied to Easelm's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Start this from a trigger or how ever you would like warp.sqf // List of markers _markers = [markr1,markr2,markr3,etc]; // List of units preplaced in the editor. _unitstowrp = [u1,u2,u3,etc]; //get random place to "warp" or set their position _pos = (getMarkerPos (_markers select (floor(random(count _markers))))); //set each units positions. {_x setPos _pos;} forEach _unitstowrp; -
Money System again.
riouken replied to Horner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
in the error if statement your sending the chat to - player1 and your adding the weapon to - civ_1 -
Random Smoke with markers
riouken replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Should be: CreateVehicle _pos Also a marker pos does not have a z location so make sure you set it to 0 for the create vehicle command. [_pos select 0,_pos select 1, 0] -
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
Dont add the addaction like that in the script use this command to set the init field of the object it will be global then. http://community.bistudio.com/wiki/setVehicleInit food1="land_basket_ep1" createVehicle getpos _nobject; _genfood = position _nobject nearestobject "land_basket_ep1"; _genfood="land_basket_ep1" createvehicle getpos _nobject; _genfood setPos (_nobject buildingpos (random 20)); [color="Red"]_genfood setVehicleInit "this addAction[("<t color=""#FF0000"">" + ("Take Food!") +"</t>"),"example_scripts\take_food.sqf";" processInitCommands [/color] -
Createvehicle (server) then adding addaction for all players
riouken replied to coderedfox's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Use createVehicle_array when creating vehicles on the server. It will be local to the server, But everyone will see it. If your having further problems post up what you have and we can probably help you a lot better. -
Spawning Enemies at different specific locations.
riouken replied to Easelm's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here is an example from one of my missions. // Array of markers pre placed in the editor at diffrent locations. _markers = ["m1", "m2", "m3","m4","m5","m6","m7","m8","m9","m10","m11","m12","m13","m14","m15","m16","m17","m18","m19""m20""m21","m22","m23","m24","m25"]; /// Pick some random positions out of our markers to spawn the bad guys _pos = (getMarkerPos (_markers select (floor(random(count _markers))))); _pos2 = (getMarkerPos (_markers select (floor(random(count _markers))))); _pos3 = (getMarkerPos (_markers select (floor(random(count _markers))))); _pos4 = (getMarkerPos (_markers select (floor(random(count _markers))))); // Spawn the groups grp1 = [_pos, east, ["TK_INS_Soldier_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_EP1"]] call BIS_fnc_spawnGroup; grp2 = [_pos2, east, ["TK_INS_Soldier_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_EP1"]] call BIS_fnc_spawnGroup; grp3 = [_pos3, east, ["TK_INS_Soldier_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_EP1"]] call BIS_fnc_spawnGroup; grp8 = [_pos4, east, ["TK_INS_Soldier_EP1","TK_INS_Soldier_EP1","TK_INS_Soldier_EP1"]] call BIS_fnc_spawnGroup; // Place three of the groups into building positions. grp1 execVM "PlaceInBuilding.sqf"; grp2 execVM "PlaceInBuilding.sqf"; grp3 execVM "PlaceInBuilding.sqf"; // Have the last group start patroling from the center of the area (Marker 24) [grp8, getMarkerPos "m24",75 ] call bis_fnc_taskPatrol; Commands you should look at: http://community.bistudio.com/wiki/Category:ArmA_2:_Functions http://community.bistudio.com/wiki/addWaypoint -
For-Loop inside of a forEach loop
riouken replied to riouken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
@gammadust I use ACE, in there backpack system, when I pull a players backpack contents I get a multidimensional array, like this: [["30Rnd_556x45_Stanag",2],["SmokeShell",1],["HandGrenade_West",1]] Now for my addon I need to convert that into a single regular array, so I need to turn the above into this: ["30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","SmokeShell","HandGrenade_West"] My code that I posted in my first post works, after the simple syntax error was corrected. We kind of veired off talking about one of the other problems I had as well, that was posted in another thread. Sorry for the confusion. Here is a confirmed working script: _MagazinesRuckList = [p1] call ACE_fnc_RuckMagazineslist; _tempRuckMagList = []; { _tempnum = _x select 1; _tempclass = _x select 0; for [{_i=0}, {_i<_tempnum}, {_i=_i+1}] do { _tempRuckMagList = _tempRuckMagList + [_tempclass]; }; } forEach _MagazinesRuckList; _string = ""; for "_i" from 0 to (count _tempRuckMagList) -1 do { if (_i == ((count _tempRuckMagList) -1)) then { _string1 = format ["""%1""", _tempRuckMagList select _i]; _string = _string + _string1; }else { _string1 = format ["""%1"",", _tempRuckMagList select _i]; _string = _string + _string1; }; }; Hint "You can now tab out and copy this to the userconfig file."; copyToClipboard _string; This script pulls the users backpack data converts the array and strings the data into a format that I can use, and copies it to the clipboard. -
For-Loop inside of a forEach loop
riouken posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I am trying to convert a multi-dimensional array to a normal array dynamically( I dont know how big each array will be) Ie. Turn this: [["30Rnd_556x45_Stanag",2],["SmokeShell",1],["HandGrenade_West",1]] Into this: ["30Rnd_556x45_Stanag","30Rnd_556x45_Stanag","SmokeShell","HandGrenade_West"] I tried doing it this way: _MagazinesRuckList = [["30Rnd_556x45_Stanag",2],["SmokeShell",1],["HandGrenade_West",1]] _tempRuckMagList = []; { _tempnum = _x select 1; _tempclass = _x select 0; for [{_i=0}, {_i<_tempnum}, {_i=_i+1}] do { _tempRuckMagList + [_tempclass]; }; } forEach _MagazinesRuckList; It does not return an error in the rpt, but it just returns an empty array. Anyone have any ideas? Thanks in advance. -
For-Loop inside of a forEach loop
riouken replied to riouken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
@Demonized Yes that is exactly what I did to get it working, Sorry I didn't update it sooner, Got it working earlier tonight. @Gamadust unfortunately that will not work, that will only give you one mag, it needs to be iterated over each inner array. to change it into a normal array, then I am producing a formated string, just like in Demonized's example above. Thanks for all the help guys, I have it working now! . -
For-Loop inside of a forEach loop
riouken replied to riouken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Sweet Deadfast, I didn't think of trying triple quotes, lol I used "","""","''" but not """""" Let me go test this out Thanks -
For-Loop inside of a forEach loop
riouken replied to riouken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yea Demonized I use if statments and forEach a ton in my loadout script, thats pretty much how im handling everything. This is how I have to have my userconfig setup: RSLO_lo2_weapons_user[] = {"ACE_M4A1_ACOG","ACE_BackPack_ACR_FL"}; this will import into the game as a normal array: ["ACE_M4A1_ACOG","ACE_BackPack_ACR_FL"] normaly when you pull your list of weapons you get an array like this: ["ACE_M4A1_ACOG","ACE_BackPack_ACR_FL"] But in my config It cant have the [] around it. So im trying to format that all out so that when its copied to the clipboard the user can just directly paste it into the userconfig. with out haveing to delete the []. Lol I have spent several hours(and i havent solved it yet) on trying to save them 2 seconds. -
For-Loop inside of a forEach loop
riouken replied to riouken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks but, Sorry Im not quite following why thats more efficient. It counts the array each time. -
For-Loop inside of a forEach loop
riouken replied to riouken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
We have close to 100 people in our unit and 65+ plus show up for our unit events. Our command staff and Mission team has enough work with just planning and making the missions, and mission conditions can change, resulting in gear changes. That becomes a real challenge for our mission team to keep a list like that up to date. And that does not count for last minute changes to gear if there was a mistake, etc... You are right my addon uses a userconfig for the user loadouts. That way instead of sending the array to the mission maker they just copy it into their userconfig. I am also allowing three loadouts to select from. So far I have the loadouts working great, Im just working on how the user will get the arrays to copy into their userconfig. as to the strings: I am using this: thearray = ["mygun1","mygun2","mygun3"]; _string = ""; for "_i" from 0 to (count thearray) -1 do { if (_i == ((count thearray) -1)) then { _string1 = format ["%1", thearray select _i]; _string = _string + _string1; }else { _string1 = format ["%1,", thearray select _i]; _string = _string + _string1; }; }; copyToClipboard _string; I need it to out put this: "mygun1","mygun2","mygun3" but its giving me this: mygun1,mygun2,mygun3 I tried using ( "'%1'" ) single quotes but the game will not accept that when i import it back in. It has to be wrapped in ""; -
For-Loop inside of a forEach loop
riouken replied to riouken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks the project I am working on was inspired by your loadout script. I am working on an addon version that will off load all the work from the mission maker to the end user. But still let the mission maker keep control over what users can have. I have most everything working now. I am just trying to make the enduser experience as easy as possible. I have the above problem solved. I am just still having a problem with this: http://forums.bistudio.com/showthread.php?t=118498 Its chopping off the "" from my stringed array and i need those there for the weapon classnames. -
For-Loop inside of a forEach loop
riouken replied to riouken's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks man, I have been looking at this so long i missed that error. -
Delete units from an unused side mission?
riouken replied to stephen271276's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This will be a little slow and resource intensive, but it will work if you dont know the names of the units. {if (side _x == East) && ((_x distance _mysidemisson) < 100) then {deleteVehicle _x;};} forEach allUnits; A better way would be to name the objects in the editor, then make an array with their names. _my_SM_array = [b1,b2,b3,etc..]; {deleteVehicle _x;} forEach _my_SM_array; -
ACE 1.10 (Advanced Combat Enviroment) for OA/CO
riouken replied to AnimalMother92's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Are these called just like (ACE_fnc_RuckMagazinesList)? I tried to use ACE_fnc_RuckMagazines but it does not seem to be returning anything. -
ACE 1.10 (Advanced Combat Enviroment) for OA/CO
riouken replied to AnimalMother92's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
I need to get an single dimensional array of the ruck contents. The normal function(ACE_fnc_RuckMagazinesList) returns a multidimensional array: [["30Rnd_556x45_Stanag",6],["SmokeShell",1],["HandGrenade_West",4]] I found this function for ACE 1: http://community.bistudio.com/wiki/ACE_Features#Rucksack_System but it does not work in ACE2. Is there another function I can use to get a normal array of the ruck contents with out resorting to converting the multidimensional array with a complicated format string? -
Domination question..
riouken replied to Dreadnaught396's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If you post in this thread Im sure one of those guys will give you a copy of one of their domi's. http://forums.bistudio.com/showthread.php?t=104827&highlight=Domination I would give you one but I have not updated our domi in a few months because we have been running a MSO mission on our public server instead on domi.