riouken
Member-
Content Count
570 -
Joined
-
Last visited
-
Medals
Everything posted by riouken
-
Arma 2/ OA food
riouken replied to sebbedelius's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yea, there are no food items in regular arma OA but here is a simple RPG item mod. http://forums.bistudio.com/showthread.php?142673-Arma-Role-Playing-Items-ARP-Mod -
missiong ] in remote execution
riouken replied to eagledude4's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Short answer yes. Long answer , take a look at the notes at the bottom of this page: http://community.bistudio.com/wiki/scriptDone -
Exact direction of player
riouken replied to zapat's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Lol thanks Deadfast, I have never noticed that command before. ---------- Post added at 02:55 PM ---------- Previous post was at 02:52 PM ---------- There is a command, for what you need so that point is moot. But screenToWorld gives you the pos of what you see on your screen. And in my example above that is exactly where your mouse is pointing. So its not static. It will change when ever you look at something else. -
Exact direction of player
riouken replied to zapat's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You could try this, not tested though. _wPos = screenToWorld [0.5,0.5]; _weaponDir = [player, _wPos] call BIS_fnc_dirTo; -
starting a script by user action command
riouken replied to drunken officer's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
This is why Extended Event Handlers was made. It makes it so much easier to add player actions and start scripts and Eventhandlers from your addon. https://dev-heaven.net/projects/cca/wiki/Extended_Eventhandlers -
missiong ] in remote execution
riouken replied to eagledude4's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Whenever a script is ran in the scheduled environment, the game will return a script handle. You don't always need this return. But the game tries to assign that return to something. hence the _scripthandle syntax seen here: http://community.bistudio.com/wiki/execVM Most of the time your scipts will work just fine since your not using the _handle. But the game still tries to write that and will log an error in your .rpt. That's just poor coding. Your writing an error for no reason. That's why you follow the syntax. Back on topic. Did you see my question about your CBA events above? -
R.S.L.O.: Riouken's Selectable Load Outs - User Configurable
riouken replied to riouken's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
RSLO 2.3 Release: Changes: -Can now disable View distance and Terrain Detail independently. Use these two variables in the mission init to disable Either the View Distance or Terrain Detail . RSLO_DIS_VD = true; RSLO_DIS_TER = true; If set to True then the option will will be disabled for the player. Download: http://www.mirrorcreator.com/files/RLW1VKD3/RSLO_Release_2.3.zip_links ---------- Post added at 12:39 PM ---------- Previous post was at 12:30 PM ---------- You just have to add the option on an object in your mission if you wish to use RSLO later in the mission: there is a folder included with the download (RSLO) is the folder name. Just put that in your mission folder and then put that code in the objects init -
missiong ] in remote execution
riouken replied to eagledude4's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The issue with your RE is that your invoking the "loc" or local peramiter but then your giving it a nil object to check locally for. Also you must send the command you wish to use and then define the prams for said command. Your old code: (This is Wrong) // The third peram ("loc") if you use this then you must define what object to check for in the second peram. [nil, nil, "loc", ["Pub"] execVM "Scripts\Dispatch.sqf"] call RE;[color=#333333] [/color] http://community.bistudio.com/wiki/Multiplayer_framework anyways , RE is horrible for this kind of stuff and you should be using CBA events. ------------------------------------------------------------------------------------------------------- Now for your CBA event code that you posted. is that functions.sqf being run on all clients before you raise the global event? ---------- Post added at 10:55 AM ---------- Previous post was at 10:50 AM ---------- Also you should have a _scripthandle on your execVM ["DispatchPub", { _scripthandle = ["Pub"] execVM "Scripts\Dispatch" }] call CBA_fnc_addEventHandler; The only place you can not use a script handle is in a config or in the init.sqf. But you really should use one all the time for consistency. Even _nul will work if you don't need to use it. -
R.S.L.O.: Riouken's Selectable Load Outs - User Configurable
riouken replied to riouken's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
Its an easy feature request, if you give me till the weekend I will release a new version, with the ability to turn off each feature. -
Have you tried using an object with an animation? http://community.bistudio.com/wiki/DialogControls-Objects Im not 100% if that will work but it might be worth a shot. You could base the turret direction off the watch. Same principle. The underlay(watch face) will be the tank and the "Hand" would be the turret.
-
Removing weapon drop for one side
riouken replied to Ryousuke's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Iceman has the right idea, if you remove the dead body then the weapons will go to. There are a ton of scripts out there for this. For instance: http://forums.bistudio.com/showthread.php?113434-CLY-Remove-Dead-script -
R.S.L.O.: Riouken's Selectable Load Outs - User Configurable
riouken replied to riouken's topic in ARMA 2 & OA - ADDONS & MODS: COMPLETE
No, you can disable to whole addon server side by not declaring the {RSLO_Auth_Mission} var. If you do not declare that as true in your mission, it disables the addon, but I did not include separate disables for each feature. -
vehicle respawn script question
riouken replied to Laviski's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The reason it is not working is due to your use of quotes inside of quotes. http://community.bistudio.com/wiki/String So your code should look like this: veh = [this, 300, 300, 0, TRUE, FALSE, "[this] execVM 'scripts\c130cargo.sqf'; this addaction ['(Halo)','Scripts\HALO.sqf']"] execVM "scripts\vehicle.sqf"; [this] execVM "scripts\c130cargo.sqf"; this addaction ["(Halo)","Scripts\HALO.sqf"]; -
Civ's unable to fire weapons?
riouken replied to ryansoper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yes, that is correct. The issue is caused by weapons with multiple muzzles. For instance a M16 with a 203 launcher. The game does not automatically select the primary muzzle, so you are left with nothing selected, and you have to press F to select the next muzzle. here is how to fix it. Run this after you add any weapon to a player. firstmuz = { private "_ma"; _ma = getArray (configFile >> "CfgWeapons" >> _this >> "muzzles"); if (_ma select 0 != "this") exitWith {_ma select 0}; _this }; _primary = primaryWeapon player; if (_primary != "") then { player selectWeapon (_primary call firstmuz); }; -
Creating Context Menus
riouken replied to ryansoper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The team dilaog in Domination was made by Dr Eyball. He released the team status dialog as a standalone. http://www.armaholic.com/page.php?id=1060 He also made some tutorial frameworks which can be found here: http://forums.bistudio.com/showthread.php?57825-Dialog-Template-plus-Standard-Dialogs But, yea arma dilogs are not easy by any means. I have made over 50 dialogs and I still do not feel comfortable writeing a tutorial. -
Accessing elements of an array effeciently
riouken replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here you go, this is a good post explaining nested arrays. http://forums.bistudio.com/showthread.php?100559-Beginners-guide-Arrays&p=1652016&viewfull=1#post1652016 -
Accessing elements of an array effeciently
riouken replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Its the comparing of the strings that makes it much less efficient. The if statements are not to bad. It is a little less efficient, but its ok to do it sometimes. With a switch statement the engine will stop analizing the statement after it finds the correct case. If you just use all if's then it will compare each one every time. -
Accessing elements of an array effeciently
riouken replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Nothing wrong with that script, much more efficient that the OP one you posted. Don't worry about how many lines of code you have till you start getting over 250 per .sqf. As long as its coded well it will run great. -
Accessing elements of an array effeciently
riouken replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Your using configs to spawn the groups so there is no reason to define them like that in the _groupArray. Just use a substitute. ie: something like this: if (!isServer) exitWith {}; _group = _this select 0; _spawnLocation = _this select 1; _destination = _this select 2; //1 = Inf //2 = Mot //3 = Mech //4 = Tank _groupArray = [1,2,3,4]; // There is a function for this: // http://community.bistudio.com/wiki/BIS_fnc_selectRandom //_randomGroup = _groupArray select (floor(random( _groupArray))); _randomGroup = _groupArray call BIS_fnc_selectRandom; switch (_randomGroup) do { case 1: { _group = [getPos _spawnLocation, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Infantry" >> _randomGroup)] call BIS_fnc_spawnGroup; }; case 2: { _group = [getPos _spawnLocation, EAST, (configFile >> "CfgGroups" >> "East" >> "RU" >> "Motorized" >> _randomGroup)] call BIS_fnc_spawnGroup; }; /// Etc }; -
Accessing elements of an array effeciently
riouken replied to iceman77's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
While that is ok the way you have it written. Its best not to design your code where you have to compare strings. Comparing strings is a lot more system intensive. I would try to think up a totally different way of getting the same effect so you can avoid that type of coding. Is this just a thought experiment, or you trying to do something specific? ---------- Post added at 09:05 PM ---------- Previous post was at 08:59 PM ---------- This doesn't mention strings but it has a lot of great info about coding efficiently. http://community.bistudio.com/wiki/Code_Optimisation -
[HELP] How do you spawn a helicopter with an AI flying it?
riouken replied to SRBuckey5266's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
http://community.bistudio.com/wiki/createVehicle_array Take a look at the examples on that page. -
Possible to call other functions with variables involved?
riouken replied to ryansoper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The best way to handle this is to assign the vehicle to the player, save it to him. player setVariable["MyVehicle","S1203_TK_CIV_EP1"]; then in your script: _veh = player getVariable "MyVehicle"; _veh createVehicleLocal (getMarkerPos "tSpawn1"); -
Which player called Action?
riouken replied to ryansoper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I don't know, why don't you post your actual script so we can help you better. Sumatra is right in a sense, your hard coding stuff, when you don't have to. You. Could write a much more genaric version just by refrencing the player object. Please post your script so we can see exactly what your trying to do and we can help more. -
Which player called Action?
riouken replied to ryansoper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
If you look at the documentation for addAction http://community.bistudio.com/wiki/addAction Look at the section where the array is passed to the called script. The second item in the passed array is the caller or object who exeicuted the addAction. To refrence this caller, in your script just assign it to a varaible: _callingunit = _this select 1; -
Which player called Action?
riouken replied to ryansoper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
How are you calling the script Addaction, UI or Trigger?