Pyro05x/airfield control – User

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
 
m (Fix)
 
(8 intermediate revisions by one other user not shown)
Line 15: Line 15:
<!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.5/" /></Work><License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><prohibits rdf:resource="http://web.resource.org/cc/CommercialUse"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> -->
<!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.5/" /></Work><License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><prohibits rdf:resource="http://web.resource.org/cc/CommercialUse"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> -->
This is my most valuable piece of work.
This is my most valuable piece of work.
I'm polishing this off for the 505 release this month.
I'm polishing this off for the <s>505 release</s> 1.05 patch this month.
Due to the lack of players, this mission is just too big for early release.
Due to the lack of players, this mission is just too big for early release.
My editor is configured to use 4-character tab stops.
My editor is configured to use 4-character tab stops.
(I don't feel like reformatting it.)
(I don't feel like reformatting it to look correctly on here.)
==To Do==
==to do==


===Known Bugs===
===to do before v1.0 final release===
{{Important_bug|join in progress issue with the lights inside the hangar.}}


===Features to Add===
====known bugs====
{{Feature|important|High Priority: game locks up (or locks the computer up completely) when outro begins.}}
:* the specific cause of this is unknown.
''I '''really''' hate testing and debugging these kinds of bugs.''
* Low Priority: the oil pumps spin once and freeze the duration of the game.  no known fix or work-around.
 
====testing====
* switching "move" and "hold" waypoints
* switching "move" and "hold" waypoints
** init: find a way to name the groups and keep track of the waypoint id's
* class-specific equipment on spawn
** on capture: switching the waypoints
::so far, so good.
{{Important|Figure out more information about the [[addWaypoint]] and [[deleteWaypoint]] commands.}}
 
* add sandbag bunkers around the flag.
====features to add====
* more buildings and objects to create a better fighting environment...too much open area gives snipers too much of an advantage.
* better object choice for runway lights.
** maybe use the particle drop command to do this?
* begin work on the progress bar HUD element.  (v1.1 features may be here sooner than planned)
** make the box with 25 progress stages.
 
====tweaks====
* weapons crate contents
 
===scheduled for v1.1===
* more buildings and objects
** sandbags near the landing sites
** sandbags near the landing sites
** repair stations
** repair stations
** a power station and power lines
** a power station and power lines
*** destruction of power station results in a ''low-power'' state for the runway and hangar lights.
**** add generators.  start them when power station gets blown up.  if the generators go down, creepy darkness.
** other industrial buildings
** other industrial buildings
** maybe another hotel
** maybe another hotel
* find a way to beautifully display capture progress in a way that does not interfere with game play. (oooo shiny!)
* rescale the point system
:point gain possibly 5 per 10 seconds.  both flags are visible when the game starts.  when a team gains points the flag will slowly rise from the ground.  game ends when the flag hits the top (a score limit set by server (300-2000 range)) or the time limit is reached.  the team with the highest flag wins.
* movement actions and better model choice for the light switches in the hangar
* put <span style="background-color: #000">xxxxxx xxxxxxxx</span> or <span style="background-color: #000">xxxxxxxx xxxxxxxxxx</span> in the <span style="background-color: #000">xxx xxxxxx</span>.
* a paradropping system
** wait 30 seconds after selecting your drop location


===Tweaks===
===ideas for a v1.2 release===
* relocate the bases so the distances are even
* buildings/environment - '''complete overhaul'''
** probably going to move the blufor base to pita.
** a power station and power lines
* scheduled for v1.1:
** other industrial buildings
** find a way to create a custom in-game dialog box for flag capture progress. (oooo shiny!)
** a well-defined line between residential and industrial areas
 
===Things to ponder for a future revision===
* make the character climb up the flagpole, remove the enemy flag, hang his team's flag and climb back down.
* add buildings
** well-designed residential districts (upper and lower classes)
** well-designed residential districts (upper and lower classes)
** some houses here and there
** maybe some houses here and there
** apartment buildings
** apartment buildings
** farms?
** farms?
* less likely stuff:
** JointOps-style PSPs:  scattered spawn points that can be captured...this will have to include giving players the ability to choose their spawn points.
*** ''The scope of this idea strays from my original dream of a massive battle at nightfall.  It would have to be in a separate edition of the mission.''


===unlikely ideas===
* JointOps-style PSPs:  scattered spawn points that can be captured...this will have to include giving players the ability to choose their spawn points.
::''The scope of this idea strays from my original dream of a massive, centralized, battle at nightfall.  It would have to be in a separate edition of the mission.''
==features and scripts==


==Features and Scripts==
===counter-measures for choppers===
with audible alarm and visual representation of flares with a ''flickering'' effect.


===Counter-Measures for choppers===
{{hl|onIncomingMissile.sqf}}
with audible alarm and [finally] flares!!!
<sqf>
after a lot of tweaking, it has that ''flickering'' effect.
/* onIncomingMissile.sqf
{{Box File|onIncomingMissile.sqf|<pre>/* onIncomingMissile.sqf
  * written by pyro05x
  * written by pyro05x
  *
  *
Line 80: Line 102:
  * pyro05x[holyATcrap]gmail[omgDOThax]com */
  * pyro05x[holyATcrap]gmail[omgDOThax]com */


//this addEventHandler ["IncomingMissile", {_this execVM "onIncomingMissile.sqf"}];
//this addEventHandler ["IncomingMissile", {_this execVM "events\onIncomingMissile.sqf"}];
private ["_conSoundName","_conSoundLength","_conDistance","_conTypes","_conProbN","_conProbD","_target","_type","_missile","_loop","_conProbNa","_i","_misVel","_misSpd","_misPhi","_misTheta","_flickerArray"];
private ["_conSoundName","_conSoundLength","_conDistance","_conTypes","_conProbN","_conProbD","_target","_type","_missile","_loop","_conProbNa","_i","_misVel","_misSpd","_misPhi","_misTheta","_flickerArray"];


Line 104: Line 126:
_target = _this select 0;
_target = _this select 0;
_type = _this select 1;
_type = _this select 1;
if !(_type in _conTypes) exitWith {};
if !(_type in _conTypes) exitWith {echo "onIncomingMissile.sqf aborted at line 45; missile is not a heat-seeker."};
_missile = nearestObject [_this select 2, _type];
_missile = nearestObject [_this select 2, _type];
sleep 0.001;
sleep 0.001;
Line 110: Line 132:
_type=nil;
_type=nil;


//if ((_conProbN <= 0) or (_conProbD <= 0) or (_conProbD mod 1 != 0) or (_conProbN mod 1 != 0) or (_conProbN > _conProbD)) exitWith {echo "Error: Expected integer > 0.  See onIncomingMissile.sqf, lines 34-37."};
//if ((_conProbN <= 0) or (_conProbD <= 0) or (_conProbD mod 1 != 0) or (_conProbN mod 1 != 0) or (_conProbN > _conProbD)) exitWith {echo "Error: Expected integer > 0.  See events\onIncomingMissile.sqf, lines 34-37."};
//sleep 0.001;
//sleep 0.001;


Line 145: Line 167:
/* RandomDirectionPeriod */ 0,
/* RandomDirectionPeriod */ 0,
/* RandomDirectionIntensity */ 0,
/* RandomDirectionIntensity */ 0,
/* OnTimer */ "sparklies.sqf",
/* OnTimer */ "events\sparklies.sqf",
/* BeforeDestroy */ "",
/* BeforeDestroy */ "",
/* Object */ _target];
/* Object */ _target];
Line 165: Line 187:
0,
0,
0,
0,
"sparklies.sqf",
"events\sparklies.sqf",
"",
"",
_target];
_target];
Line 200: Line 222:
{
{
sleep 0.01;
sleep 0.01;
if (!alive _missile) exitWith {};
if (!alive _missile) exitWith {echo "onIncomingMissile.sqf aborted at line 141; missile has asploded."};
if (endGame) exitWith {};
if (endGame) exitWith {echo "onIncomingMissile.sqf aborted at line 142; game is ending."};
if ((_missile distance _target) < _conDistance) then
if ((_missile distance _target) < _conDistance) then
{
{
Line 229: Line 251:
_misPhi = acos( sqrt((_misVel select 0)^2 + (_misVel select 1)^2) / _misSpd );
_misPhi = acos( sqrt((_misVel select 0)^2 + (_misVel select 1)^2) / _misSpd );
sleep 0.001;
sleep 0.001;
_misTheta = 1.5-random(3) + _misTheta;
_misTheta = 1.5 - random(3) + _misTheta;
_misPhi = 0-random(3) + _misPhi;
_misPhi = 0 - random(3) + _misPhi;
sleep 0.001;
sleep 0.001;


Line 250: Line 272:
};
};
};
};
</pre>}}
</sqf>


