firecontrol
Member-
Content Count
23 -
Joined
-
Last visited
-
Medals
Community Reputation
0 NeutralAbout firecontrol
-
Rank
Private First Class
-
Get ScriptEdit <--- This is something of a godsend if you script at all. It even has the command reference taken straight from the wiki (updateable) in a panel on the right side.
-
SetPos problem and variable on dialog.
firecontrol replied to nullsystems's topic in ARMA - MISSION EDITING & SCRIPTING
Very odd. I just tested the last bit of code I gave you, and it worked quite nicely. I was able to create two ammo boxes, and when trying to make the third it said "Your quota is filled". I set it up with a trigger (radio alpha) that called the .sqf... and used a helo 'H' marker named "heli1". How've you got it set up? -
SetPos problem and variable on dialog.
firecontrol replied to nullsystems's topic in ARMA - MISSION EDITING & SCRIPTING
Sorry, didn't have time to check syntax. I think I might have left a dangling else in the above example.. (these are all just examples by the way, not tested at all. heheh) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> if (CRATEAMOUNT< 2) then {    _ammocrate = "Reammobox" createvehicle [getpos heli1 select 0,getpos heli1 select 1,getpos heli1 select 2];   _ammocrate addweaponcargo ["Binocular",1];   CRATEAMOUNT = CRATEAMOUNT +1;   if (isServer) then   {    publicVariable "CRATEAMOUNT";   }   else   {   }; } else {  hint 'Your quota is filled'; }; if (true) exitWith {}; ..and yes, you can change global variables from anywhere, that's what they're designed for. -
SetPos problem and variable on dialog.
firecontrol replied to nullsystems's topic in ARMA - MISSION EDITING & SCRIPTING
Try using a global variable. To do so, in your init.sqs/f file declare and define it. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">CRATEAMOUNT = 0; Then in your function which is called remove the old local variables... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> if (CRATEAMOUNT< 2) then {   _ammocrate = "Reammobox" createvehicle [getpos heli1 select 0,getpos heli1 select 1,getpos heli1 select 2];  _ammocrate addweaponcargo ["Binocular",1];  CRATEAMOUNT = CRATEAMOUNT +1;  if (isServer) then  {    publicVariable "CRATEAMOUNT";  }; }; else {   hint 'Your quota is filled'; }; if (true) exitWith {}; What happened here is that local variables are only known to the script. Once the script ends, then that memory is freed. As such, the contents of that variable go back into the bit bucket. A global variable should remain usable the life of the mission. To make a global variable, take off the _ from the name. _crateAmount becomes CRATEAMOUNT for instance. I use all caps for global variables just to help me keep things in order, it's not necessary though. One more thing, if this is for a MP type environment... you'll need to publicVariable any variable which needs to be transmitted to the clients. In this case, you'd need to update all the systems that one has been made. use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (isServer) then {publicVariable "CRATEAMOUNT"} I've heard bad things start to happen when you have clients trying to publicVariable something, which is why we make sure only the server does it. -
I think what he means is to, let's say, unban them... you'd have to find their PID and delete it. When you #exec ban 2, for example, it adds their real PID to the ban.txt file automatically if I'm not mistaken?
-
Looking for a complete Server.CFG Reference
firecontrol replied to ManDay's topic in ARMA - MULTIPLAYER
The biki is the best I've found yet... Hopefully it'll be more complete as time goes on. As far as grass on a dedicated server: Clicky -
Understanding objectives and triggers
firecontrol replied to rothy's topic in ARMA - MISSION EDITING & SCRIPTING
Class Tree You can check for the number of classes in the trigger's area... trigger should be EAST(or opfor), present In the trigger's conditions: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"man" countType thislist == 0 for just enemy men. Combine the two for the vehicles and men. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">("man" countType thislist == 0) && ("landVehicle" countType thislist == 0) A good way to keep from having to hunt down that one bugger who's hiding is to use <= 3 or something instead of == 0. That means when enemy men left are less than or equal to 3, it triggers. Thislist is a fancy keyword that takes all the units in the "Triggered by" list that are inside the trigger's area... quite handy. As always a disclaimer... not tested. -
Understanding objectives and triggers
firecontrol replied to rothy's topic in ARMA - MISSION EDITING & SCRIPTING
Backwards there... == <--- checks for equality = <--- sets a variable -
Triggering when out of ammo
firecontrol replied to namreg's topic in ARMA - MISSION EDITING & SCRIPTING
The 'ammo' keyword is checking the current # of rounds remaining IN the weapon, not the soldier's supply. That's why it triggers when your first magazine is depleted. You need to use the 'magazines' keyword as well... such as: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(((sniperguy ammo "m24") == 0) && (count magazines sniperguy == 0 )) If he has other stuff on him.. like any smoke grenades, other magazines, etc that won't trigger until he has nothing left. To only count M24 magazines, use this instead: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">(((sniperguy ammo "m24") == 0) && ({_x=="5Rnd_762x51_M24"} count magazines sniperguy == 0 )) -
How do you get a unit to move with a trigger?
firecontrol replied to Perrin-Major's topic in ARMA - MISSION EDITING & SCRIPTING
Well, you can make them empty, and create the pilots outside of them. Put a MOVE waypoint right under the pilot, then a GET IN waypoint on the helo, then the rest of the move, SAD, etc waypoints. Syncronize the trigger with the MOVE waypoint. -
setSkill array really work?
firecontrol replied to blackgrain's topic in ARMA - MISSION EDITING & SCRIPTING
Maybe set up some kind of experiment: One group setSkill via an array to 1, another group to 0.5, and another to 0.1, or even 0. Give them 3 seperate groups of targets (civilians or removeAllWeapons on opfor?) and see if there is a noticeable difference in their accuracy. Speaking of... when you: Hint format["%1",(coward skill "aimingaccuracy")]; after setting skill to 1.0... does it still say 0, or now does it say 1? If it says one, then that might confirm my theory of truncation. But I don't see why they would truncate.... makes no sense. I'm at work, else I'd be able to test it myself. -
setSkill array really work?
firecontrol replied to blackgrain's topic in ARMA - MISSION EDITING & SCRIPTING
Perhaps it's a precision issue, when you type cast from a number to a string? Anyone know how 'format' works exactly? As in C++ you can type cast variables, but you can also set precision so that decimals are not truncated and the like. By this I mean his accuracy really is 0.3... but when cast into a string, it drops the decimal and simply reports the integer 0? Just a thought... I really have no idea how exactly 'format' works other than it turns any type of variable into a string. -
Dedicated server debug
firecontrol replied to Comradesniper's topic in ARMA - MISSION EDITING & SCRIPTING
Edit: Nevermind.. appears my suggestion doesn't work either. -
easy weapons change respawn
firecontrol replied to Recon1's topic in ARMA - MISSION EDITING & SCRIPTING
Well, at mission start... just put it in his initialization field: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">removeAllWeapons this; this addMagazine "10Rnd_127x99_M107 "...(a few times); this addWeapon "M107" (and whatever else you want) When he respawns... call this from init.sqs: i.e. ---> Â [] exec "respawn.sqs" change 'player' to that specific player's name or else it will give it to all players when they respawn. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;this is respawn.sqs, for instance #START @ not (alive player) @ alive player if (local player) then { Â removeAllWeapons player; Â player addMagazine "10Rnd_127x99_M107 "; Â player addMagazine "10Rnd_127x99_M107 "; Â player addMagazine "10Rnd_127x99_M107 "; Â player addMagazine "10Rnd_127x99_M107 "; Â player addWeapon "M107"; } goto "START" note: always add the magazines before adding the weapon, else he'll start w/ an empty rifle. This is just to give you an idea of how to do it.. this is my no means how you would actually want to implement it in a true MP game... You'd have to set up some IF statements based on which type of player died, etc. Or better yet make it an SQF and use the switch/case feature. -
How to make cannons fire?
firecontrol replied to kinismo's topic in ARMA - MISSION EDITING & SCRIPTING
waitUntil is used in SQF files. @ is used in SQS files. The snippet he gave you is written in an SQF format. Here's how I did it, this will actually create explosions at the marker "tgt" in a 50 square meter zone as well... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_arty = _this select 0 _posX = getMarkerPos "tgt" select 0 _posY = getMarkerPos "tgt" select 1 _arty doWatch [_posx, _posy, 6000] Â Â Â Â Â Â Â Â Â ~((random 2.5) + 3) _arty fire "D30" Â Â Â Â Â Â ~8 _posX = _posX + ((random 100) - 50) _posY = _posy + ((random 100) - 50) "SH_125_HE" createVehicle [_posx, _posy, 0] IMPACT = true; if (local server) then {publicVariable "IMPACT"} exit I call it from 3 different D30's.. that's why the random wait is in there. So they don't all fire at exactly the same time. i.e. [arty1] exec "fire.sqs"; [arty2] exec "fire.sqs"; etc.