LevelComplete -> Script thread executed by game on level end. [EF2 Clean/Standard]




This list contains all new coop specific or changed script commands
==============================================================================
==============================================================================

Level Variables ($world.getFloatVar("name"), $world.getStringVar("name"))
==============================================================================
upg_playersReconnectingWait -> default 0, used to notify scripts to wait giving players time to reconnected
upg_playersReconnecting -> default 0, used to notify gamecode that players have to reconnected
coop_disableDeadBodies -> default is 0 set to 1 if you don't want any killed Actors to stay as corpse see also Callvote Option Dead Bodies Stay
isCoopServer -> default 0 is set to 1 if the server is a coop server
isCoopActive -> default 0 is set to 1 if the coop mod is currently active on a coop map
isCoopLevel -> default 0 is set to 1 if the currently loaded level is a coop level
coop_failureReason -> default "" is set to the string why the mission failed when the mission fails
coop_NextMapToLoad -> default "" is set to the string of the next map to load when it is set
total_specialItems -> this is a stock game feature, contains the number of secret ships on the level
found_specialItems -> this is a stock game feature, contains the number of secret ships found
total_secrets -> this is a stock game feature, contains the number of secrets on the level
found_secrets -> this is a stock game feature, contains the number of secrets found
total_enemies_spawned -> this is a stock game feature, contains the number of enemies spawned
holster_active -> this is a stock game feature, set to 1 if player has weapon holstered (Singleplayer)
globalCoop_missionFailedUserString -> default 0, set to 1 if a custom string is set for the coop_failureReason
coop_noBeamout -> default 0, if set to 1 players will not beam out on death


AI added Options
==============================================================================
$actorBorgDone.settendency("norangedattack",1);		//Disables Photon Attack for this drone


These functions are called by the coop mod on certain events.
The player will start the function, retrive the player like shown below
==============================================================================
coop_setuplevel
coop_justEntered
coop_justBecameSpectator
coop_justChangedModel
coop_justChangedClass
coop_justSpawned
coop_justDied
coop_justLeft
coop_justTransported
=======================================================================EXAMLES

void coop_justBecameSpectator()
{
	entity ePlayer;
	ePlayer = getCurrentEntity();
	if(doesEntityExist(ePlayer)){
		ePlayer.hudprint("You are a spectator now...\n");
	}
}

void coop_justDied()
{
	entity ePlayer;
	entity eAttacker;
	ePlayer = getCurrentEntity();
	if(doesEntityExist(ePlayer)){
		eAttacker = ePlayer.getLastAttacker();
		if(eAttacker != ePlayer && eAttacker != $world){
			ePlayer.hudprint("You got killed by "+eAttacker.getTargetname()+"\n");
		}
	}
}
==============================================================================

Console Commands
==============================================================================
coopInput
coopthread
coopitem
coopinstalled
coopcid
Eng
Deu
circle
circledialog
widgettext
dialogrunthread

Chat Commands
==============================================================================
!ability
!thread
!block
!class
!drop
!help
!info
!kickbots
!kill
!login
!logout
!mapname
!origin
!skill
!stuck
!transport
!leader
!reboot
!levelend
!targeted
!targetnames
!showspawn
!hidespawn
!testspawn
!noclip
!notransport
!follow


Added and existing svflags commands for entities ($enemy.svflags("+noclient");)
==============================================================================
+ in front adds a flag / - in front clears a flag. Example: +noclient/-noclient
noclient			//don't send entity to clients, even if it has effects (c++ SVF_NOCLIENT)
broadcast			//send to all connected clients (c++ SVF_BROADCAST)
monsterclip			//treat as CONTENTS_MONSTERCLIP for collision (c++ SVF_MONSTERCLIP)
playerclip			//treat as CONTENTS_PLAYERCLIP for collision (c++ SVF_PLAYERCLIP)
sendonce			//Send this entity over the network at least one time (c++ SVF_SENDONCE)
use_current_origin	// entity->currentOrigin instead of entity->s.origin (c++ SVF_USE_CURRENT_ORIGIN)

coopAutoTeamNpc

Player Variables ($player0.getFloatVar("name"), $player0.getStringVar("name"))
==============================================================================
[gamecode][ALL]		_killThread -> Thread that is executed if player gets killed
[gamecode][MP]		_mpTauntCool -> Used to check if player is allowed to taunt again
[gamecode][SP]		_spArmoryEquiped -> Used to check if player needs to be equiped by script specified weapons on custom maps.
[gamecode][SP]		_spLastTimeThink -> Used to check if player objectives need to be updated on custom maps.
[gamecode]			!<commandname> -> Used to prevent flooding with ! commands.

