hogmason
Member-
Content Count
405 -
Joined
-
Last visited
-
Medals
Everything posted by hogmason
-
checking if east ai near marker
hogmason posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ok so I need to check to see if 1 or more east ai units are near a mkr. The way I tried is _town = _this select 0; _east_units = {alive _x && side _x == EAST} count allUnits; if (({(_x distance _town) <200} count _east_units) > 0) then { }; but obviously its not working as its returning a number not an object so how can I achieve this -
ok so i am trying to set the spawning ai with better skills without using an addon i have tried this way if (isServer) then { _setkills = 1; while {true} do { if (side _x == east) then { aimingAccuracy[] = {0, 0.16, 1, 0.20}; aimingShake[] = {0, 0.18, 1, 0.22}; aimingSpeed[] = {0, 1, 1, 1}; courage[] = {0, 1, 1, 1}; commanding[] = {0, 1, 1, 1}; endurance[] = {0, 1, 1, 1}; general[] = {0, 1, 1, 1}; reloadSpeed[] = {0, 1, 1, 1}; spotDistance[] = {0, 1, 1, 1}; spotTime[] = {0, 1, 1, 1}; } foreach allunits; sleep 5; }; }; but i am unsure if it is working correctly or if having this loop running every 5 secounds would degrade server performance. also tried this way but am unsure if this gets any of the spawned east units mid game if (isServer) then { if (side _x == east) then { _x setskill ["aimingAccuracy",0.05]; _x setskill ["spotDistance",1.00]; _x setskill ["spotTime",0.99]; _x setskill ["courage",0.99]; _x setskill ["commanding",0.99]; _x setskill ["aimingShake",0.15]; _x setskill ["aimingSpeed",0.99]; } foreach allunits; }; any ideas
-
Majority OPFOR killed
hogmason replied to forzajuve's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
that will suffice if you like using triggers ;) -
Majority OPFOR killed
hogmason replied to forzajuve's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
easy to count enemy units then end if enemy numbers are less then specific number use this as is while {true} do { _totalEnemy = {alive _x && side _x == EAST} count allUnits; if (_totalEnemy < 11) then //change here the number of enemy units alive to end mission its set at 11 or below { player sidechat format["The enemy are retreating Well done boys", _totalEnemy ]; sleep 30; endmission "END2"; }; sleep 60 // this will check enemy units every 1 minute }; ---------- Post added at 18:05 ---------- Previous post was at 17:58 ---------- OK so also to include the enemy that are moving away from the task area just create an array of your enemy units and run a distance check on them and if they are a certain distance away just kill them // AO is a variable for thye position the enmy are attacking or target area so place an object down there and name it AO or something or even a marker is fine //marker example _opsAREA = getMarkerPos "yourmarkername"; //now change AO to _opsAREA if (_x distance AO <1200) then { } foreach MyEnemyArray; //this is your enemy array ---------- Post added at 18:08 ---------- Previous post was at 18:05 ---------- // AO is a variable for thye position the enmy are attacking or target area so place an object down there and name it AO or something or even a marker is fine //marker example _opsAREA = getMarkerPos "yourmarkername"; //now change AO to _opsAREA if (_x distance AO <1200) then { _x setDamage 1; //this will kill them } foreach units enemysquad2 AND enemysquad3 AND enemysquad4 AND enemysquad5; -
Why won't the artillery guys fire?
hogmason replied to SRBuckey5266's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ive never used the arma artillery without code but i am pretty sure you have to link the artillery gunners or batteries to the artillery module -
Local variable not within scope of while loop
hogmason replied to SRBuckey5266's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
dont have the time right now but try making the local variable a global variable like this a local looks like this _runallahakkbar a glkobal looks like this runallahakkbar not no underscore that way it can be read from anywhere. you most likely knew that but i dont know what you know so just trying to help unless your using _runallahakkbar somewhere else for different reasons then making it a global will not effect anything ---------- Post added at 09:44 ---------- Previous post was at 09:40 ---------- out of curiosity are you using show error hints then checking your error rpt log FOUND HERE C:\Documents and Settings\"YOUR USERNAME"\Application Data\ArmA 2 OA; http://forums.bistudio.com/showthread.php?137306-How-to-check-my-RPT-log -
Counting kills, remaining enemies
hogmason replied to DeadCommunist's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No Use this hint "MISSION IS WON IF ALL BUT 10 OR LESS OF THE ENEMY OCCUPATION UNITS ARE ELIMINATED."; while {true} do { sleep 10; _agrps = (agrp1 + agrp2 + agrp3 + agrp4 + agrp5 + agrp6 + agrp7 + agrp8 + agrp9 + agrp10); _acount = {alive _x} count units _agrps; if (_acount > 11) then { hint format ["THERE ARE %1 ENEMY UNITS LEFT TO KILL", _acount]; } Else { If (_acount < 11) then { hint "MISSION ACCOMPLISHED"; }; }; }; now im a bit skeptical about _agrps = (agrp1 + agrp2 + agrp3 + agrp4 + agrp5 + agrp6 + agrp7 + agrp8 + agrp9 + agrp10); [color="#FF0000"]_acount = {alive _x} count units _agrps;[/color] Just let me know ---------- Post added at 23:58 ---------- Previous post was at 23:56 ---------- Yeah you gotta excuse me ive been codeing for 16 hrs straight on my latest pc program so my brain is a bit fried ATM lol -
Why won't the artillery guys fire?
hogmason replied to SRBuckey5266's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
hhhhhhmmmmmmmmmm cant see no code there to make the unit fire show us that bit and we can help. -
Anything wrong with this block of code?
hogmason replied to SRBuckey5266's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
yeah for a starters from a quick look units Arma already uses units so you cant use that as your global variable name. thats going to cause conflicts also i could have missed it but i cant see anywhere after you spawn your units where you add them to the units array it should look like this to add them _driver = _group createUnit ["TK_Soldier_AT_EP1", _pos, [], 0, "FORM"]; _driver moveInDriver _truck; units set[(count units ), _driver ]; bit late here and eyes are hanging out my head ill look a bit better tomoz -
Counting kills, remaining enemies
hogmason replied to DeadCommunist's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
you can shorten all that massive nest of if statement for enemy count with hint by using this _totalEnemy = {alive _x && side _x == EAST} count allUnits; if (_totalEnemy > 11) then { player sidechat format["THERE ARE %1 ENEMY UNITS LEFT TO KILL", _totalEnemy ]; } Else { If (_totalEnemy < 11) then { player sidechat format["THERE ARE %1 Mission is compleate", _totalEnemy ]; //call end mission code now }; }; as far counting kills for each player arma give me 10 -
HOG MHQ v2.0 By =Mason= ///////////////////////////////// DOWNLOAD ============= ABOUT ============= This allows players to deploy a Mobile MHQ with some cover and a fully loaded ammo box. It has a marker on the map that follows the MHQ and updates its marker name as it is deployed and un deployed. Players can teleport to and from the MHQ and base. The MHQ respawns and is fully MP and JIP ready. ============= HOW TO USE ============= 1) drag the demo to your missions folder C:\Users\yourname\Documents\ArmA 2 Other Profiles\yournick\missions 2) then open it in the editor to view what you need on the map for the script to run you can simpy select merger in the editor to merge all objects on the map over to your mission. 3) transfer the HOG_scripts folder over to your mission folder and place the following in your init.sqf waituntil {!isnil "bis_fnc_init"}; // Run HOG_MHQ if (isnil "HQ_Deployed") then {HQ_Deployed = 0;}; execVM "HOG_scripts\HOG_MHQ\MHQ_MHQ_functions.sqf"; execVM "HOG_scripts\HOG_MHQ\MHQ_spawner.sqf"; // Update the MHQ marker's for JIP Players HOG_markerArray = ["rally","teleport","MHQMKR"]; onPlayerConnected "{_x setMarkerPos (getMarkerPos _x)} forEach HOG_markerArray"; ============= FEEDBACK AND BUGS ================ CONTACT ME ON http://forums.bistudio.com/showthread.php?143098-HOG-MHQ-v1-0&p=2258507#post2258507 =================== COPYRIGHT STATEMENT =================== HOG MHQ v1.0 is © 2012 All rights reserved. ================ LEGAL DISCLAIMER ================ The Software is distributed without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. The Software is not an official addon or tool. Use of the Software (in whole or in part) is entirely at your own risk. ========================================================= DISTRIBUTING SIMULATION CONTENT CREATED WITH THE SOFTWARE ========================================================= Please note that you do NOT require permission from The Contributors to distribute simulation content (e.g. missions) created with the Software. However, The Contributors do ask that you credit the Software in any release documentation. ======= CREDITS ======= thanks goes out to Mikie Boy ---- For his outstanding help in fixing a dedi server issue for his assistance in a bugs and other ideas id like to thank Iceman77 Twirly eggbeast dragonsyr
-
Ok sadly i just found out over at Armaholic that Reezo has left the community and taken his code work with him :( Basicaly i am needing a copy of the loudspeaker script he released a while ago has any 1 got a copy if so can you please place a link for me cheers ;).
-
Reezo Loudspeaker Needed
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
thanks mate ;) -
image on dynamically spawned vehicle seen by all players
hogmason posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I have a issue, I am spawning a vehicle and trying to add a image along the vehicle for all players to see but only the player who buys the vehicle can see the image how can I make it so all players can see the image. I tried. if (_classname == "SUV_UN_EP1") then { _classname setobjecttexture [0,"suvpolice.paa"]; _classname setobjecttexture [1,"suvpolice.paa"]; }; and if (_classname == "SUV_UN_EP1") then { [nil, nil,"per",// // _classname setobjecttexture [0,"suvpolice.paa"],// _classname setobjecttexture [1,"suvpolice.paa"]// // ] call RE; }; -
image on dynamically spawned vehicle seen by all players
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
That did not work mate the issue I get is the player that buys the car can see the images on the car but no other players can this is what I tried from you cuel _classname = _this select 0; newvehicle = _classname createVehicle %4; if (_classname == "SUV_UN_EP1") then { [nil,nil,"per",rSETOBJECTTEXTURE,newvehicle,0,"graphics\suvpolice.paa"] call RE; [nil,nil,"per",rSETOBJECTTEXTURE,newvehicle,1,"graphics\suvpolice.paa"] call RE; }; -
image on dynamically spawned vehicle seen by all players
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
yeah I changed the ref to object for this post its actually _veh which comes from _v = _this select 0; cheers cuel ill try that ;) -
creating an array of all locations using nearestLocations
hogmason posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
how would I create an array of all nearby locations using _location = nearestLocations [getPosATL center_pos, ["NameVillage","NameCity","NameCityCapital"], 25000]; and then call for a one of the locations at random selection. Then once I used that location remove it from the array so I can not use that location again. also when I call for the location I want to give players a hint with the locations name like _RandomTownPosition = whatever the town selection is hint parseText format["<t color=""#80FF00"">New Task Assigned at %1",_RandomTownPosition]; I know its a lot to ask for but honestly I just spent 7 hrs trying to get it and failed. -
creating an array of all locations using nearestLocations
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
FUNNY lol I just signed in to say I just thought and tried that and guess what it WORKS :) Thanks any way Das and thanks to all that helped ;) -
creating an array of all locations using nearestLocations
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
DOESNT WORK I tried defines.sqf --- launched by in my init call compile preprocessfile "common\defines.sqf"; AO_locations = nearestLocations [getPosATL Map_center, ["NameVillage","NameCity","NameCityCapital"], 25000]; task.sqf if (AO_locations == 0) then { hint "GAME OVER"; } else { // my task code in here }; I get this error Error ==: Type Array, expected Number,String,Object,Side,Group,Text,Config entry,Display (dialog),Control,Team member,Task,Location -
creating an array of all locations using nearestLocations
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
SWEET cheers man BUT does this look right to you // then say to end the game when no locations remain can I use if (AO_locations =0) then { //code to end game }; or should it be // then say to end the game when no locations remain can I use if (AO_locations ==0) then { //code to end game }; -
creating an array of all locations using nearestLocations
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
cheers guys I think I got it from your help ;) ill just check in my defines.sqf I have AO_locations = nearestLocations [getPosATL Map_center, ["NameVillage","NameCity","NameCityCapital"], 25000]; then my code //tested and this first part works _location = AO_locations call BIS_fnc_selectRandom; _locationPos = (position _location); _locationName = (text _location); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// BELOW IS NOT TESTED JUST ASKING /////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////// //now later on when I need to can I use the following to remove the used location from AO_locations AO_locations = AO_locations - [_location]; // then say to end the game when no locations remain can I use if (AO_locations =0) then { //code to end game }; -
ok so I am trying to select a random town using nearestLocations create a marker on it then give players a hint containing the selected towns name. I found I can do it not using random like _position = nearestLocations [getPosATL center_pos, ["NameVillage","NameCity","NameCityCapital"], 25000]; _town = _position select 0; _m = createMarker ["test",getPos _town]; _m setMarkerShape "ELLIPSE"; _m setMarkerSize [250,250]; _m setMarkerBrush "Solid"; _m setMarkerAlpha 0.7; _m setMarkerColor "ColorYellow"; hint parseText format["<t color=""#80FF00"">New Task At %1,",text _town]; but when I try with random town selection it fails i.e _position = nearestLocations [getPosATL center_pos, ["NameVillage","NameCity","NameCityCapital"], 25000]; _RandomTownPosition = position (_position select (floor (random (count _position)))); _town = _RandomTownPosition select 0; _m = createMarker ["test",_RandomTownPosition]; _m setMarkerShape "ELLIPSE"; _m setMarkerSize [250,250]; _m setMarkerBrush "Solid"; _m setMarkerAlpha 0.7; _m setMarkerColor "ColorYellow"; hint parseText format["<t color=""#80FF00"">New Task At %1",text _town]; it says type number expected string location
-
creating a marker on a town using nearestLocations with hint of selected towns name
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
when I remove count like _RandomTownPosition = position (_location select (floor (random (_location)))); I get this error error random type array expected number -
creating a marker on a town using nearestLocations with hint of selected towns name
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I should off named it getting town name using random nearestLocations. As that is what im trying to do -
checking if east ai near marker
hogmason replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
_town = _this select 0; this is a invisible h done by town_object = { _positions = _this select 0; _obj = createVehicle ["HeliHEmpty", _positions, [], 0, "NONE"]; [_obj ] spawn Town_monitor; }; { _pos = position _x; m = createMarker [format ["mrk%1",random 100000],_pos]; m setMarkerShape "ELLIPSE"; m setMarkerSize [250,250]; m setMarkerBrush "Solid"; m setMarkerAlpha 0.7; m setMarkerColor "ColorRed"; [m] spawn town_object; Town_monitor ---- in wich im stuck _town = _this select 0; while {true} do { ////////////// _units = nearestObjects [_town, ["Car","Tank","Air","Man"], 200]; { if(_x isKindOf "Man" && side _x == east) then { if (_x distance _town <200) then { _town setMarkerColor west_near; }; }; } foreach _units; //////////////// sleep 10 };