{{Box File|sparklies.sqf|<pre>/* sparklies.sqf
{{hl|events\sparklies.sqf}}
<sqf>
/* sparklies.sqf
  * written by pyro05x
  * written by pyro05x
  *
  *
Line 288: Line 312:
/* BeforeDestroy */ "",
/* BeforeDestroy */ "",
/* Object */ ""];
/* Object */ ""];
</pre>}}
</sqf>


===King of the Hill===
===king of the hill===
:I don't plan on modifying this one any more.  Right now, it appears to be a solid script.
:I don't plan on modifying this one any more.  Right now, it appears to be a solid script.
{{Box File|onPlayerKilled.sqf|<pre>/* onPlayerKilled.sqf
 
{{hl|events\onPlayerKilled.sqf}}
<sqf>
/* onPlayerKilled.sqf
  * written by pyro05x
  * written by pyro05x
  *
  *
Line 315: Line 342:
// wOwned (boolean value, true if west owns the flag)
// wOwned (boolean value, true if west owns the flag)
// eOwned (boolean value, true if east owns the flag)
// eOwned (boolean value, true if east owns the flag)
//player addEventHandler ["killed", {_this execVM "onPlayerKilled.sqf"}];
//player addEventHandler ["killed", {_this execVM "events\onPlayerKilled.sqf"}];


private ["_conAPoint","_conDPoint","_conDist","_objFlag","_zMult","_vic","_vicSide","_perp","_perpSide","_vicXY","_perpXY","_flagZ","_pType","_pPoint"];
private ["_conAPoint","_conDPoint","_conDist","_objFlag","_zMult","_vic","_vicSide","_perp","_perpSide","_vicXY","_perpXY","_flagZ","_pType","_pPoint"];
Line 424: Line 451:
};
};
enableEndDialog;
enableEndDialog;
</pre>}}
</sqf>


===Lighting up the runway===
===lighting up the runway===
:The Island of Antigua has a dirt runway on it.  I decided to light it up because it looks cool and the mission is at night.
:The Island of Antigua has a dirt runway on it.  I decided to light it up because it looks cool and the mission is at night.
{{Box File|loadScripts\runway.sqf|<pre>/* runway.sqf
 
{{hl|loadScripts\runway.sqf}}
<sqf>
/* runway.sqf
  * by pyro05x
  * by pyro05x
  *
  *
Line 445: Line 475:
  * pyro05x[holyATcrap]gmail[omgDOThax]com */
  * pyro05x[holyATcrap]gmail[omgDOThax]com */


private ["_i","_x","_y","_dist","_var","_cos102","_sin102"];
private ["_i","_x","_y","_dist","_var","_rcos102","_rsin102"];


//distance between each "light"
//distance between each "light"
Line 451: Line 481:


//I used substitution in the position formulas because it is more efficient.
//I used substitution in the position formulas because it is more efficient.
//Although creating over 100 radio towers is not =D
//Although creating over 100 radio towers just for the light on top is not =D
//cos(102) = sin(192)
//cos(102) = sin(192)
//sin(102) = -cos(192)
//sin(102) = -cos(192)
Line 461: Line 491:
_rcos102 = -0.207912 * _dist;
_rcos102 = -0.207912 * _dist;
_rsin102 = 0.978148 * _dist;
_rsin102 = 0.978148 * _dist;
_i = 0;


while {_i < 55} do
for "_i" from 0 to 54 do
{
{
//_x = (18213.2+_dist*cos(192)) + ((_i-32)*_dist*_cos102);
//_x = (18213.2+_dist*cos(192)) + (_i*_dist*_cos102);
//_y = (17957.3+_dist*sin(192)) + ((_i-32)*_dist*_sin102);
//_y = (17957.3+_dist*sin(192)) + (_i*_dist*_sin102);
_x = (18213.2-_rsin102) + ((_i-32)*_rcos102);
_x = 18213.2 - _rsin102 + (_i * _rcos102);
_y = (17957.3+_rcos102) + ((_i-32)*_rsin102);
_y = 17957.3 + _rcos102 + (_i * _rsin102);
sleep 0.01;
sleep 0.01;
_var = format ["runway%1",_i];
_var = format ["runway%1", _i];
call compile format ["%1 = 'Land_radar' createVehicleLocal [%2,%3,0];%1 setPos [%2,%3,-16.5]",_var,_x,_y];
call compile (_var + " = 'Land_radar' createVehicleLocal [_x,_y,0]; " + _var + " setPos [_x,_y,-16.5]");
sleep 0.01;
sleep 0.01;
_i=_i+1;
};
};


while {_i < 110} do
for "_i" from 0 to 54 do
{
{
//_x = (18213.2+_dist*cos(12)) + ((_i-87)*_dist*_cos102);
//_x = (18213.2+_dist*cos(12)) + (_i*_dist*_cos102);
//_y = (17957.3+_dist*sin(12)) + ((_i-87)*_dist*_sin102);
//_y = (17957.3+_dist*sin(12)) + (_i*_dist*_sin102);
_x = (18213.2+_rsin102) + ((_i-87)*_rcos102);
_x = 18213.2 + _rsin102 + (_i * _rcos102);
_y = (17957.3-_rcos102) + ((_i-87)*_rsin102);
_y = 17957.3 - _rcos102 + (_i * _rsin102);
sleep 0.01;
sleep 0.01;
_var = format ["runway%1",_i];
_var = format ["runway%1", _i];
call compile format ["%1 = 'Land_radar' createVehicleLocal [%2,%3,0];%1 setPos [%2,%3,-16.5]",_var,_x,_y];
call compile (_var + " = 'Land_radar' createVehicleLocal [_x,_y,0]; " + _var + " setPos [_x,_y,-16.5]");
sleep 0.01;
sleep 0.01;
_i=_i+1;
};
};
</pre>}}
</sqf>