_playerCanNotHeal -> used on ators to prevent Medics from healing this actor
globalCoop_scannedCoopForcefieldFreq -> default "", contains the frequency the player last scanned from a forcefield
coop_respawnAtRespawnpoint -> default is 0, used to force player respawning at a fixed spawnlocation when set to 1
coop_registredHud1 -> default "" -> used to add special huds upon respawn when their names are set (range 1 to 8)
_playerIsSolvingPuzzle -> default 0, set to 1 if player is doing a puzzle
_playerKilledByEntity -> default 0, set to client number of the killer
_playerKilledByName -> default "", set to killer netname
_playerKilledByClass -> default "", set to killer classname (Player,Actor,...)
_playerKilledByActor -> default "", set to Actor name when killed by actor
_playerKilledByMeans -> default "", set to the means by which this player was killed
_playerKilledByMeansName -> default "", set to the name of the means by which this player was killed
_puzzleLastMessage -> default 0, stores the time when the last message of a puzzle was shown to this player
_playerCurrentViewMode -> default "Normal", stores the current viewmode of this player
coopInputData -> grabs data that was set using coopInput command


Actor Variables ($actor.getFloatVar("name"))
==============================================================================
aiState -> Ai State Used by the coop mod scripts
aiStateWas -> Ai State Used by the coop mod scripts


Puzzle object ($player0.getFloatVar("name"))
==============================================================================
_activator -> default -1, stores the clientnumber of the player last using this puzzle (used for coop)

Script Object onuse ( $pannel.onuse("thread") )
==============================================================================
_activator -> default -1, stores the clientnumber of the player last using this scriptSlave (used for coop)


Automatic Script File
==============================================================================
If a map has no own level-script the coop mod is using coop_mod\matrix\default.script
to provide the current map with all coop script assets.


Killmessage - uservar - using uservars to set a killmessage if object kills player
English and German "killmessage  Message" "killmessage_de  Nachricht"
Needs 2x space after the keyword, see above
==============================================================================
$someScriptObject.setStringVar("uservar1","killmessage  was crushed by a ^2Container");
$someScriptObject.setStringVar("uservar2","killmessage_de  wurde zerquetscht von einem ^2Kontainer");



==============================================================================
If set on a World brush  it will be used to setup
certain Coop Mod data that will be displayed in the Objectives menu
uservar1 = Level Author Name
uservar2 = Level Story (English)
uservar3 = Level Story (German)


uservar5 to uservar10
==============================================================================
Additional uservar variables can be set to entities uservar5 to uservar10
from within the Level Editor (or like always scripts) on any entity.
Default was uservar1 to uservar4 only.
Uservar value can be string, float or vector.


waitfor
==============================================================================
actor.cpp, protection for waitfor loop runaway errors


Archtypes
==============================================================================
New Archetypes for the Tricorder and general Targeting of objects:
Destroy, Scan, Team, Friend, Hostile, Use
Example:
$enemy1.archetype( "Hostile" );


Change a existing Variable In Script
==============================================================================
Allows to change the Value of a existing Variable in the script.
This allows to use with loops generated variable names.
Example:
float i = 3;
setVectorScriptVariable("variableNameHere"+i, '0 0 0');
setFloatScriptVariable("variableNameHere"+i, 1.51);
setStringScriptVariable("variableNameHere"+i, "some text here");


Get value of a existing Script Variable
==============================================================================
Allows to get the Value of a existing Variable in the script.
This allows to use with loops generated variable names.
Example:
float i = 3;
float iValue;
vector vValue;
string sValue;
vValue = getVectorScriptVariable("variableNameHere"+i);
iValue = getFloatScriptVariable("variableNameHere"+i);
sValue = getStringScriptVariable("variableNameHere"+i);


configstringRemoveCombatSounds (configstringRemoveCombatSounds("chell");)
==============================================================================
Removes associated predefined and precached configstrings for named actor.
Like: localization/sound/dialog/combat/chell_holdfire.mp3

configstringRemove (configstringRemove("models/char/dm_romulan_rebel-commander.tik");)
==============================================================================
Removes the given configstrings if found

Gets a part of the source string, from start to end
==============================================================================
Allows to return only a part of  string in script.
This can be used inside loops to iterate each letter of a string.
Example:
string sPart;
sPart = getStringFromStringWithLengt("No Grinch is happy at Christmas",22,9);


Gets the Lowercase version of the given string
==============================================================================
string sLower;
sLower = getStringToLower("THIS IS ALL UPERCASE");


Gets the Upercase version of the given string
==============================================================================
Parameters: 1=string source
Example:
string sUper;
sUper = getStringToUpper("this is all lowercase");

