
srb2lua {
	name = "SRB2 Lua Script";
	comment_begin = "--[[", "/*";
	comment_end =  "]]", "*/";
	comment_line = "--", "//";
	case_sensitive = true;
	block_begin = "{";
	block_end = "}";
	word_block_begin = "do", "function", "if";
	word_block_end = "end";

	keywords = {
		and, break, continue, do, else, elseif, end, false, for, function,
		if, in, local, nil, not, or, repeat, return, then, true, until, while,
		$1, $2, $3, $4, $5, $6, $7, $8, $9
	}

	constants = {
		false,
		true,
		nil,

		// userdata types
		valid,

		sprnames,
		states,
		mobjinfo,
		S_Sfx, sfxinfo,
		players,
		powers,
		skins,
		mapthings,
		mapheaderinfo,
		vertexes,
		lines,
		sides,
		subsectors,
		sectors,
		sidenum,
		hudinfo,

		// console variable flags
		CV_OnOff,
		CV_YesNo,
		CV_Unsigned,
		CV_Natural,
		CV_SAVE,
		CV_CALL,
		CV_NETVAR,
		CV_NOINIT,
		CV_FLOAT,
	 	CV_NOTINNET,
	 	CV_MODIFIED,
		CV_SHOWMODIF,
		CV_SHOWMODIFONETIME,
	 	CV_NOSHOWHELP,
		CV_HIDEN,
		CV_HIDDEN,
		CV_CHEAT,

		// integer type limits
		INT8_MIN,
		INT16_MIN,
		INT32_MIN,
		INT8_MAX,
		INT16_MAX,
		INT32_MAX,
		UINT8_MAX,
		UINT16_MAX,
		UINT32_MAX,

		// angles
		ANG1,
		ANG2,
		ANG10,
		ANG15,
		ANG20,
		ANG30,
		ANG60,
		ANG64h,
		ANG105,
		ANG210,
		ANG255,
		ANG340,
		ANG350,

		ANGLE_11hh,
		ANGLE_22h,
		ANGLE_45,
		ANGLE_67h,
		ANGLE_90,
		ANGLE_112h,
		ANGLE_135,
		ANGLE_157h,
		ANGLE_180,
		ANGLE_202h,
		ANGLE_225,
		ANGLE_247h,
		ANGLE_270,
		ANGLE_292h,
		ANGLE_315,
		ANGLE_337h,
		ANGLE_MAX,

		// misc
		FRACUNIT,
		FRACBITS,
		TICRATE,
		NEWTICRATERATIO,
		NEWTICRATE,
		MUSICRATE,
		RING_DIST,
		PUSHACCEL,
		MODID,
		CODEBASE,
		VERSION,
		FLOATSPEED,
		MAXSTEPMOVE,
		USERANGE,
		MELEERANGE,
		MISSILERANGE,
		ONFLOORZ,
		ONCEILINGZ,
		INFLIVES,

		// translucency levels
		TR_TRANS10,
		TR_TRANS20,
		TR_TRANS30,
		TR_TRANS40,
		TR_TRANS50,
		TR_TRANS60,
		TR_TRANS70,
		TR_TRANS80,
		TR_TRANS90,
		NUMTRANSMAPS,

		// frame settings
		FF_FRAMEMASK,
		FF_SPR2SUPER,
		FF_SPR2ENDSTATE,
		FF_SPR2MIDSTART,
		FF_TRANSMASK,
		FF_TRANSSHIFT,
		FF_TRANS10,
		FF_TRANS20,
		FF_TRANS30,
		FF_TRANS40,
		FF_TRANS50,
		FF_TRANS60,
		FF_TRANS70,
		FF_TRANS80,
		FF_TRANS90,
		FF_FULLBRIGHT,
		FF_VERTICALFLIP,
		FF_PAPERSPRITE,
		FF_ANIMATE,
		FF_RANDOMANIM,
		FF_GLOBALANIM,
		FF_HORIZONTALFLIP,

		// translation colormaps
		TC_DEFAULT,
		TC_BOSS,
		TC_METALSONIC,
		TC_ALLWHITE,
		TC_RAINBOW,
		TC_BLINK,
		TC_DASHMODE,

		// A_Chase directions
		DI_NODIR,
		DI_EAST,
		DI_NORTHEAST,
		DI_NORTH,
		DI_NORTHWEST,
		DI_WEST,
		DI_SOUTHWEST,
		DI_SOUTH,
		DI_SOUTHEAST,
		NUMDIRS,

		// damage/death types
		DMG_WATER,
		DMG_FIRE,
		DMG_ELECTRIC,
		DMG_SPIKE,
		DMG_NUKE,
		DMG_INSTAKILL,
		DMG_DROWNED,
		DMG_SPACEDROWN,
		DMG_DEATHPIT,
		DMG_CRUSHED,
		DMG_SPECTATOR,
		DMG_CANHURTSELF,
		DMG_DEATHMASK,

		// skin flags
		SF_SUPER,
		SF_NOSUPERSPIN,
		SF_NOSPINDASHDUST,
		SF_HIRES,
		SF_NOSKID,
		SF_NOSPEEDADJUST,
		SF_RUNONWATER,
		SF_NOJUMPSPIN,
		SF_NOJUMPDAMAGE,
		SF_STOMPDAMAGE,
		SF_MARIODAMAGE,
		SF_MACHINE,
		SF_DASHMODE,
		SF_FASTEDGE,
		SF_MULTIABILITY,
		SF_NONIGHTSROTATION,
		SF_NOSUPERSPRITES,

		// Character abilities
		CA_NONE,
		CA_THOK,
		CA_FLY,
		CA_GLIDEANDCLIMB,
		CA_HOMINGTHOK,
		CA_SWIM,
		CA_DOUBLEJUMP,
		CA_FLOAT,
		CA_SLOWFALL,
		CA_TELEKINESIS,
		CA_FALLSWITCH,
		CA_JUMPBOOST,
		CA_AIRDRILL,
		CA_JUMPTHOK,
		CA_BOUNCE,
		CA_TWINSPIN,
		CA2_NONE,
		CA2_SPINDASH,
		CA2_GUNSLINGER,
		CA2_MELEE,

		// player states
		PST_LIVE,
		PST_DEAD,
		PST_REBORN,

		// skin sounds
		SKSSPIN,
		SKSPUTPUT,
		SKSPUDPUD,
		SKSPLPAN1,
		SKSPLPAN2,
		SKSPLPAN3,
		SKSPLPAN4,
		SKSPLDET1,
		SKSPLDET2,
		SKSPLDET3,
		SKSPLDET4,
		SKSPLVCT1,
		SKSPLVCT2,
		SKSPLVCT3,
		SKSPLVCT4,
		SKSTHOK,
		SKSSPNDSH,
		SKSZOOM,
		SKSSKID,
		SKSGASP,
		SKSJUMP,

		// internal player flags
		PF_FLIPCAM,
		PF_ANALOGMODE,
		PF_DIRECTIONCHAR,
		PF_AUTOBRAKE,
		PF_GODMODE,
		PF_NOCLIP,
		PF_INVIS,
		PF_ATTACKDOWN,
		PF_USEDOWN,
		PF_JUMPDOWN,
		PF_WPNDOWN,
		PF_STASIS,
		PF_JUMPSTASIS,
		PF_FULLSTASIS,
		PF_APPLYAUTOBRAKE,
		PF_STARTJUMP,
		PF_JUMPED,
		PF_NOJUMPDAMAGE,
		PF_STARTDASH,
		PF_THOKKED,
		PF_SHIELDABILITY,
		PF_GLIDING,
		PF_BOUNCING,
		PF_SLIDING,
		PF_TRANSFERTOCLOSEST,
		PF_DRILLING,
		PF_GAMETYPEOVER,
		PF_TAGIT,
		PF_FORCESTRAFE,
		PF_CANCARRY,
		PF_FINISHED,

		// player animations
		PA_ETC,
		PA_IDLE,
		PA_EDGE,
		PA_WALK,
		PA_RUN,
		PA_DASH,
		PA_PAIN,
		PA_ROLL,
		PA_JUMP,
		PA_SPRING,
		PA_FALL,
		PA_ABILITY,
		PA_ABILITY2,
		PA_RIDE,

		// shield types
		SH_NONE,
		SH_PITY,
		SH_WHIRLWIND,
		SH_ARMAGEDDON,
		SH_PINK,
		SH_ELEMENTAL,
		SH_ATTRACT,
		SH_FLAMEAURA,
		SH_BUBBLEWRAP,
		SH_THUNDERCOIN,
		SH_FORCE,
		SH_FORCEHP,
		SH_FIREFLOWER,
		SH_STACK,
		SH_NOSTACK,
		SH_PROTECTFIRE,
		SH_PROTECTWATER,
		SH_PROTECTELECTRIC,
		SH_PROTECTSPIKE,

		// carry types
		CR_NONE,
		CR_GENERIC,
		CR_PLAYER,
		CR_NIGHTSMODE,
		CR_NIGHTSFALL,
		CR_BRAKGOOP,
		CR_ZOOMTUBE,
		CR_ROPEHANG,
		CR_MACESPIN,
		CR_MINECART,
		CR_ROLLOUT,
		CR_PTERABYTE,

		// emerald flags
		EMERALD1,
		EMERALD2,
		EMERALD3,
		EMERALD4,
		EMERALD5,
		EMERALD6,
		EMERALD7,

		// button flags
		BT_WEAPONMASK,
		BT_WEAPONNEXT,
		BT_WEAPONPREV,
		BT_ATTACK,
		BT_USE,
		BT_CAMLEFT,
		BT_CAMRIGHT,
		BT_TOSSFLAG,
		BT_JUMP,
		BT_FIRENORMAL,
		BT_CUSTOM1,
		BT_CUSTOM2,
		BT_CUSTOM3,

		// current weapon
		WEP_AUTO,
		WEP_BOUNCE,
		WEP_SCATTER,
		WEP_GRENADE,
		WEP_EXPLODE,
		WEP_RAIL,
		NUM_WEAPONS,

		// kick reasons
		KR_KICK,
		KR_BAN,
		KR_LEAVE,
		KR_TIMEOUT,
		KR_SYNCH,
		KR_PINGLIMIT,

		// slope flags
		SL_NOPHYSICS,
		SL_DYNAMIC,

		// emblem flags
		GE_NIGHTSPULL,
		GE_NIGHTSITEM,
		ME_ALLEMERALDS,
		ME_ULTIMATE,
		ME_PERFECT,

		// jingle types
		JT_NONE,
		JT_OTHER,
		JT_MASTER,
		JT_1UP,
		JT_SHOES,
		JT_INV,
		JT_MINV,
		JT_DROWN,
		JT_SUPER,
		JT_GOVER,
		JT_NIGHTSTIMEOUT,
		JT_SSTIMEOUT,

		// player powers
		pw_invulnerability,
		pw_sneakers,
		pw_flashing,
		pw_shield,
		pw_carry,
		pw_tailsfly,
		pw_underwater,
		pw_spacetime,
		pw_extralife,
		pw_pushing,
		pw_justsprung,
		pw_noautobrake,
		pw_super,
		pw_gravityboots,
		pw_infinityring,
		pw_automaticring,
		pw_bouncering,
		pw_scatterring,
		pw_grenadering,
		pw_explosionring,
		pw_railring,
		pw_emeralds,
		pw_nights_superloop,
		pw_nights_helper,
		pw_nights_linkfreeze,
		pw_nocontrol,
		pw_dye,
		pw_justlaunched,
		pw_ignorelatch,

		// gametype rules
		GTR_CAMPAIGN,
		GTR_RINGSLINGER,
		GTR_SPECTATORS,
		GTR_LIVES,
		GTR_TEAMS,
		GTR_FIRSTPERSON,
		GTR_POWERSTONES,
		GTR_TEAMFLAGS,
		GTR_FRIENDLY,
		GTR_SPECIALSTAGES,
		GTR_EMERALDTOKENS,
		GTR_EMERALDHUNT,
		GTR_RACE,
		GTR_TAG,
		GTR_POINTLIMIT,
		GTR_TIMELIMIT,
		GTR_OVERTIME,
		GTR_HURTMESSAGES,
		GTR_FRIENDLYFIRE,
		GTR_STARTCOUNTDOWN,
		GTR_HIDEFROZEN,
		GTR_BLINDFOLDED,
		GTR_RESPAWNDELAY,
		GTR_PITYSHIELD,
		GTR_DEATHPENALTY,
		GTR_NOSPECTATORSPAWN,
		GTR_DEATHMATCHSTARTS,
		GTR_SPAWNINVUL,
		GTR_SPAWNENEMIES,
		GTR_ALLOWEXIT,
		GTR_NOTITLECARD,
		GTR_CUTSCENES,

		// P_FlashPal palettes
		PAL_WHITE,
		PAL_MIXUP,
		PAL_RECYCLE,
		PAL_NUKE,

		// TypeOfLevel flags
		TOL_SP,
		TOL_COOP,
		TOL_COMPETITION,
		TOL_RACE,
		TOL_MATCH,
		TOL_TAG,
		TOL_CTF,
		TOL_CUSTOM,
		TOL_2D,
		TOL_MARIO,
		TOL_NIGHTS,
		TOL_ERZ3,
		TOL_XMAS,

		// Linedef flags
		ML_IMPASSIBLE,
		ML_BLOCKMONSTERS,
		ML_TWOSIDED,
		ML_DONTPEGTOP,
		ML_DONTPEGBOTTOM,
		ML_EFFECT1,
		ML_NOCLIMB,
		ML_EFFECT2,
		ML_EFFECT3,
		ML_EFFECT4,
		ML_EFFECT5,
		ML_NETONLY,
		ML_NONET,
		ML_EFFECT6,
		ML_BOUNCY,
		ML_TFERLINE,
	}

	functions {
		print = "string output, [string output2], [...]";
		chatprint = "string output, [boolean sound]";
		chatprintf = "player_t player, string output, [boolean sound]";
		freeslot = "string resource, [string resource2], [...]";
		super = "mobj_t actor, int var1, int var2";
		addHook = "string hook, function(?) fn, [int extra]";
		IsPlayerAdmin = "player_t player";
		userdataType = "* v";
		reserveLuabanks;

		// math
		abs = "int a";
		min = "int a, int b";
		max = "int a, int b";
		sin = "angle angle";
		cos = "angle angle";
		tan = "angle angle";
		FixedAngle = "fixed angle";
		AngleFixed = "angle angle";
		InvAngle = "angle angle";
		FixedMul = "fixed a, fixed b";
		FixedInt = "fixed a";
		FixedDiv = "fixed a, fixed b";
		FixedRem = "fixed a, fixed b";
		FixedSqrt = "fixed a";
		FixedHypot = "fixed a, fixed b";
		FixedFloor = "fixed a";
		FixedTrunc = "fixed a";
		FixedCeil = "fixed a";
		FixedRound = "fixed a";

		// misc
		GetSecSpecial = "int special, int section";
		All7Emeralds = "int flags";
		ColorOpposite = "int color";

		// p_random
		P_Random;
		P_RandomFixed;
		P_RandomByte;
		P_SignedRandom;
		P_RandomChance = "fixed p";
		P_RandomKey = "int a";
		P_RandomRange = "int a, int b";

		// p_maputil
		P_AproxDistance = "fixed dx, fixed dy";
		P_ClosestPointOnLine = "fixed x, fixed y, line_t line";

		// p_enemy
		P_CheckMeleeRange = "mobj_t actor";
		P_JetbCheckMeleeRange = "mobj_t actor";
		P_FaceStabCheckMeleeRange = "mobj_t actor";
		P_SkimCheckMeleeRange = "mobj_t actor";
		P_CheckMissileRange = "mobj_t actor";
		P_NewChaseDir = "mobj_t actor";
		P_LookForPlayers = "mobj_t actor, [fixed dist], [boolean allaround?], [boolean tracer?]";

		// p_mobj
		P_SpawnMobj = "fixed x, fixed y, fixed z, int type";
		P_SpawnMobjFromMobj = "mobj_t origin, fixed x, fixed y, fixed z, int type";
		P_RemoveMobj = "mobj_t mobj";
		P_IsValidSprite2 = "mobj_t mobj, int sprite2";
		P_SpawnLockOn = "player_t player, mobj_t target, state_t state";
		P_SpawnMissile = "mobj_t source, mobj_t dest, int type";
		P_SpawnXYZMissile = "mobj_t source, mobj_t dest, int type, fixed x, fixed y, fixed z";
		P_SpawnPointMissile = "mobj_t source, fixed dest_x, fixed dest_y, fixed dest_z, int type, fixed x, fixed y, fixed z";
		P_SpawnAlteredDirectionMissile = "mobj_t source, int type, fixed x, fixed y, fixed z, int angle_shift";
		P_ColorTeamMissile = "mobj_t missile, player_t player";
		P_SPMAngle = "mobj_t source, int type, angle angle, [boolean allowaim?], [int flags2]";
		P_SpawnPlayerMissile = "mobj_t source, int type, [int flags2]";
		P_MobjFlip = "mobj_t mobj";
		P_WeaponOrPanel = "int type";
		P_FlashPal = "player_t player, int type, int duration";
		P_GetClosestAxis = "mobj_t mobj";
		P_GetMobjGravity = "mobj_t mobj";
		P_SpawnParaloop = "fixed x, fixed y, fixed z, fixed radius, int number, int type, int rotate, [int state], [boolean spawncenter?]";
		P_BossTargetPlayer = "mobj_t actor, [boolean closest?]";
		P_SupermanLook4Players = "mobj_t actor";
		P_SetScale = "mobj_t mobj, fixed scale";
		P_CheckDeathPitCollide = "mobj_t mobj";
		P_InsideANonSolidFFloor = "mobj_t mobj, ffloor_t rover";
		P_CheckSolidLava = "mobj_t mobj, ffloor_t rover";
		P_CanRunOnWater = "player_t player, ffloor_t rover";

		// p_slopes
		P_GetZAt = "pslope_t slope, fixed x, fixed y";

		// p_user
		P_GetPlayerHeight = "player_t player";
		P_GetPlayerSpinHeight = "player_t player";
		P_GetPlayerControlDirection = "player_t player";
		P_AddPlayerScore = "player_t player, int amount";
		P_StealPlayerScore = "player_t player, int amount";
		P_GetJumpFlags = "player_t player";
		P_PlayerInPain = "player_t player";
		P_DoPlayerPain = "player_t player, [mobj_t source], [mobj_t inflictor]";
		P_ResetPlayer = "player_t player";
		P_PlayerCanDamage = "player_t player, mobj_t mobj";
		P_IsObjectOnGround = "mobj_t mobj";
		P_SetObjectMomZ = "mobj_t mobj, fixed momz, [boolean relative?]";
		P_RestoreMusic = "player_t player";
		P_SpawnShieldOrb = "player_t player";
		P_SpawnGhostMobj = "mobj_t mobj";
		P_GivePlayerRings = "player_t player, int amount";
		P_GivePlayerLives = "player_t player, int amount";
		P_GiveCoopLives = "player_t player, int amount, [boolean playsound]";
		P_ResetScore = "player_t player";
		P_BlackOw = "player_t player";
		P_ElementalFire = "player_t player";
		P_DoPlayerExit = "player_t player";
		P_InstaThrust = "mobj_t mobj, angle angle, fixed move";
		P_ReturnThrustX = "mobj_t mobj, angle angle, fixed move";
		P_ReturnThrustY = "mobj_t mobj, angle angle, fixed move";
		P_LookForEnemies = "player_t player";
		P_NukeEnemies = "mobj_t inflictor, mobj_t source, fixed radius";
		P_HomingAttack = "mobj_t source, mobj_t target";
		P_SpawnThokMobj = "player_t player";
		P_SpawnSpinMobj = "player_t player, int type";
		P_Telekinesis = "player_t player, fixed_t thrust, fixed_t range";
		P_SwitchShield = "player_t player, int shield";
		P_PlayJingle = "player_t player, int jingletype";
		P_PlayJingleMusic = "player_t player, string musname, [int musflags], [boolean looping], [int jingletype]";
		P_InQuicksand = "mobj_t mobj";
		P_InSpaceSector = "mobj_t mobj";
		P_DoJumpShield = "player_t player";
		P_DoBubbleBounce = "player_t player";
		P_IsObjectInGoop = "mobj_t mobj";
		P_SpawnSkidDust = "player_t player, fixed_t radius, [int sound]";
		P_Earthquake = "mobj_t inflictor, mobj_t source, fixed_t radius";

		// r_data
		R_TextureNumForName = "string name";
		R_CheckTextureNumForName = "string name";

		// p_map
		P_CheckPosition = "mobj_t mobj, fixed x, fixed y, fixed z";
		P_TryMove = "mobj_t mobj, fixed x, fixed y, [boolean allowdrowoff?]";
		P_Move = "mobj_t actor, int speed";
		P_TeleportMove = "mobj_t mobj, fixed x, fixed y, fixed z";
		P_SlideMove = "mobj_t mo";
		P_BounceMove = "mobj_t mo";
		P_CheckSight = "mobj_t source, mobj_t target";
		P_CheckHoopPosition = "mobj_t hoop, fixed x, fixed y, fixed z, fixed radius";
		P_RadiusAttack = "mobj_t inflictor, mobj_t source, fixed radius, [int damagetype], [boolean sightcheck]";
		P_FloorzAtPos = "fixed x, fixed y, fixed z, fixed height";
		P_DoSpring = "mobj_t spring, mobj_t object";

		// p_inter
		P_RemoveShield = "player_t player";
		P_DamageMobj = "mobj_t target, [mobj_t inflictor], [mobj_t source], [int damage]";
		P_KillMobj = "mobj_t target, [mobj_t inflictor], [mobj_t source]";
		P_PlayerRingBurst = "player_t player, [int numrings]";
		P_PlayerWeaponPanelBurst = "player_t player";
		P_PlayerWeaponAmmoBurst = "player_t player";
		P_PlayerEmeraldBurst = "player_t player, [boolean toss?]";
		P_PlayerFlagBurst = "player_t player, [boolean toss?]";
		P_PlayRinglossSound = "mobj_t source, [player_t player]";
		P_PlayDeathSound = "mobj_t source, [player_t player]";
		P_PlayVictorySound = "mobj_t source, [player_t player]";
		P_PlayLivesJingle = "player_t player";
		P_CanPickupItem = "player_t player, [boolean weapon?]";
		P_DoNightsScore = "player_t player";
		P_DoMatchSuper = "player_t player";

		// p_spec
		P_Thrust = "mobj_t mobj, angle angle, fixed move";
		P_SetMobjStateNF = "mobj_t mobj, int statenum";
		P_DoSuperTransformation = "player_t player, [boolean giverings?]";
		P_ExplodeMissile = "mobj_t missile";
		P_PlayerTouchingSectorSpecial = "player_t player, int section, int specialnum";
		P_FindSpecialLineFromTag = "int special, int tag, [int start]";
		P_SwitchWeather = "int weather, [player_t player]";
		P_LinedefExecute = "int tag, [mobj_t actor], [sector_t caller]";
		P_SpawnLightningFlash = "sector_t sector";
		P_FadeLight = "int tag, int destvalue, int speed, [boolean ticbased, [boolean force]";
		P_ThingOnSpecial3DFloor = "mobj_t mobj";
		P_SetupLevelSky = "int skynum, [player player]";
		P_SetSkyboxMobj = "mobj_t mobj, [boolean centerpoint?], [player_t user]";
		P_StartQuake = "fixed intensity, int time, [table{x/y/z} epicenter], [fixed radius]";
		P_IsFlagAtBase = "int type";
		EV_CrumbleChain = "sector_t sector, ffloor_t rover";
		EV_StartCrumble = "sector_t sector, ffloor_t rover, [boolean floating], [player_t player], [fixed origalpha], [boolean crumblereturn]";

		// r_defs
		R_PointToAngle = "fixed x, fixed y";
		R_PointToAngle2 = "fixed x, fixed y, fixed dest_x, fixed dest_y";
		R_PointToDist = "fixed x, fixed y";
		R_PointToDist2 = "fixed x, fixed y, fixed dest_x, fixed dest_y";
		R_PointInSubsector = "fixed x, fixed y";

		// r_things
		R_Char2Frame = "string char";
		R_Frame2Char = "int frame";
		R_SetPlayerSkin = "player_t player, int/string skin";
		R_SkinUsable = "player_t player, int/string skin";

		// r_draw
		R_GetColorByName = "string colorname";
		R_GetNameByColor = "int color";

		// s_sound
		S_StartSound = "mobj_t origin, int soundnum, [player_t player]";
		S_StartSoundAtVolume = "mobj_t origin, int soundnum, int volume, [player_t player]";
		S_StopSound = "mobj_t origin";
		S_ChangeMusic = "int musicnum, [[boolean looping?, [player_t player, [int tracknum, [int position, [int prefadems], [int fadeinms]";
		S_SpeedMusic = "fixed musicspeed, [player_t player]";
		S_StopMusic = "[player_t player]";
		S_SetInternalMusicVolume = "int volume, [player_t player]";
		S_StopFadingMusic = "[player_t player]";
		S_FadeMusic = "int target_volume, int ms, [player_t player]";
		S_FadeOutStopMusic = "int ms, [player_t player]";
		S_OriginPlaying = "mobj_t origin";
		S_IdPlaying = "int soundnum";
		S_SoundPlaying = "mobj_t origin, int soundnum";
		S_StartMusicCaption = "player_t player, string caption, int lifespan";
		S_GetMusicLength;
		S_GetMusicPosition;
		S_SetMusicPosition = "int position";

		// g_game
		G_BuildMapName = "int map";
		G_EnoughPlayersFinished;
		G_DoReborn = "int playernum";
		G_ExitLevel = "[int nextmap], [boolean skipstats]";
		G_SetCustomExitVars = "[int nextmap], [int skipstats]";
		G_IsSpecialStage = "int map";
		G_AddGametype = "table t";
		G_GametypeUsesLives;
		G_GametypeHasTeams;
		G_GametypeHasSpectators;
		G_RingSlingerGametype;
		G_PlatformGametype;
		G_TagGametype;
		G_TicsToHours = "int tics";
		G_TicsToMinutes = "int tics, [boolean full?]";
		G_TicsToSeconds = "int tics";
		G_TicsToCentiseconds = "int tics";
		G_TicsToMilliseconds = "int tics";

		// console
		COM_AddCommand = "string name, function(player_t player/[string arg]/...) fn, int flags";
		COM_BufAddText = "player_t player, string text";
		COM_BufInsertText = "player_t player, string text";
		CV_RegisterVar = "table{string name/string defaultvalue/int flags/PossibleValue pv/function() fn}, [...]";
		CV_FindVar = "string var";
		CONS_Printf = "player_t player, string text";

		// blockmap search
		searchBlockmap = "string searchtype, function fn, mobj_t refmobj, [fixed x1], [fixed x2], [fixed y1], [fixed y2]";

		// iterators
		players.iterate;
		mobjs.iterate;
		skins.iterate;
		sectors.iterate;
		subsectors.iterate;
		lines.iterate;
		sides.iterate;
		vertexes.iterate;

		hud.enable = "string huditem";
		hud.disable = "string huditem";
		hud.enabled = "string huditem";
		hud.add = "function(drawer v/[player_t stplyr]), string type)";

		// technically these are a part of the video code but you can rename that whatever you want...
		draw = "int x, int y, patch patch, [int flags], [colormap c]";
		drawScaled = "fixed x, fixed y, fixed scale, patch patch, [int flags], [colormap c]";
		drawStreched = "fixed x, fixed y, fixed hscale, fixed vscale, patch_t patch, [int flags], [colormap c]";
		drawNum = "int x, int y, int num, [int flags]";
		drawPaddedNum = "int x, int y, int num, [int digits], [int flags]";
		drawFill = "[int x], [int y], [int w], [int h], [int color]";
		drawString = "fixed x, fixed y, string str, [int flags], [string alignment]";
		drawNameTag = "int x, int y, string text, [int flags], [int basecolor], [int outlinecolor]";
		drawScaledNameTag = "int x, int y, string text, [int flags], [int scale], [int basecolor], [int outlinecolor]";
		patchExists = "string name";
		cachePatch = "string name";
		getColormap = "[string/int skin], [int color]";
		fadeScreen = "int color, int strength";
		getSpritePatch = "int sprite, [int frame], [int angle]";
		getSprite2Patch = "string/int skin, string/int sprite2, [boolean super?], [int frame], [int rotation], [angle rollangle]";
		stringWidth = "string string, [int flags], [string widthtype]";
		nameTagWidth = "string text";
		localTransFlag;
		userTransFlag;
		RandomFixed;
		RandomByte;
		RandomKey = "int a";
		RandomRange = "int a";
		SignedRandom;
		RandomChance = "fixed p";

		// basic Lua
		assert = "boolean assert, [string errormsg]";
		collectgarbage = "[string opt], [string arg]";
		error = "string message, [int level]";
		dofile = "string file";
		gcinfo;
		getfenv = "function(*) fn";
		getmetatable = "object obj";
		ipairs = "table{} t";
		next = "table{} t, [int index]";
		pairs = "table{} t";
		pcall = "function(*) fn, [* arg], [...]";
		rawequal = "* v1, * v2";
		rawget = "table{} t, * index";
		rawset = "table{} t, * index, * value";
		select = "* index";
		setfenv = "function(*) fn, table{} table";
		setmetatable = "table{} t, table{} metatable";
		tonumber = "* e, [int base]";
		tostring = "* e";
		type = "* v";
		unpack = "table{} list, [int start], [int end]";
		xpcall = "function(?) call, function(boolean status) errortrap";
		io.open = "string filename, [string mode], function callback";
		io.openlocal = "string filename, [string mode], function callback";
		io.close = "file file";
		io.tmpfile;
		io.type = "* obj";

		coroutine.create = "function(?) fn";
		coroutine.resume = "coroutine co, [* val], [...]";
		coroutine.running;
		coroutine.status = "coroutine co";
		coroutine.wrap = "function(?) fn";
		coroutine.yield = "[...]";

		string.byte = "string s, [int start], [int end]";
		string.char = "[int charid], [...]";
		string.dump = "function(?) fn";
		string.find = "string s, string pattern, [int start], [boolean plain?]";
		string.format = "string formatstr, [...]";
		string.gfind = "string s, string pattern";
		string.gmatch = "string s, string pattern";
		string.gsub = "string s, string pattern, string replace, [int n]";
		string.len = "string s";
		string.lower = "string s";
		string.match = "string s, string pattern, [int n]";
		string.rep = "string s, int n";
		string.reverse = "string s, int start, [int end]";
		string.sub = "string s";
		string.upper = "string s";

		table.concat = "table{}, [string sep], [int start], [int end]";
		table.maxn = "table{}";
		table.insert = "table{}, * element";
		table.remove = "table{}, * key";
		table.sort = "table{}, [function(* element_a/* element_b) comp]";
	}
}
