Skip to content

SWAT Source Documentation

bignugies edited this page Sep 29, 2015 · 11 revisions

This is our custom documentation of the SWAT Source Code

A collection of notes about the old map files

List of methods in the 2007 map and new map

function InitGlobals takes nothing returns nothing

Huge method that initializes everything

function InitSounds takes nothing returns nothing

Creates a variety of sound effects. Initialized at game started

function CreateAllItems takes nothing returns nothing

Only does: call CreateItem( 'I01M', -842.7, -1945.2 )

function CreateUnitsForPlayer9 takes nothing returns nothing

Creates units for "Player 9". Not entirely sure but I think these are dummy units used for various abilities and item effects

function CreateUnitsForPlayer10 takes nothing returns nothing

This method makes just two units: set gg_unit_Ulic_0013 = CreateUnit( p, 'Ulic', -23.7, 18.0, 352.485 ) set gg_unit_Udre_0014 = CreateUnit( p, 'Udre', 61.2, 42.8, 119.020 )

These seem to be udg_RadDmgCiv and udb_RadDmgHero respectively.

function CreateNeutralPassiveBuildings takes nothing returns nothing

Creates neutral passive buildings and sets resources to 1?

function CreateNeutralPassive takes nothing returns nothing

Creates neutral units. Think this creates scientist and stuff

function CreatePlayerBuildings takes nothing returns nothing

Does nothing

function CreatePlayerUnits takes nothing returns nothing

Simply calls CreateUnitsForPlayer9 and CreateUnitsForPlayer10

function CreateAllUnits takes nothing returns nothing

Simply calls the other 4 create methods (neutral and player)

function CreateRegions takes nothing returns nothing

Sets all of the regions used in the game

function RedMsg takes player oP, string s1 returns nothing

Displays text on a specific player's screen

function RedMsgAll takes string s1 returns nothing

Displays text on all players screens

function RedMsgNPC takes unit oUnit, string s1 returns nothing

Displays text above the specified unit

function RedMsgPubPer takes string s1, player oP, string s2 returns nothing

No idea but this method never seems to be called. Messages every player and displays text to the team. Then displays a message, s2 to just player oP

function RedNotifyInvFull takes player oP returns nothing

Sends a message to player oP: "Inventory is full." and plays a sound, gg_snd_InvFull.

List of unit codes codes

gg_unit_Ulic_0013 Dummy Rad Damage Civ unit gg_unit_Udre_0014 Dummy Rad Damage Hero unit

List of item codes

I00B = Active Solar Batteries I000 = Inactive Solar Batteries

##Global variables, and their purpose 'udg_nDifficulty' A difficulty modifier used when updating many different aspects of difficulty. The LOWER the number, the more it raises difficulty when modifying stuff.

'udg_SuperRad' The unit entity for the super rad, if one is created.

'udg_SuperRadCount' The extra radiation the SuperRad contributes.

'udg_HeroSpecs' Always takes parameters of this form [ iP*udg_Specs+n ] > n-1 When n = 1, it is checking for power armor When n = 1, it is checking for power armor When n = 1, it is checking for power armor When n = 1, it is checking for power armor When n = 1, it is checking for power armor

##Wc3 quirks Any references to time is based on military time.

Clone this wiki locally