SCUD 1.30
Armed Assault Addon
Required Armed Assault version 1.05 or higher (Tested with 1.14)

************************************************************************************************************
*  Description
************************************************************************************************************
This Addon adds the SCUD Launcher that can launch a nuclear missile to Armed Assault.
Processing according to the nuclear explosion is very heavy, needs high spec machine.
Some texture is misappropriated from Operation Flashpoint.


************************************************************************************************************
*  Installation
************************************************************************************************************
Put gig_scud.pbo on \AddOns directory.
SCUD Launcher is added to [OPFOR > GIG SCUD > SCUD] in Mission Editor


************************************************************************************************************
*  Feature and Usage
************************************************************************************************************
* Can launch a ballistic missile.
When your board Scud driver's sheet, "Launch operation" is displayed in the action menu.
Or, when subordinate of your group boards Scud, "Call launch operation" is displayed in the action menu,
and you can direct the launching.

* Can rearm a missile.
When Scud enters the Scud Hanger, load 15KT, 80KT or unload missile is displayed in action menu.
And, it can direct it similarly for subordinate.

* Can acquire parameter of Scud by script, be operated, and change setting.
The command is shown in latter half of this Readme. The setting can be changed by Config Panel too.


************************************************************************************************************
*  Class Name
************************************************************************************************************
GIG_Scud
GIG_Hanger1
GIG_ConfigPanel


************************************************************************************************************
*  Using in scripts
************************************************************************************************************
** Various commands to Scud are executed. [ Scud, Command ]
** The command are "lock", "unlock", "erect", "unerect", "launch", "load15kt", "load80kt", "unload"
** "lock" is lock launch control of Scud. "Launch operation" is disabled.
** "unlock" is unlock launch control of Scud. "Launch operation" is enabled.
** "erect" is erect a missile loaded onto Scud.
** "unerect" is unerect a missile erected missile onto Scud.
** "launch" is launch a mssile. The missile loaded onto Scud is immediately launched.
** "load15kt" is load 15kt nuclear missile to Scud.
** "load80kt" is load 80kt nuclear missile to Scud.
** "unload" is unload to a missile loaded onto Scud
[scud1,"launch"] exec "gig_scud\com.sqs"

** Scud attacks a target. [ Scud, TargetPosX, TargetPosY ] or [ Scud, TargetGridX, TargetGridY ] or [ Scud, TargetUnit ]
** Coordinates or object is specified for the target.
[scud1,2500,3000] exec "gig_scud\attack.sqs"
[scud1,"Df","65"] exec "gig_scud\attack.sqs"
[scud1,target1] exec "gig_scud\attack.sqs"

** Fall 15kt and 80kt nuclear warhead to specified position.
** [ PosX, PosY, Warhead, ExplosionMethod ] or [ GridX, GridY, Warhead, ExplosionMethod ] or [ TargetUnit, Warhead, ExplosionMethod ]
** Warhead is specification of a kind of warhead. "15kt" or "80kt"
** ExplosionMethod is specification of explosion method. 1:default method 2:heavy and accuracy method
** 80kt and Method:2 is very heavy. It will game freeze it for tens of seconds by the time the explosion is finished.
[2500,3000,"15kt",1] exec "gig_scud\fall.sqs"
["Df","65","80kt",1] exec "gig_scud\fall.sqs"
[target1,"15kt",2] exec "gig_scud\fall.sqs

** 15kt and 80kt nuclear explosion to specified position.
** [ PosX, PosY, Warhead, ExplosionMethod ] or [ GridX, GridY, Warhead, ExplosionMethod ] or [ TargetUnit, Warhead, ExplosionMethod ]
** At Warhead, the kind of warhead is specified. "15kt" or "80kt"
** At ExplosionMethod, the explosion method is specified. 0:no damage method 1:default method 2:heavy and accuracy method
** 80kt and Method:2 is very heavy. It will game freeze it for tens of seconds by the time the explosion is finished.
[2500,3000,"15kt",1] exec "gig_scud\explosion.sqs"
["Df","65","80kt",0] exec "gig_scud\explosion.sqs"
[target1,"15kt",2] exec "gig_scud\explosion.sqs"