===Awarding points to a player===
===awarding points to a player===
:The file's header explains it quite clearly...
:The file's header explains it quite clearly...
{{Box File|pScore.sqf|<pre>/* pScore.sqf
 
{{hl|pScore.sqf}}
<sqf>
/* pScore.sqf
  * written by pyro05x
  * written by pyro05x
  *
  *
Line 522: Line 552:
_points = _this select 1;
_points = _this select 1;
_delay = _this select 2;
_delay = _this select 2;
if (isNil ("_points")) then {_points = 1;};
if isNil("_points") then {_points = 1;};
if (isNil ("_delay")) then {_delay = 0.001;};
if isNil("_delay") then {_delay = 0.001;};
_s = "";
_s = "";
if ((name player == _pName) and (_points > 0)) then
if ((name player == _pName) and (_points > 0)) then
Line 545: Line 575:
_r = "OPFOR";
_r = "OPFOR";
};
};
titleText [format ["\n\n%1 has captured the flag for the %2 team!%3", _pName, _r, _s], "plain down"];
titleText [("\n\n"+_pName+" has captured the flag for the "+_r+" team!"+_s), "plain down"];


_pName=nil;
_pName=nil;
Line 556: Line 586:
_player addScore _points;
_player addScore _points;
};
};
</pre>}}
</sqf>


===Flag capture progress===
===flag capture progress===
:The progress is shown in a textual form for now.  A dialog box is scheduled for v1.1.  I'm still trying to figure out how to create dialogs that do not interfere with gameplay.  Currently, you can't move while a dialog is open.
:The progress is shown in a textual form for now.  A dialog box is scheduled for v1.1.  I'm still trying to figure out how to create dialogs that do not interfere with game play.  Currently, you can't move while a dialog is open.


:'''This file is not published under a Creative Commons License.'''
:Starting over on this...
{{Box File|progress.hpp|<pre>#define FontM "tahomaB"
#define ST_LEFT 0
#define ST_RIGHT 1
#define ST_CENTER 2
#define CT_STATIC 0
#define CT_LISTBOX 5
#define CT_SLIDER 3
#define ST_HPOS 0x0F
#define Col_DkGray {0.4, 0.4, 0.4, 0.7}
#define Col_LtGray {0.7, 0.7, 0.7, 0.8}
#define Col_Invis {0.4, 0.4, 0.4, 0.0}
#define wRes 1024
#define hRes 768


class RscText
{{hl|progress.hpp}}
{
<syntaxhighlight lang="cpp">
type = CT_STATIC;
idc = -1;
style = ST_LEFT;
colorBackground[] = Col_Invis;
colorText[] = Col_DkGray;
font = FontM;
sizeEx = 0.04;
};
 
class RscListBox
{
type = CT_LISTBOX;
style = ST_LEFT;
idc = -1;
colorText[] = Col_DkGray;
colorBackground[] = Col_Invis;
colorSelect[] = Col_DkGray;
colorSelectBackground[] = Col_Invis;
font = FontM;
sizeEx = 0.025;
rowHeight = 0.04;
};


class RscSliderH {
DELETED!
type = CT_SLIDER;
style = ST_HPOS;
color[] = Col_DkGray;
idc = -1;
sizeEx = 0.025;
};


class DlgProgress {
</syntaxhighlight>
idd = 4130;
movingEnable = true;
controlsBackground[] = { ProgressBg, StatusBorder };
class ProgressBg : RscText {
colorBackground[] = Col_LtGray;
text = ;
idc = 413000;
x = 0.5 - 90/wRes;//0.5 - (180/2)/wRes;//0.42 - 0.02;
y = 0.2 - 30/hRes;//0.2 - (60/2)/hRes;//0.78 - 0.08;
w = 180/wRes;//0.16 + 0.04;
h = 60/hRes;//0.11;
};
class StatusBorder : RscListBox {
idc = 413001;
x = 0.5 - 82/wRes;//0.5 + (8 - 180/2)/wRes;//0.42 - 0.005;
y = 0.2 - 22/hRes;//0.2 + (8 - 60/2)/hRes;//0.78 - 0.005;
w = 164/wRes;//(180-16)/wRes;//0.16 + 0.01;
h = 18/hRes;//0.02 + 0.01;
text = ;
};
controls[] = { FlagStatus, ProgressText };
class FlagStatus : RscSliderH {
idc = 413010;
x = 0.5 - 80/wRes;//0.5 + (10 - 180/2)/wRes;//0.42;
y = 0.2 - 20/hRes;//0.2 + (10 - 60/2)/hRes;//0.78;
w = 160/wRes;//(180-20)/wRes;//0.16;
h = 14/hRes;//0.02;
};
class ProgressText : RscText {
idc = 413011;
x = 0.5 - 78/wRes;//0.5 + (12 - 180/2)/wRes;//0.42;
y = 0.2 - 6/hRes;//0.2 + (24 - 60/2)/hRes;//0.82;
w = 174/wRes;//(180-16)/wRes;//0.16;
h = 22/hRes;//0.06;
text = "Hanging flag...";
};
};
</pre>}}

Latest revision as of 10:29, 20 March 2024

http://i.creativecommons.org/l/by-nc-sa/2.5/88x31.png
All work shown here is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License unless otherwise indicated.

This is my most valuable piece of work. I'm polishing this off for the 505 release 1.05 patch this month. Due to the lack of players, this mission is just too big for early release. My editor is configured to use 4-character tab stops. (I don't feel like reformatting it to look correctly on here.)

to do

to do before v1.0 final release

known bugs

High Priority: game locks up (or locks the computer up completely) when outro begins.
  • the specific cause of this is unknown.

I really hate testing and debugging these kinds of bugs.

  • Low Priority: the oil pumps spin once and freeze the duration of the game. no known fix or work-around.

testing

  • switching "move" and "hold" waypoints
  • class-specific equipment on spawn
so far, so good.

features to add

  • better object choice for runway lights.
    • maybe use the particle drop command to do this?
  • begin work on the progress bar HUD element. (v1.1 features may be here sooner than planned)
    • make the box with 25 progress stages.

tweaks

  • weapons crate contents

scheduled for v1.1

  • more buildings and objects
    • sandbags near the landing sites
    • repair stations
    • a power station and power lines
      • destruction of power station results in a low-power state for the runway and hangar lights.
        • add generators. start them when power station gets blown up. if the generators go down, creepy darkness.
    • other industrial buildings
    • maybe another hotel
  • find a way to beautifully display capture progress in a way that does not interfere with game play. (oooo shiny!)
  • rescale the point system
point gain possibly 5 per 10 seconds. both flags are visible when the game starts. when a team gains points the flag will slowly rise from the ground. game ends when the flag hits the top (a score limit set by server (300-2000 range)) or the time limit is reached. the team with the highest flag wins.
  • movement actions and better model choice for the light switches in the hangar
  • put xxxxxx xxxxxxxx or xxxxxxxx xxxxxxxxxx in the xxx xxxxxx.
  • a paradropping system
    • wait 30 seconds after selecting your drop location

ideas for a v1.2 release

  • buildings/environment - complete overhaul
    • a power station and power lines
    • other industrial buildings
    • a well-defined line between residential and industrial areas
    • well-designed residential districts (upper and lower classes)
    • maybe some houses here and there
    • apartment buildings
    • farms?

unlikely ideas

  • JointOps-style PSPs: scattered spawn points that can be captured...this will have to include giving players the ability to choose their spawn points.
The scope of this idea strays from my original dream of a massive, centralized, battle at nightfall. It would have to be in a separate edition of the mission.


features and scripts

counter-measures for choppers

with audible alarm and visual representation of flares with a flickering effect.

onIncomingMissile.sqf

/* onIncomingMissile.sqf * written by pyro05x * * This script alerts the crew of the vehicle if a missile (guided or * unguided) is fired and will most likely hit the vehicle. * * Note: The only global variable required is endGame, which should remain * false until the outro or the debriefing. * * This file and its contents are the property of Cory B. It is licensed * under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 * License. To view a copy of this license, visit * http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to * Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, * 94105, USA. Those wishing to exercise the terms of this license may contact * me (Cory B.) on the Bohemia Interactive Forums which may be found at * http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi . * Alternatively, I may be contacted by email at * pyro05x[holyATcrap]gmail[omgDOThax]com */ //this addEventHandler ["IncomingMissile", {_this execVM "events\onIncomingMissile.sqf"}]; private ["_conSoundName","_conSoundLength","_conDistance","_conTypes","_conProbN","_conProbD","_target","_type","_missile","_loop","_conProbNa","_i","_misVel","_misSpd","_misPhi","_misTheta","_flickerArray"]; //name of the sound to be played (defined in Description.ext) _conSoundName = "missilewarn"; //length of sound file (seconds) _conSoundLength = 0.242; //distance til the measures affect the missile's direction (meters) _conDistance = 100; //list of ammo types for "smart" projectile _conTypes = ["M_Strela_AA","M_Stinger_AA","M_Javelin_AT","M_Sidewinder_AA","M_R73_AA"]; //probability that the missile will get confused by the flares. this is tested //ten times a second, so keep it less than 1/2. only accepts integers greater //than zero. also, simplify the numbers (ie. 4/10 = 2/5). //(hint: probability = successes / total tests) _conProbN = 1; //numerator _conProbD = 4; //denominator _target = _this select 0; _type = _this select 1; if !(_type in _conTypes) exitWith {echo "onIncomingMissile.sqf aborted at line 45; missile is not a heat-seeker."}; _missile = nearestObject [_this select 2, _type]; sleep 0.001; _type=nil; //if ((_conProbN <= 0) or (_conProbD <= 0) or (_conProbD mod 1 != 0) or (_conProbN mod 1 != 0) or (_conProbN > _conProbD)) exitWith {echo "Error: Expected integer > 0. See events\onIncomingMissile.sqf, lines 34-37."}; //sleep 0.001; spawn { _missile = _missile select 4; if (alive _missile and !endGame) then { (crew _target select 0) vehicleChat "Counter-measures automatically launched."; spawn { //heehee... this array has 200 elements. _flickerArray = [1,5,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2, 2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2, 2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2, 2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2, 2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,2+random 2,0]; for "_i" from 1 to 5 do { drop [ /* ShapeName */ "\ca\data\ParticleEffects\SPARKSEFFECT\SparksEffect", /* AnimationName */ "", /* Type */ "Billboard", /* TimerPeriod */ 0.2, /* LifeTime */ 10, /* Position */ [0,3.5,2.2], /* MoveVelocity */ [5,-2,0], /* RotationVelocity */ 0, /* Weight */ 0.1, /* Volume */ 0.04, /* Rubbing */ 0.2, /* Size */ _flickerArray, /* Color */ [[1,0.6,0.5,1]], /* AnimationPhase */ [], /* RandomDirectionPeriod */ 0, /* RandomDirectionIntensity */ 0, /* OnTimer */ "events\sparklies.sqf", /* BeforeDestroy */ "", /* Object */ _target]; drop [ "\ca\data\ParticleEffects\SPARKSEFFECT\SparksEffect", "", "Billboard", 0.4, 10, [0,3.5,2.2], [-5,-2,0], 0, 0.1, 0.04, 0.2, _flickerArray, [[1,0.6,0.5,1]], [], 0, 0, "events\sparklies.sqf", "", _target]; sleep 0.7; //playSound "click"; }; }; }; while {alive _missile and alive _target and !endGame} do { if (player in (crew _target)) then { playSound _conSoundName; }; sleep _conSoundLength; _missile = _missile select 4; }; }; if (local server) then { _conProbNa = []; for "_i" from 1 to _conProbN do { _conProbNa set [_i-1,_i]; sleep 0.0002; }; _conProbN=nil; //not using waitUntil in this case because it does not update fast enough _loop = true; for [{},{_loop},{_loop=_loop}] do { sleep 0.01; if (!alive _missile) exitWith {echo "onIncomingMissile.sqf aborted at line 141; missile has asploded."}; if (endGame) exitWith {echo "onIncomingMissile.sqf aborted at line 142; game is ending."}; if ((_missile distance _target) < _conDistance) then { _loop = false; }; _missile = _missile select 4; }; _loop=nil; while {(alive _missile) and !endGame} do { _missile = _missile select 4; if (floor(random _conProbD) in _conProbNa) then { _misVel = velocity _missile; _misSpd = 0.277778 * speed _missile; // 1 km/h = 0.277778 m/s sleep 0.001; _misTheta = direction _missile; /* cos(phi) = (Ax*Bx + Az*Bz + Ay*By) / (|A|*|B|) since Ax=Bx and Az=Bz and By=0, substitutions can be made cos(phi) = (Ax^2 + Az^2) / (|A|*sqrt(Ax^2 + Az^2)) u*v/(v^(1/2)) = u*(v^(1/2)) = u*sqrt(v) cos(phi) = sqrt(Ax^2 + Az^2) / |A| phi = arccos( sqrt(Ax^2 + Az^2) / |A| ) */ _misPhi = acos( sqrt((_misVel select 0)^2 + (_misVel select 1)^2) / _misSpd ); sleep 0.001; _misTheta = 1.5 - random(3) + _misTheta; _misPhi = 0 - random(3) + _misPhi; sleep 0.001; // x = r*sin(theta)*cos(phi) y = r*sin(theta)*sin(phi) z = r*cos(theta) _missile setVelocity [_misSpd*sin(_misTheta)*cos(_misPhi), _misSpd*cos(_misTheta), _misSpd*sin(_misTheta)*sin(_misPhi)]; sleep 0.001; _missile setDir _misTheta; _misPhi = _misPhi + 90.0; _missile setVectorUp [sin(_misTheta)*cos(_misPhi), cos(_misTheta), sin(_misTheta)*sin(_misPhi)]; sleep 0.001; } else { sleep 0.005; }; sleep 0.095; }; };

events\sparklies.sqf

/* sparklies.sqf * written by pyro05x * * This script causes sparks to come off of a flare * * This file and its contents are the property of Cory B. It is licensed * under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 * License. To view a copy of this license, visit * http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to * Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, * 94105, USA. Those wishing to exercise the terms of this license may contact * me (Cory B.) on the Bohemia Interactive Forums which may be found at * http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi . * Alternatively, I may be contacted by email at * pyro05x[holyATcrap]gmail[omgDOThax]com */ drop [ /* ShapeName */ "\ca\data\ParticleEffects\SPARKSEFFECT\SparksEffect", /* AnimationName */ "", /* Type */ "Billboard", /* TimerPeriod */ 1, /* LifeTime */ .2, /* Position */ _this, /* MoveVelocity */ velocity nearestObject _this, /* RotationVelocity */ 1, /* Weight */ 0.007, /* Volume */ 0.004, /* Rubbing */ 0.8, /* Size */ [0.5,0], /* Color */ [[1,.5,0,1]], /* AnimationPhase */ [], /* RandomDirectionPeriod */ 0.04, /* RandomDirectionIntensity */ 2, /* OnTimer */ "", /* BeforeDestroy */ "", /* Object */ ""];

king of the hill

I don't plan on modifying this one any more. Right now, it appears to be a solid script.

events\onPlayerKilled.sqf

/* onPlayerKilled.sqf * written by pyro05x * * This script awards a player points to his score for defending the flag or * assaulting a defender. The result is a larger emphasis on the "King of the * Hill" element of the Capture & Hold gametype. * * I added a few variables that can be easily changed. * * This file and its contents are the property of Cory B. It is licensed * under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 * License. To view a copy of this license, visit * http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to * Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, * 94105, USA. Those wishing to exercise the terms of this license may contact * me (Cory B.) on the Bohemia Interactive Forums which may be found at * http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi . * Alternatively, I may be contacted by email at * pyro05x[holyATcrap]gmail[omgDOThax]com */ //required public variables: // wOwned (boolean value, true if west owns the flag) // eOwned (boolean value, true if east owns the flag) //player addEventHandler ["killed", {_this execVM "events\onPlayerKilled.sqf"}]; private ["_conAPoint","_conDPoint","_conDist","_objFlag","_zMult","_vic","_vicSide","_perp","_perpSide","_vicXY","_perpXY","_flagZ","_pType","_pPoint"]; //distance in which the victim or the killer must be to receive points. _conDist = 25; //points awarded for assaulting the enemy flag (killing a defender) _conAPoint = 1; //points awarded for defending the flag (killing an attacker) _conDPoint = 1; //reference to the FLAG object _objFlag = baseflag; //calculated Z distance multiplier //this multiplier will modify the how the distance calculator sees the //z-coordinate of a player to change the shape of the flag zone. _zMult = 1; //sphere (default) //_zMult = 2; //squashed sphere //_zMult = 0.5; //extra tall sphere //_zMult = 0; //cylinder /////////////////////////////////////////////////////////////////////////////// ///// CAUTION ////// CAUTION ////// CAUTION ////// CAUTION ////// CAUTION ///// /////////////////////////////////////////////////////////////////////////////// //Modifying the below may cause your system to crash, lock up, overheat, //explode, dissolve, or disappear. I cannot and will not be responsible for //any result due to the ignorance of an individual. _vic = _this select 0; _vicSide = side _vic; _perp = _this select 1; _perpSide = side _perp; sleep 0.01; // teamkills (and civilian kills) don't count! :D if !((_vicSide == west and _perpSide == east) or (_vicSide == east and _perpSide == west)) exitWith {enableEndDialog}; _vicXY = getPosASL _vic; _perpXY = getPosASL _perp; _flagZ = (getPosASL _objFlag) select 2; sleep 0.01; _vicXY set [2, _flagZ + _zMult * ((_vicXY select 2) - _flagZ)]; _perpXY set [2, _flagZ + _zMult * ((_perpXY select 2) - _flagZ)]; sleep 0.01; _vicSide=nil; _flagZ=nil; _zMult=nil; // no points if not in the area if (( (_vicXY distance _objFlag) min (_perpXY distance _objFlag) ) > _conDist) exitWith {enableEndDialog}; sleep 0.01; _vic=nil; _vicXY=nil; _perpXY=nil; _conDist=nil; _objFlag=nil; _pType = "assault"; if ( ((_perpSide == west) and wOwned) or ((_perpSide == east) and eOwned) ) then { _pType = "defense"; }; sleep 0.01; _pPoint = switch (_pType) do { case "assault":{_conAPoint}; case "defense":{_conDPoint}; }; _conAPoint=nil; _conDPoint=nil; if (local server) then { _perp addScore _pPoint; }; _perp sideChat format ["I killed a%1 %2er!", switch (_perpSide) do { case west:{"n OPFOR"}; case east:{" BLUFOR"};}, switch (_pType) do { case "assault":{"attack"}; case "defense":{"defend"};}]; sleep 0.01; _perpSide=nil; if (player == _perp) then { if (_pPoint == 1) then { hint format ["You earned a flag %1 point!", _pType]; } else { if (_pPoint > 0) then { hint format ["You earned %1 flag %2 points!", _pPoint, _pType]; }; }; }; enableEndDialog;

lighting up the runway

The Island of Antigua has a dirt runway on it. I decided to light it up because it looks cool and the mission is at night.

loadScripts\runway.sqf

/* runway.sqf * by pyro05x * * this script lights up the runway on antigua island. Currently it is not as * easy to spot from the air as it should be. * * This file and its contents are the property of Cory B. It is licensed * under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 * License. To view a copy of this license, visit * http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to * Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, * 94105, USA. Those wishing to exercise the terms of this license may contact * me (Cory B.) on the Bohemia Interactive Forums which may be found at * http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi . * Alternatively, I may be contacted by email at * pyro05x[holyATcrap]gmail[omgDOThax]com */ private ["_i","_x","_y","_dist","_var","_rcos102","_rsin102"]; //distance between each "light" _dist = 15; //I used substitution in the position formulas because it is more efficient. //Although creating over 100 radio towers just for the light on top is not =D //cos(102) = sin(192) //sin(102) = -cos(192) //sin(102) = cos(12) //cos(102) = -sin(12) //_rcos102 = _dist*cos(102); //_rsin102 = _dist*sin(102); _rcos102 = -0.207912 * _dist; _rsin102 = 0.978148 * _dist; for "_i" from 0 to 54 do { //_x = (18213.2+_dist*cos(192)) + (_i*_dist*_cos102); //_y = (17957.3+_dist*sin(192)) + (_i*_dist*_sin102); _x = 18213.2 - _rsin102 + (_i * _rcos102); _y = 17957.3 + _rcos102 + (_i * _rsin102); sleep 0.01; _var = format ["runway%1", _i]; call compile (_var + " = 'Land_radar' createVehicleLocal [_x,_y,0]; " + _var + " setPos [_x,_y,-16.5]"); sleep 0.01; }; for "_i" from 0 to 54 do { //_x = (18213.2+_dist*cos(12)) + (_i*_dist*_cos102); //_y = (17957.3+_dist*sin(12)) + (_i*_dist*_sin102); _x = 18213.2 + _rsin102 + (_i * _rcos102); _y = 17957.3 - _rcos102 + (_i * _rsin102); sleep 0.01; _var = format ["runway%1", _i]; call compile (_var + " = 'Land_radar' createVehicleLocal [_x,_y,0]; " + _var + " setPos [_x,_y,-16.5]"); sleep 0.01; };

awarding points to a player

The file's header explains it quite clearly...

pScore.sqf

/* pScore.sqf * written by pyro05x * * Description: Awards !points! points to player !player! after a !delay! * second delay. * * Syntax: [player, points, delay] execVM "pScore.sqf" * Parameters: player: Object * points: Number (optional, default=1) * delay: Number (optional, default=0.001) * * Example: [this, 2, 0] execVM "pScore.sqf"; * * This file and its contents are the property of Cory B. It is licensed * under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 * License. To view a copy of this license, visit * http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to * Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, * 94105, USA. Those wishing to exercise the terms of this license may contact * me (Cory B.) on the Bohemia Interactive Forums which may be found at * http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi . * Alternatively, I may be contacted by email at * pyro05x[holyATcrap]gmail[omgDOThax]com */ private ["_player","_pName","_pSide","_points","_delay","_s","_r"]; _player = _this select 0; _pName = name _player; _pSide = side _player; //assign this early in case _player dies during this script. _points = _this select 1; _delay = _this select 2; if isNil("_points") then {_points = 1;}; if isNil("_delay") then {_delay = 0.001;}; _s = ""; if ((name player == _pName) and (_points > 0)) then { if (_points == 1) then { _s = "\n\nGood Job! You were awarded a capture point!"; } else { _s = format ["\n\nGood Job! You were awarded %1 points for flag capture!", _points]; }; }; sleep _delay; _delay=nil; _r = "BLUFOR"; if (_pSide == east) then { _r = "OPFOR"; }; titleText [("\n\n"+_pName+" has captured the flag for the "+_r+" team!"+_s), "plain down"]; _pName=nil; _pSide=nil; _r=nil; _s=nil; if (local server) then { _player addScore _points; };

flag capture progress

The progress is shown in a textual form for now. A dialog box is scheduled for v1.1. I'm still trying to figure out how to create dialogs that do not interfere with game play. Currently, you can't move while a dialog is open.
Starting over on this...

progress.hpp

DELETED!