Linrox
Member-
Content Count
19 -
Joined
-
Last visited
-
Medals
Everything posted by Linrox
-
Changing a units rank
Linrox replied to Angus S's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
i tried something similar, but it errors received an array, but wanted an object. I did end up fixing it. Thanks to you tip -showscripterror but ultimately, i wanted to use 'if ' conditions in the menu script so i could enable or disable options based on the players rank. Plus i found that with the current menu, if i select higher that 7 it errors, missing ] so i need a line to prevent that. here is what the promote.sqf currently looks like //change.sqf _o=1; _unit_player =_this select 0; _unit = _this select 1; _newRank = _this select 2; _rankI = _this select 3; _p=rankId _unit_player; { if (_p > _rankI-1) then { hint format ["Current Rank %1",rank _x]; Sleep 1; _x setRank _newRank; hint format ["New Rank is %1",rank _x]; sleep 3; };// else {exitWith {hint format ["can't promote %1 to %2",_unit,_newRank]}; }foreach _unit; if (count _unit <1) exitWith {titleText ["No unit is selected", "PLAIN DOWN"]}; also i don't understand why, if i add a line rankID=rankI-1 it returns as scalar. thanks for the reply, and for your help -
Changing a units rank
Linrox replied to Angus S's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Str Sel: I am trying to add an if statement in the {} brackets in the change.sqf file. but the script will not run. the line i am trying to add is { if (rankId _x > rankId _unit_player) exitWith {}; I have also tried adding the line before the { but it stops at the line. Any help? I have also tried this _unit_player =_this select 0; _unit = _this select 1; _newRank = _this select 2; if (rankId _unit < rankId _unit_player) { hint format ["Current Rank %1",rank _x]; Sleep 1; _x setRank _newRank; // _x setRank (format ["%1",_newRank]); Sleep 1; hint format ["New Rank is %1",rank _x]; } foreach _unit; }; but still no joy -
Changing a units rank
Linrox replied to Angus S's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks all for your help, especially F2k sel I will give it a try. UPDATE Works well:bigsmile:, thank you.:icon_eek: -
Changing a units rank
Linrox replied to Angus S's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
no, did not even know about the _showscript command I think i might know why you are getting errors, i am using ARMA 2 OA, but i also have Reinforcements installed which includes BAF & PMC. http://www.arma2.com/rft also remember this is for SP not MP, if that makes any difference. -
Changing a units rank
Linrox replied to Angus S's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
sorry that wasn't the full script. Here is the init.sqf file and the menu.sqf files of both versions. I have added for testing a few hint and hint format lines to make sure the script is reaching those points. This is my current working version. but it is messy because i need a seperate file for each rank(i.e. corporoal.sqf,captain.sqf...). You will also need to place a GL in the map editor with this nul=[this] execVM "RankX\RankX_init.sqf"; in the initialization. //RankX_init.sqf waituntil {!isnil "bis_fnc_init"}; _HCLeader=_this select 0; _UnitID=_this select 1; _HCLeader hcSetGroup [group _HCLeader]; hint "init started"; sleep 1; [] execVM "RankX\RankX_Menu.sqf"; //RankX_menu.swf sleep 1; [] call BIS_fnc_commsMenuCreate; //This hint shows the SQF was started hint "Menu Start"; CUSTOM_menu = [ ["Rank",false], ["Promote",[2],"#USER:Rank_menu",-5,[["expression","player sidechat ""this is Rank (submenu)"]],"1","1"], ["Item 2",[3],"",-5,[["expression","hint 'Hello2!'"]],"1","1"] ]; Rank_menu = [ ["Rank",false], ["Corporal",[2],"",-5,[["expression", "nul= groupSelectedUnits player execVM 'RankX\corporal.sqf'"]],"1","1"], ["Sergeant",[3],"",-5,[["expression", "nul= groupSelectedUnits player execVM 'RankX\sergeant.sqf'"]],"1","1"] ]; BIS_MENU_GroupCommunication = [ [localize "STR_SOM_COMMUNICATIONS", false],["Rank",[2],"#USER:CUSTOM_menu",-5,[["expression",""]],"1","1"] ]; //if this hint is printed then script completed hint "Menu Complete"; if (true) exitWith {}; //corporoal.sqf //This hint shows the SQF was started hint "Promote started"; sleep 0.5; _unit= _this select 0; _newRank = "CORPORAL"; _unit setRank (format ["%1",_newRank]); //if this hint is printed then script completed hint "Promote end"; sleep 0.5; and here is the other version that i could not get to work. you will notice the hint format prints the same results as the version that i am currently using. The init.sqf is the same for both versions //RankX_menu.swf sleep 1; [] call BIS_fnc_commsMenuCreate; //This hint shows the SQF was started hint "Menu Start"; CUSTOM_menu = [ ["Rank",false], ["Promote",[2],"#USER:Rank_menu",-5,[["expression","player sidechat ""this is Rank (submenu)"]],"1","1"], //["Item 2",[3],"",-5,[["expression","hint 'Hello2!'"]],"1","1"] ]; Rank_menu = [ ["Rank",false], ["Corporal",[2],"",-5,[["expression", "nul= [groupSelectedUnits player,('CORPORAL')] execVM 'RankX\corporal.sqf'"]],"1","1"], ["Sergeant",[3],"",-5,[["expression", "nul= [groupSelectedUnits player,('SERGEANT')] execVM 'RankX\sergeant.sqf'"]],"1","1"] ]; BIS_MENU_GroupCommunication = [ [localize "STR_SOM_COMMUNICATIONS", false],["Rank",[2],"#USER:CUSTOM_menu",-5,[["expression",""]],"1","1"] ]; //if this hint is printed then script completed hint "Menu Complete"; if (true) exitWith {}; If I can get this part of the script to work correctly then i would only need 1 file for the actual promotion, not 1 per rank. //corporoal.sqf //This hint shows the SQF was started hint "Promote started"; sleep 0.5; _unit= _this select 0; _newRank = _this select 1; //just prints results hint format ["%1",_newRank]; sleep 1; hint format ["%1",_unit]; sleep 1; _unit setRank (format ["%1",_newRank]); //if this hint is printed then script completed hint "Promote end"; sleep 0.5; -
Comms and Custom menues
Linrox replied to dfear's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
does any body know how to add menus to the custom menu. option 0-9. OK Never mind, i found my answer. its the sound menu. -
Changing a units rank
Linrox replied to Angus S's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yes i realized the typo error in that line after i had posted. The typo does not exists in the actual script. The unit/units being promoted are chosen by the nul = changeSelectedUnits player part in the menu script. but i know i needed to add the foreach _unit; part as well I have tested the value of both _unit and _newRank in both scripts and in both cases the _unit does hold the ID of the selected unit, and the _newRank does hold the rank to promote too. so that's why i don't get it. The only difference (that i can see) is the the first script receives the rank from the menu choice, and the second script gets the rank from the _newrank = "CAPTAIN"; in the promote.sqf script. and yet if i use the hint format to print the content of the variables they are correct. -
Changing a units rank
Linrox replied to Angus S's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well i though i would give you all an update. I finally got it to work :D but it is rather messy. Also this is not for MP, just SP. Can any body tell me why it would not work like this even though the variables hold the right info.:confused: //RankXmenu.sqf Rank_menu = [ ["Rank",false], ["Promote",[2],"#USER:Rank_menu",-5,[["expression","nul= [groupSelectedUnits player,('CAPTAIN')] execVM 'RankX\promote.sqf'"]],"1","1"] ]; BIS_MENU_GroupCommunication = [ [localize "STR_SOM_COMMUNICATIONS", false],["Rank",[2],"#USER:CUSTOM_menu",-5,[["expression",""]],"1","1"] ]; if (true) exitWith {}; //promote.sqf _newRank = _this select 1; _unit = _this selet 0; _unit setRank (format ["%1",_newRank]); instead i have to use this //RankXmenu.sqf sleep 1; [] call BIS_fnc_commsMenuCreate; CUSTOM_menu = [ ["Rank",false], ["Promote",[2],"#USER:Rank_menu",-5,[["expression","player sidechat ""this is Rank (submenu)"]],"1","1"] ]; Rank_menu = [ ["Rank",false], ["Corporal",[2],"",-5,[["expression", "nul= groupSelectedUnits player execVM 'RankX\corporal.sqf'"]],"1","1"], ["Sergeant",[3],"",-5,[["expression", "nul= groupSelectedUnits player execVM 'RankX\sergeant.sqf'"]],"1","1"], ["Lieutenant",[4],"",-5,[["expression", "nul= groupSelectedUnits player execVM 'RankX\lieutenant.sqf'"]],"1","1"], ["Captain",[5],"",-5,[["expression", "nul= groupSelectedUnits player execVM 'RankX\captain.sqf'"]],"1","1"], ["Major",[6],"",-5,[["expression","nul= groupSelectedUnits player execVM 'RankX\major.sqf'"]],"1","1"] ]; BIS_MENU_GroupCommunication = [ [localize "STR_SOM_COMMUNICATIONS", false],["Rank",[2],"#USER:CUSTOM_menu",-5,[["expression",""]],"1","1"] ]; if (true) exitWith {}; //Corporal.sqf sleep 0.5; _selected= _this select 0; _newRank = "CORPORAL"; _selected setRank (format ["%1",_newRank]); The Variable _newRank in both cases still holds the same value, but it only works when the variable is set in the same script. I will be trying to clean it up. at the moment i need to use 1 file for each rank, which i don't like. so i will keep reading forums and other scripts to help learn. Linrox -
Changing a units rank
Linrox replied to Angus S's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hey Did you get the setRank command to work on units?? and was this for a SP or MP game?? I am also trying to use the setRank on units but cannot get it to work. Any pointers!! thanks Linrox -
Arma2 dedicated server howto
Linrox replied to warlock2511's topic in ARMA 2 & OA - Servers & Administration
I tried to install dedicated server (as the readme.txt said to) for OA but after the ./install (which completed correctly):) Everything went well until I tried to run the ./server and got lots of errors I did check to make sure i had followed the readme a few times. and i get the same errors. I also recopied the entire folder from Arma 2 operation arrowhead and renamed the base folder as recomended A small part of error log: ... Cannot register string STR_DISP_INT_RESTART_FORMAT - global stringtable not found Cannot register string STR_MSG_PLAY_WITHOUT_SAVES - global stringtable not found Cannot register string STR_MSG_MP_NOT_SIGNED_IN - global stringtable not found Cannot register string STR_MSG_MP_NO_PRIVILEGES - global stringtable not found ... Warning Message: '/' is not a value Warning Message: No entry '.hotspotX'. Warning Message: '/' is not a value Warning Message: No entry '.hotspotY'. Warning Message: '/' is not a value Warning Message: No entry '.width'. Warning Message: '/' is not a value Warning Message: No entry '.height'. Warning Message: '/' is not a value Warning Message: No entry '.color'. Warning Message: Size: '/' not an array Warning Message: Size: '/' not an array Warning Message: No entry '.shadow'. Warning Message: '/' is not a value Warning Message: Resource RscDisplayNotFreeze not found Warning: preNLOD format in object Critical: Destroying running thread! Critical: Destroying running thread! Critical: Destroying running thread! Segmentation fault I'm kind of over whelmed at the amount of errors :( Is there a video tut or a fix for this Thanks -
I have been looking at all the scripts and had a few ideas for adding functions for warfare2 mod. but when i looked closer at some of the commands it seems like there MP only. Is it possible to use the squad scripting commands for a SP warfare2 game. Thanks Linrox
-
Doh :butbut::butbut: I just went back and reread it and i must of been more tired than i thought when i read the info.
-
WARFARE editing guide pls
Linrox replied to joemama007's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I too have been looking into the sqf files inside the warfare2 & warfare2 e pbo's I have had a couple of ideas, but not sure it its possible. seeing how most of the functions are MP not SP, at least that is what my research has found from various sites. any way, the idea i had was 2 fold. 1. To add artillery into the buy menu 2. (the more complex) To add the ability of creating squads from purchased units in a warfare +coin game. Problem is most of the squad script commands are referenced as MP ONLY. (again info from sites). My idea is lot more complex than a couple of lines. All in all i only started playing arma2 (never played arma1) for a couple of months. Yes, i would like help when i have questions, but i know most of my questions will net get answered with any meaningful answers. It's all on the net as they say, the problem is finding it and google doesn't help, unless you can read Russian or any other language. -
Hey all I was looking through some of the PBO files (PBOView) and found the menus for buying units in game. Is there a way i could add artillery to one of these menu's so I can purchase arty in game? Also in a warfare+Coin game how do you activate the aircraft (Planes not heli's) buy menu. I have captured a city next to the airfield, but can't get the Air factory (in the buy units menu) to activate. I have tried putting a Factory on the base in different locations. still No joy Any one have a tutorial on adding a functional aircraft factory to an airfield in a warfare2 + Coin game. Thanks Linrox
-
I have been looking at all the scripts and had a few ideas for adding functions for warfare2 mod. but when i looked closer at some of the commands it seems like there MP only. Is it possible to use the squad scripting commands for a SP warfare2 game. Thanks Linrox
-
Hey all I was looking through some of the PBO files (PBOView) and found the menus for buying units in game.:cool: Is there a way i could add artillery to one of these menu's so I can purchase arty in game?:confused: Also in a warfare+Coin game how do you activate the aircraft (Planes not heli's) buy menu. I have captured a city next to the airfield, but can't get the Air factory (in the buy units menu) to activate. I have tried putting a Factory on the base in different locations. still No joy:( Any one have a tutorial on adding a functional aircraft factory to an airfield in a warfare2 + Coin game. Thanks Linrox
-
Hi All I am new here, please forgive me if i am posting the wrong area for these newbie questions. I am fairly new to arma2 and OA I have mainly been playing around with the editor and doing campaign missions for a couple of months. The questions i have are all on the COIN Module (Construction Module), I have tried reading as much as i can, but I can't find answers to a few questions. I am playing the commander in a SP COIN module game. I have built up a small base (HQ, Barracks, Light Vehicle Supply, Heavy Vehicles Supply, Helipad & Service Point). 1. how do you place static objects like artillery/Mortars in a COIN based game?:confused: 2. Is it possible to buy Arty like other units/vehicles? or can you add them in the editor with the Coin Mod.:confused: 3. Is it possible to create a firebase in the COIN game.:confused: 4. How do you add AI Team Leaders and assign units to them? I have created a few Team Leaders, Squad Leaders but I don't see them in the Teams Menu.:confused: I also have added a few Modules (Warfare, First-aid, Artillery, HQ, 2IC, ) and synced. I didn't add the SOM Module as i couldn't answer any of the SecOP missions, (Comms Menu issues) Thanks Linrox
-
Thanks for that PvPscene, Appreciate the info:D But how do i implement the High Command Module, is it as simple as adding it in the editor and syncing it to the commander (Player) or do I need to write scripts. Are there any tutorials on this that you know off? Thanks Linrox
-
Thanks for the reply, much appreciated So what's the deal with Team and squad Leader units? It's getting difficult to manage 50+ units under one leader. How can i add a team/squad leader to the Teams menu? Here is what i have researched and tried (editor/Preview) I have played with a few tuts like these ones http://community.bistudio.com/wiki/UAV and this one to http://community.bistudio.com/wiki/Artillery_Module and i got both to work after some issues were solved:D as far as my current problem of teams and adding arty to a coin game, i have also read through other info like http://www.armaholic.com/forums.php?m=posts&q=6751 and also http://forums.bistudio.com/showthread.php?t=94280 but i could not find any init.sqf files and don't know what is normally in them. I have tried unPBO but only got errors. I am also not strong at scripting. I have not really found any tutorials directly on adding Arty to COIN and any other modules that i can get working I have also looked through http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2 to find anything that might help. I think most of what i am after is in the scripting.:eek: If anyone has any tutorials on COIN and adding other modules like artillery please send me a link. Thanks Linrox