Get the string length
==============================================================================
Parameters: 1=string source
Example:
float iLength;
iLength = getIntStringLength("this is just a random string");

string	$actor.getActorType(); //inanimate,monster,enemy,civilian,friend,animal,teammate
vector	$entity.traceHitsSky ( "tag_horizontal" , 99999 ); //returns origin at wich the trace hits, otherwhise returns '0 0 0'
float	$entity.getEntNum(); //basically returns the * number of the entity getEntityNumber
void	$player.setClassLocked(float YesOrNo);
void	$player.setCamera(entity Camera);
void	$player.callvote(string voteCommand);
void	$player.widgetCmd(string sWidgtName,string sParameters);
void	$player.killthread(string sThread);
void	$player.runthread(string sThread);
void	$entity.boosterNearbyPlayer(string type,float distance, float amount, float maximum); //possible types: health,ammo,armor
void	$entity.makeSolidAsap();
void	$player.circleMenu(float menuType);
void	$player.circleMenuSet(float optionNumber,string text,string threadOrCommandName, string imageORshader,float isScriptThread,float ammount, float cost, string costType);
void	$player.circleMenuClear(float optionalItemNum);
void	$player.circleMenuDialogSet(float optionNumber,string text,string threadName, string imageORshader);
void	$player.circleMenuDialogClear(float optionalDialogNum);
string	$entity.removeViewMode(string viewmodename);
float	$player.isCoopClassTechnician();
float	$player.isCoopClassMedic();
float	$player.isCoopClassHeavyWeapons();
float	$entity.isSpectator();
float	$entity.isEntityInsideOfEntity(entity anyEntity);
string	$player.getCoopClass();
vector	$player.getViewangles();
string	$player.getUserFov();
string	$player.getName();
string	$player.getLanguage();
string	$player.getTeamName();
float	$player.getTeamScore();
float	$player.getScore();
void	$player.addScore(integer Integer);
float	$player.getLastDamaged();
float	$player.getKills();
float	$player.getCoopVersion();
string	$player.getTargetedEntity();
string	$entity.getSubclassName();
entity	$entity.getLastAttacker();
entity	$puzzle_object.getLastActivatingEntity();
bool	$player.hasLanguageEnglish();
bool	$player.hasLanguageGerman();
string	$player.hasItem(string itemName); //also works for actors
bool	$player.checkMenu();
bool	$player.checkAnyButton();
bool	$player.checkUse();
bool	$player.checkFire();
bool	$player.checkFirealt();
bool	$player.checkThirdperson();
bool	$player.checkJump();
bool	$player.checkCrouch();
bool	$player.checkRun();
bool	$player.checkForward();
bool	$player.checkBackward();
bool	$player.checkReload();
bool	$player.checkDropRune();
bool	$player.checkLeft();
bool	$player.checkRight();
bool	$player.checkLeanLeft();
bool	$player.checkLeanRight();
integer	$world.getPhysicsVar("physicsName");
integer $func_door.getDoorState();
vector	$player.getBackpackAttachOffset();
vector	$player.getBackpackAttachAngles();
vector	$player.getFlagAttachOffset();
vector	$player.getFlagAttachAngles();

vector	getPathnodeOrigin(string pathnodename)
bool	challengesDisabled(bool optionalDisableWith1);
bool	challengeDisabledNamed(bool optionalDisableWith1);
void	setIniData(string Category, string Key, string Value);
string	setIniDataPlayer(entity player, string Category, string optionalKey, string value);
string	getIniDataPlayer(entity player, string Category, string optionalKey, string optionalFilename);
string	getIniData(string Category, string Key, string optionalFilename);
string	getStringFromStringWithLengt(string sSomeText,float fStartAt,float fLength);
string	getStringToLower(string sSomeText);
string	getStringToUpper(string sSomeText);
float	getIntStringLength(string sSomeText);
void	configstringRemoveCombatSounds (string sNameOfActor);
void	configstringRemove(string sConfigstring);
float	getIntStringFind(string	source,string search);
void	setVectorScriptVariable(string variableNameHere,vector vVector);
void	setFloatScriptVariable(string variableNameHere,float fFloat);
void	setStringScriptVariable(string variableNameHere,string sText);
float	getFloatFromString(string source);
vector	getVectorFromString(string source);
string	getStringEntitySubclass(entity any);
float	getFloatScriptVariable(string variableName);
vector	getVectorScriptVariable(string variableName);
string	getStringScriptVariable(string variableName);
float	isDigit(string singleLetter);
string	getLevelParamaterValue(string paramaterName);
int		getScreenWidth();
int		getScreenHeight();
bool	getDpiScale();
bool	setDpiException();
bool	hasDpiException();
void	getMapByServerIp();
string	getTime();