** Death rain and radiation by nuclear explosion to centering on specified position. [X-Pos,Y-Pos,Range,Duration(min)]
[2500,3000,2000,10] exec "\gig_scud\deathrain.sqs"

** 15kt and 80kt nuclear explosion sound to specified position. [X-Pos,Y-Pos]
[2500,3000] exec "\gig_scud\sndnuke.sqs"
[2500,3000] exec "\gig_scud\sndnuke_80kt.sqs"


***** Unit local variable *****
The Scud unit maintains some individual variables.
As for the variables, the Scud unit is not interfered with in other Scud unit because it is the unit peculiar.

------------------------------------------------------------------------------------------------------------
TargetPos [ x, y, ab, cd ]

Fall point coordinates of missile launched by the Scud.

x : Fall point X-coordinate. (scalar)
y : Fall point Y-coordinate. (scalar)
ab : Fall point horizontal axis map grid. (string)
cd : Fall point vertical axis map grid. (string)

e.g.)
_targetGridX = scud1 getVariable "TargetPos" select 2
_targetGridY = scud1 getVariable "TargetPos" select 3
hint format[ "Target position is %1%2", _targetGridX, _targetGridY ]

result is "Target position is bg59"


------------------------------------------------------------------------------------------------------------
ImpactTime [ h, m, s ]

Impact time of missile launched by the Scud.

h : Impact hours time. (scalar)
m : Impact miutes time. (scalar)
s : Impact seconds time. (scalar)

e.g.)
_hours = scud1 getVariable "ImpactTime" select 0
_minutes = scud1 getVariable "ImpactTime" select 1
_seconds = scud1 getVariable "ImpactTime" select 2
hint format[ "Impact time is %1:%2:%3", _hours, _minutes, _seconds ]

result is "Impact time is 12:31:25" 


------------------------------------------------------------------------------------------------------------
RemainTime [ h, m, s ]

Remainder time until impact of missile launched by the Scud.

h : Remain hours time. (scalar)
m : Remain miutes time. (scalar)
s : Remain seconds time. (scalar)

e.g.)
_hours = scud1 getVariable "RemainTime" select 0
_minutes = scud1 getVariable "RemainTime" select 1
_seconds = scud1 getVariable "RemainTime" select 2
hint format[ "Remain time is %1:%2:%3", _hours, _minutes, _seconds ]

result is "Remain time is 0:1:25"


------------------------------------------------------------------------------------------------------------
ControlState "Driving" or "Targeting" or "Targeted" or "Canceling"

Driver's control state of Scud operation.

"Driving" shows that the driver is driving Scud.
"Targeting" shows that the driver begins the launching operation, and has not set the target yet.
"Targeted" shows that the driver finished setting target.
"Canceling" shows that the driver canceling the launching operation, and has not finished unerecting the missile yet.

e.g.)
if( scud1 getVariable "ControlState" == "Targeted" ) then { hint "Target setting is completed!" }


------------------------------------------------------------------------------------------------------------
LaunchPadState "Loaded" or "Erecting" or "Erected" or "Launched" or "Unerecting"

State of Launch Pad with Scud.

"Loaded" shows that the missile is loaded, and it can drive Scud.
"Erecting" shows that the loaded missile began standing up. 
"Erected" shows that the loaded missile completed standing up.
"Launched" shows that the loaded missile is launched, and missile is not loaded onto Scud.
"Unerecting" shows that the erected missile is unerecting.

e.g.)
if( scud1 getVariable "LaunchPadState" == "Launched" ) then { hint "The missile is launched!" }


------------------------------------------------------------------------------------------------------------
LoadedWarhead "None" or "15kt" or "80kt"

The kind of the missile loaded onto Scud.

"None" shows that the missile is not loaded onto Scud.
"15kt" shows that the 15 Kilo ton nuclear missile is loaded onto Scud.
"80kt" shows that the 80 Kilo ton nuclear missile is loaded onto Scud.

e.g.)
hint format[ "The loaded missile is %1 nuke.", scud1 getVariable "LoadedWarhead" ]

result is "The loaded missile is 15kt nuke."
 

