beta
Member-
Content Count
67 -
Joined
-
Last visited
-
Medals
Everything posted by beta
-
Something like this perhaps? <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _playerScore = score player; _playerScore = _playerScore * -1; player addScore _playerScore; Run that code whenever a player respawns. Haven't tested it or anything, but it might work. If not, check these two wiki pages: http://community.bistudio.com/wiki/addScore http://community.bistudio.com/wiki/score
-
A.C.E. Advanced Combat Environment Public Release!
beta replied to sickboy's topic in ARMA - ADDONS & MODS: COMPLETE
Easy way to find out the class names of what you are looking for is to make a trigger in the editor with these properties: Repeatable Activates on radio alpha In the Activation field: hint format["%1", magazines player]; Same can be done for weapons, just replace "magazines player" with "weapons player". -
A.C.E. Advanced Combat Environment Public Release!
beta replied to sickboy's topic in ARMA - ADDONS & MODS: COMPLETE
Played the mod quite a bit over that last few days, have to say very, very good work you have done! The two things that stand out for me are the medical system and the persistent spent cartridges. Having to deal with wounded soldiers, and not dying after a single shot to the torso makes the game much more intense and rewards teamwork FAR more. Can't wait to see the medical system being fleshed out more and the other new systems you will add. Great work so far! -
Don't pay too much attention to all the criticism, people will always be perfectionist Looks great so far! The bug walking is still a little wonky, but thanks for making this, going to try and hammer out a mission with this stuff soon.
-
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (isServer) then { //server [] execVM "scripts\main_thread_server.sqf"; if (!(isNull player)) then { //server-client [] execVM "scripts\main_thread_client.sqf"; } } else { //client if (isNull player) then { //JIP-client [] spawn { waitUntil { !(isNull player) }; [] execVM "scripts\main_thread_client.sqf"; } [] execVM "scripts\main_thread_client.sqf"; }; I have this code running in the init.sqf. Gives me an error, missing a "}" after the { under the else. Not sure what is wrong here ... Any ideas? Edit: And yes, I just noticed that if the player is a JIP-client, the main_thread_client.sqf will be execVM'd twice
-
Great script! Works very well. I have one suggestion/request, however. Would it be possible to have the "dot" show up whenever the Teamswitch key is pressed? It would make finding the center of your screen a lot easier for players with a large float zone, especially at range. Thanks for the great script!
-
For a tank that is killed and units entering a trigger, try this: In the leader1 init <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> nil = [leader1] execVM "listen.sqf"; In the tank1 init <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this addEventHandler["killed", {tankKilled = true; publicVariable "tankKilled";}]; In the trigger On Activation: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> unitsEntered = true; publicVariable "unitsEntered"; In the listen.sqf file <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _unit = _this select 0;  //assign passed unit to local variable //infinite loop while {true} do {  //if the tank has been killed  if (tankKilled) then  {   _unit sideChat "The tank has been destroyed.";  //send message  };  //if the units have entered the trigger  if (unitsEntered) then  {   _unit sideChat "Units have entered the trigger.";  //send message  };  sleep 3;  //wait 3 seconds to ease load on the CPU }; I haven't tested these, but they should have leader1 receive the messages up to a max of 3 seconds (+ ping time) after it happened. I haven't had much luck trying to do the same via in-game or script generated triggers. The "player" command seems to have some strange results in dedicated and client-server MP sessions.
-
Hey, I'D like to see those code screenshots! That would be cool ... Either way, keep up the good work, hope the changes don't cause you too many problems
-
Spotter to detect certain group names only
beta replied to mrcash2009's topic in ARMA - MISSION EDITING & SCRIPTING
Perhaps a BLUFOR Detected By REDFOR trigger? The condition could be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> this && grp1 in thisList && grp2 in thisList To name your groups, this would go into their init: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> grp1 = group this; Haven't tested this, but it could be a start. -
Why are most pvp players laughable at best in arma
beta replied to Migel's topic in ARMA - MULTIPLAYER
The reason is simple in my opinion ... The AI. For 99% of ArmA players, their first exposure was playing against the AI. MOST ArmA servers run some sort of Player vs. AI mission regularly. So, when you start playing against other people, you keep your old habits. Oh, you don't have to worry about concealment, the AI can't see you this far. Things like contact drills ... when fighting against the AI, the most effective one is to stop, go prone, find out where they are shooting at you from, and shoot them. Most servers have changed the AI to be quite inaccurate. It comes as a shock to people when they are shot and killed with 1 round at 200m. That is EASILY doable with an M16A2 or an AK-74. The AI can even do this ... but they don't, because of their deviation. Playing against the AI doesn't instill the need for quick thinking and action, always finding and using cover and concealment, and other things like suppressing fire, speculative fire, etc. Generally, you lack a sense of urgency. The AI either runs full speed at you, or they go prone and wait. Humans don't. They flank, find a vantage point and generally try to get into a better position to kill you. Not to mention a good portion of the popular TvT missions don't really require teamwork .. but that's a whole different issue. -
I'm trying to disable the radio for certain players in a mission. What I am looking for is at the start of the mission, only specific players should be able to send and recieve VON messages. All players are named. I've tried it though scripts and triggers ... doesn't seem to work so far. It works fine in SP, but not in MP. Only thing I have yet to try is putting this: 'if (local player) then {enableRadio false;};' in the init of each unit that is to not have comms. Anyone have any success in disabling the VON so far?
-
Ah, I see makes sense why it isn't working. Not very clear on the biki. How about fadeRadio? I tried that as well, and it had the same locality problems ... Does this command also not affect VON? EDIT: Just tested it ... no way to affect VON it seems. It is separate of the radio commands.
-
Detecting if the Gear Dialog is open?
beta replied to beta's topic in ARMA - MISSION EDITING & SCRIPTING
Perfect. I was hoping it would be something like that, searched through a bunch of threads, but nothing was concrete .. Thanks again! Just need to find the ID then. EDIT: Just de-pbo'd and unbin'd the bin.pbo and config.bin files. This is the entry which I THINK is related to the gear dialog (for future search reference): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class RscDisplayGear: RscStandardDisplay { idd = 106; emptyGun = "#(argb,8,8,3)color(1,1,1,1)"; emptySec = "#(argb,8,8,3)color(1,1,1,1)"; emptyEq = "#(argb,8,8,3)color(1,1,1,1)"; emptyMag = "#(argb,8,8,3)color(1,1,1,1)"; emptyMag2 = "#(argb,8,8,3)color(1,1,1,1)"; emptyHGun = "#(argb,8,8,3)color(1,1,1,1)"; emptyHGunMag = "#(argb,8,8,3)color(1,1,1,1)"; class controls { class Title: RscTitle { idc = 101; text = "$STR_GEAR_TITLE"; }; class Pool: RscListBox { idc = 105; style = 16; x = 0.050000; y = 0.600000; w = 0.400000; h = 0.300000; color = {0, 0, 0, 1}; }; class Skill: RscPicture { idc = 102; x = 0.730000; y = 0.200000; w = 0.050000; h = 0.050000; }; class Vehicle: RscPicture { idc = 103; x = 0.800000; y = 0.200000; w = 0.060000; h = 0.060000; }; class Weapons: RscHTML { idc = "IDC_GEAR_WEAPONS"; x = 0.550000; y = 0.180000; w = 0.400000; h = 0.600000; align = "center"; cycleLinks = 0; }; class B_Rearm: RscActiveText { idc = 132; x = 0.750000; y = 0.900000; w = 0.150000; text = "$STR_GEAR_REARM"; }; class B_Close: RscActiveText { idc = 2; x = 0.850000; y = 0.900000; w = 0.150000; text = "$STR_DISP_CLOSE"; default = 1; }; }; }; EDIT 2: Ah, so I am assuming that the 'idd=106;' would mean the gear dialog's IDD is 106, so, modifying the above code to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> While {Alive Player} Do    {    WaitUntil {!IsNull (FindDisplay 106)};    Hint "Gear Dialog is open";    WaitUntil {IsNull (FindDisplay 106)};    Hint "Gear Dialog is closed";    }; This would then display the hints when the dialog opens or is closed? EDIT 3: Just gave it a quick test, works like a charm. Thanks again! -
Is it possible to detect if the Gear dialog is currently open for a player? Does the 'dialog' command detect pre-existing dialogs (Gear, Map, etc.) along with user made ones? Simply closing ANY dialog would be fine .. I can't test it at the moment, but would like to know if it is possible. Thanks for any responses.
-
Walk or run toggle: "C". Press C and your character will "walk". Slow movement while standing, swimming, crawling, crouching.
-
Try this? Haven't tested it, but it might work. Script called "timer.sqf" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //plays _snd repeatedly as long as _obj is alive _length = _this select 0;  //length of timer _obj = _this select 1;  //object to play sound from _snd= _this select 2;  //sound to play _x = 0;  //internal timer variable _obj say [_snd, 0];  //play sound //infinite loop while {true} do {  if (!alive _obj) exitWith {};  //check if _obj is dead   //check if time is up  if (_x > _length) then  {    _x = 0;  //reset internal timer    _obj say [_snd, 0];  //re-play sound  };  _x = _x + 1;  //increment internal timer  sleep 1;  //wait 1 second }; if (true) exitWith {};  //exit script I am assuming Radio1 is some sort of object (hence the "not alive"). Also, with this you can change how long till the sound is looped, what object it is played from, and what sound is played. So, putting this in it's init line would run the script: Init of Radio1 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> nil = [182, this, "sound1"] execVM "timer.sqf"; '182' is the length of the sound file, 'this' is the object (you are in it's init line) to play the sound from, ' "sound1" ' is the sound file you wish to play, it is important to keep the quotes around it. This code will let you use the same script for multiple sounds from multiple objects. Let me know if anything doesn't work ... might have some errors in there .. EDIT: Few errors fixed ...
-
Trouble with nearestObjects command
beta replied to beta's topic in ARMA - MISSION EDITING & SCRIPTING
I thought it had something to do with that ... Kind of figured it out, but that makes it clear. _vehicle WAS defined further up in the respawn vehicle script, it is the first element of the passed array from the editor, the unit itself (this). I didn't try using the event handler's array ... probably would have worked. Either way, once I got this "working", I ran into a bunch more roadblocks, and decided to take a simpler approach. Thanks for the help however, figuring out this language bit by bit! -
Having some problems with this command. This is the code I am using, Script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //Written by beta //Salvages disabled vehicles when in salvage truck _truck = _this select 0; //infinite loop for [{_i=0}, {_i<1}, {_i=0}] do {   _objArray = nearestObjects [_truck, ["Truck5tOpen", "WarfareWestSalvageTruck", "M1Abrams", "Stryker_ICV_M2", "Stryker_ICV_MK19", "UH60", "AH1W"], 20];     for [{_i = 0}, {_i < count _objArray}, {_i = _i + 1}] do   {     _x = _objArray select _i;         if (!(canMove _x) || !(canFire _x) && damage _x < 1) then     {      _x setDir getDir salvage_pad;      _x setPos getPos salvage_pad;      _truck vehicleChat "Vehicle Salvaged.";     };         sleep 0.1;   };   if (vehicle player == player) exitWith {};   sleep 5; }; if (true) exitWith {}; Run from init in a respawn script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //Written by beta // Modified from Domination by Xeno //Respawns _vehicle after _delay seconds if (!isServer) exitWith {};  //exit unless server //declare variables _vehicle = _this select 0; _delay = _this select 1; _startpos = getpos _vehicle; _startdir = getdir _vehicle; _type = typeOf _vehicle; //init vehicle _st = "clearMagazineCargo this; clearWeaponCargo this; this addEventhandler [""GetIn"", {[_vehicle] execVM ""scripts\salvage.sqf"";}];"; _vehicle setVehicleInit _st; processInitCommands; //infinite loop for [{_i=0}, {_i<1}, {_i=0}] do {   if (!(alive _vehicle)) exitWith   { sleep 0.1; _vehicle removeAllEventHandlers "killed"; _vehicle removeAllEventHandlers "getin"; _vehicle removeAllEventHandlers "getout"; sleep 0.5; _vehicle = objNull; sleep _delay; _newveh = _type createvehicle _startpos; _newveh setpos _startpos; _newveh setdir _startdir; nil = [_newveh, _delay] execVM "scripts\truckS_respawn.sqf"; }; sleep 1; }; if (true) exitWith {}; The error <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _objArray = |#|nearestObjects [_truck, ["Truck5tOpen", "WarfareWestSalvageTruck", "M1Abrams", "Stryker_ICV_M2", "Stryker_ICV_MK19", "UH60", "AH1W"], 20]; Error 0 elements provided, 3 expected Line 10 Not exactly sure what is wrong .. Any ideas? EDIT: Small error found, "_i = i + 1", fixed, problem still remains. EDIT 2: More exact error from the .rpt file: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> File C:\downloads\ArmA\missions\wac_coop_54_op_gloria_v104.Sara\scripts\salvage.sqf, line 10 Error in expression <_i=0}, {_i<1}, {_i=0}] do { _objArray = nearestObjects [_truck, ["Truck5tOpen", >  Error position: <nearestObjects [_truck, ["Truck5tOpen", > EDIT 3: Changing the object to be the base of the nearestObjects check to player (from _truck) removes the error. I tried using 'truck', a global variable, but the error still remains. Renaming the truck to 'tt' in the editor, and changing the base to 'tt' removes the error as well. It seems you cannot use a variable name as a value, it must be the object's name (not a pointer), so player, or some other name for an object is acceptable.
-
I'd like to know what some people's opinion is on "How many active AI is too many". I've designed a mission to "stress test" a server to see just how many AI it can really handle. I'd like to know what anyone else's results have been from similar tests.
-
I have made a script that will make all M136s a single-shot weapon. After you have shot it, you cannot access the gear menu (to get around dropping and picking it up again to use it), and once you bring back your rifle, the tube will disappear. The AT round is included with the launcher, so it is not necessary to carry or place "spares". Just the tubes. Also, this will not interfere with any other missile/rocket launchers. Potential problems: - if you die after firing it, other players will probably be able to use it again - switching to a pistol may not delete the tube - players can drop an infinite amount of M136 rounds, they are unable to be used however If there is significant issues, I could try to come up with some fixes for these known problems, but I don't see them being too great an issue for the amount of potential overhead. With that out of the way ... This is what you need to get it done: In your init.sqf (/sqs), place the following code to be executed on all clients: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //remove M136 after being fired, require only a launcher player addEventHandler ["fired", {if (_this select 1 == "M136") then {[_this select 0, _this select 1] execVM "remove_at_launcher.sqf";};}]; player addEventHandler ["animdone", {if (_this select 1 == "amovpknlmstpsraswrfldnon_amovpknlmstpsraswlnrdnon") then {[] execVM "add_at_ammo.sqf";};}]; This adds the required event handlers to all players. Create a file named "add_at_ammo.sqf", in it place the following code: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //Written by beta //Adds a loaded M136 when player selects it and //removes the M136 round if deselected _exit = false; if (!("M136" in weapons player)) then { if (true) exitWith {}; } else { player removeWeapon "M136"; player addMagazine "M136"; player addWeapon "M136"; player selectWeapon "M136"; player switchMove "amovpknlmstpsraswlnrdnon"; //infinite loop while {true} do { //if player is crouching or prone with a rifle if (animationState player == "amovppnemstpsraswrfldnon" || animationState player == "amovpknlmstpsraswrfldnon") then { player removeMagazine "M136"; if (true) exitWith {_exit = true;}; }; if (_exit) exitWith {}; sleep 0.3; }; }; if (true) exitWith {}; Create another file called "remove_at_launcher.sqf", in it place the following code: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //Written by beta //Remove an M136 launcher after it has been fired //when player switches to rifle or trys to reload it _unit = _this select 0; _weapon = _this select 1; _exit = false; //infinite loop while {true} do { //if prone, crouching, or reloading launcher if (animationState _unit == "amovppnemstpsraswrfldnon" || animationState _unit == "amovpknlmstpsraswrfldnon" || animationState _unit == "launcherreloadkneel") then { _unit removeWeapon "M136"; if (true) exitWith {_exit = true;}; }; _obj = nearestObject [_unit, "WeaponHolder"]; //get nearest dropped item deleteVehicle _obj; //delete dropped item until switched back (removes gear dialog) if (_exit) exitWith {}; sleep 0.3; }; if (true) exitWith {}; Once all of that is done, it is ready to play. All players in the mission will now have one-shot AT weapons (including OPFOR players). I have no plans to make this work with AI, I'll wait for ACE for that EDIT: Updated code to fix problems of incompatibility with other shoulder fired missiles/rockets. EDIT 2: Fixed weapons check code to be more efficient, simply checks if there isn't a M136, instead of the presence of all others.
-
I was wondering if I am understanding a part of your mission correctly. Sample from the x_createguardpatrolgroups.sqf file. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _number_basic_guard = 0; _number_specops_guard = 0; _number_tank_guard = ceil (random 2); _number_bmp_guard = ceil (random 3); _number_brdm_guard = ceil (random 2); _number_uaz_mg_guard = ceil (random 2); _number_uaz_grenade_guard = ceil (random 2); _number_basic_patrol = ceil (random 7);if (_number_basic_patrol < 3) then {_number_basic_patrol = 3;}; _number_specops_patrol = ceil (random 7);if (_number_specops_patrol < 3) then {_number_specops_patrol = 3;}; _number_tank_patrol = ceil (random 3); _number_bmp_patrol = ceil (random 3); _number_brdm_patrol = ceil (random 2); _number_uaz_mg_patrol = ceil (random 2); _number_uaz_grenade_patrol = ceil (random 2); This code is run once a new mission is created (I'm pretty sure?), so simply adding in some extra logic should allow the number of units spawned to depend on the player count. Take this as an example: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //count number of players on the server {if (!isNull _x) then {_playerCount = _playerCount + 1;}} forEach d_player_entities; . . . //create 3 infantry plus 1 for every 5 players _number_basic_patrol = floor(3 + playerCount / 5); At the beginning of the file, init the playerCount variable. Then, when setting the values for the number of enemy troops, do some math/logic to decide how many to make. In this case, it would be 3 troops as a base, then 1 for every 5 players on the server. Would this work as I think it would? I also noticed some more variables that seem related to the number of groups. Basically, I wanted to know if this script is run each time a new main mission (or side mission even?) is generated.
-
I think this is the most suited spot for this suggestion. This isn't about the radio for controlling the AI, but more about the VON radio. For me, the MOST wanted feature for ArmA 2 would be a DIFFERENT way of handling the voice communications in game. Currently, voice comms are treated exactly the same as text comms. This can cause MASSIVE problems on a public (even semi-public) server. The radio spam can reach epic proportions. My ideal solution (probably too late .. but you can always dream) would be this. There would be 2 basic types of voice communication, talking/yelling/whisper and radio transmissions. You can ALWAYS talk/yell/whisper (have 3 "channels", yelling can be heard from further than talking which can be heard further than whispering), and ANYONE can hear it. You can only send/receive radio transmissions when you actually have a radio (an object on the player, like binoculars). This radio can be set to transmit/receive on various frequencies, you can make this simple, like channel 1, channel 2, etc. Vehicle intercomms would have a "special" channel that only they could talk on (ie: channel 0 or -1). Furthermore, there would be various types of radios, handheld, manpack, vehicle. They would have different ranges (say 1km for handheld, 5km for manpack, 25km for vehicle as an example), a radio can RECEIVE transmissions from OUTSIDE its transmit range, so you could have someone with a manpack radio sending you a transmission from 3km away, but you couldn't talk back on your handheld radio. For ease-of-use purposes, you could have a "radio-tower" that transmits out to 100km (hey, now you know why we are always blowing those things up! ) which could be used for administration for the whole server. I think seperating the voice comms in this way would relieve a lot of the frustrations with over-used radio, but would still give all the benefits of an in-game radio system. Plus as an added benefit, things would become that much more realistic.
-
Max. recommended number of active triggers?
beta posted a topic in ARMA - MISSION EDITING & SCRIPTING
I haven't had the opportunity to test this on a server with a load of people (max. of 80). How many simultaneous triggers could be run? I do realize it would depend on their conditions, but I just want a general ballpark number that I should avoid getting near. Also, I would assume this number would be different on clients and servers (dedicated). Would you be able to run more triggers on a client or on the server? How many more? I know there are a lot of people here who would have much more experience than me in this, so thanks for your responses. -
Need help with rearming vehicle on respawn
beta replied to Rexxenexx's topic in ARMA - MISSION EDITING & SCRIPTING
Checking the biki, the addWeaponCargo and addMagazineCargocommands have local effects. So, I guess you would need to have the server tell all the clients to add these weapons/ammo to the vehicle. The hard part (the part I could never figure out) was how to send the clients the reference to the vehicle so they can do whatever to it. I hope you find an answer, if you do, make sure you post it here as I would be interested in seeing it! -
Basic continuous commands....
beta replied to spamurai's topic in ARMA - MISSION EDITING & SCRIPTING
For a never-ending fuel solution, you could try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> tank addEventHandler ["Fuel", {tank setFuel 1;}]; Place that in a script or the vehicle's init line, when "tank" has 0 fuel, "tank" will be refueled to full.