Jump to content

Linrox

Member
  • Content Count

    19
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About Linrox

  • Rank
    Private First Class
  1. 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
  2. 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
  3. Thanks all for your help, especially F2k sel I will give it a try. UPDATE Works well:bigsmile:, thank you.:icon_eek:
  4. 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.
  5. 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;
  6. 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.
  7. 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.
  8. 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
  9. 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
  10. 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
  11. 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.
  12. 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.
  13. 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
  14. 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
  15. Linrox

    SP and Squads

    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
×