------------------------------------------------------------------------------------------------------------
LaunchedWarhead [ "None" or "15kt" or "80kt", "Notlaunched" or "Boost" or "Midcourse" or "Reentry", WarheadObject ]

The warhead and warhead object of launched missile.

"None" shows that the missile is not launched from Scud.
"15kt" shows that the 15 Kilo ton nuclear missile is launched from Scud.
"80kt" shows that the 80 Kilo ton nuclear missile is launched from Scud.
"Notlaunched" shows that the missile is not launched. At this time, the warhead object cannot be acquired.(WarheadObject=objNull)
"Boost" shows that the warhead is to be rising.
"Midcourse" shows that the warhead is outside the atmosphere. At this time, the warhead object cannot be acquired.(WarheadObject=objNull)
"Reentry" shows that the warhead is falling.
WarheadObject is an object of the missile or the warhead.

e.g.)
if ( _scud1 getVariable "WarheadState" select 1 == "Reentry" ) then { _obj = _scud1 getVariable "WarheadState" select 2 }
~5
_obj setdammage 1.0
hint "Interception success!"


------------------------------------------------------------------------------------------------------------
CamLaunch 0 or 1 or 2 or 3 or 4

After the missile is launched, The missile is produced with camera work.
The production can be made effective by setting a value to the variable before the missile launched.

0 is disabled camera production. Default value.
1-4 is variation of camera production.

e.g.)
scud1 setVariable [ "CamLaunch", 1 ]


------------------------------------------------------------------------------------------------------------
CamImpact 0 or 1

Before the missile explodes, The explosion is produced with camera work.
This production can be made effective by setting the value to this variable before the missile fall.

0 is disabled camera production. Default value.
1 is enabled camera production.

e.g.)
scud1 setVariable [ "CamImpact", 1 ]


------------------------------------------------------------------------------------------------------------
ExpMethod 0 or 1 or 2

The damage method to units and objects of the nuclear explosion is changed.
The explosion method can be changed by setting it to another value before it explodes.

0 is that units and objects doesn't suffer. Visual effect only.
1 is original damage method. The method is light but blast cannot be covered with wall and objects. Default value.
2 is ArmA normal damage method.

e.g.)
scud1 setVariable [ "ExpMethod", 2 ]


------------------------------------------------------------------------------------------------------------
GroupChat 0 or 1

The display of the group chat at the operation is switched.
It is recommended to set it before "Launch operation" begins.

0 is that the group chat display is disable.
1 is that the group chat display is enable. Default value.

e.g.)
scud1 setVariable [ "GroupChat", 0 ]


************************************************************************************************************
*  History
************************************************************************************************************
Ver1.3 - June 2, 2009
- Added 80kt warhead.
- Added Scud Hanger. Can missile loading onto Scud.
- Added Config Panel. Can some Scud parameter changing.
- Added Camera production mode.
- Corrected some issue.

Ver1.25 - Aug 22, 2008
- Reformed 3D model.
New model of SCUD vehicle by Vilas from VIBI. Gratitude for offer. 
- Added launch operation call to AI.
- Removed radioactivity screen effect.
- Added different explosion method that trees and walls collapse.(same ver1.0 method)
Can use method from fall2.sqs, exp2.sqs. 
- Corrected Thing, StaticWeapon, Ship objects not damaged.
- Corrected target map marker display bug.
- Corrected bullet doesn't penetrate through window. 

Ver1.2 - Aug 14, 2007
- Improved explosion effect.
Amount of particle used has increased.
- Changed damage method.
An extreme framerate decrease at explosion was reduced.
Instead, trees and walls do not collapse. 
Instead, blast is not covered with buildings.
- Added radioactivity effect after exploded. 
- Added breaking weather effect after exploded.
- Improved explosion luminescence at nighttime.
- Added Lock/Unlock launch control using in script.
- Added nuclear explosion sound using in script.
- Operated in ArmA ver1.05.
- Corrected damage was effective in expnod.sqs.
- Changed variable name of target point.

Ver1.0 - Jun 14, 2007
- First release.


************************************************************************************************************
Gigan (giganarma@gmail.com)
