![]() |
Superfighters Deluxe
|
Access to certain information and functions about the currently running game world. Example: More...
abstract string | Data [get, set] |
Use the SessionStroage or LocalStorage instead. This property is kept for backwards compatibility. More... | |
abstract IScriptStorage | LocalStorage [get] |
Gets access to local storage. This storage is permanent between server restarts and between different played levels. Data is stored based on the current map/script's file path. Quirk: You're limited to a practical max storage limit to about 10 MB file sizes. Quirk: Changing the filename or placing the script in another folder will change the file path for the stored data. Quirk: You must test on a saved map for this to save data between runs in the map editor. More... | |
abstract IScriptStorage | SessionStorage [get] |
Gets access to session storage. This storage is maintained between games for individual level scripts or extension scripts. This is reset when the server changes to a different map or the server restarts. For permanent storage use LocalStorage instead. More... | |
abstract IScriptStorage | GetSharedStorage (string name) |
Gets access to a shared local storage, based on a name. Name must be valid (see parameter for more info). Calling this function the first time during a map will read the storage if it exist from file. More... | |
abstract bool | IsEditorTest [get] |
Gets if this is run in the editor while testing a map. Useful if you want to enable (or disable) certain features for testing only. More... | |
abstract float | TotalElapsedGameTime [get] |
Gets the total elapsed game-time, affected by slowmotion, in milliseconds since the game started. More... | |
abstract float | TotalElapsedRealTime [get] |
Gets the total elapsed real-time in milliseconds since the game start. More... | |
abstract float | SlowmotionModifier [get] |
Gets the slowmotion/time modifier in the game affected by slowmotion items and /settime command. More... | |
abstract bool | IsFirstUpdate [get] |
Gets if the code is executing during the first update. More... | |
abstract Guid | MapOriginalGUID [get] |
Gets the original GUID of the map, when the map was first created. More... | |
abstract Guid | MapGUID [get] |
Gets the last saved GUID of the map, when the map was last updated. More... | |
abstract string | MapName [get] |
Gets the name of the map. More... | |
abstract string | MapAuthor [get] |
Gets the author of the map. More... | |
abstract bool | TryGetText (string textId, out string value, params string[] args) |
Gets a text by id from the language file. More... | |
abstract bool | TryGetText (string textId, out string value) |
Gets a text by id from the language file. More... | |
abstract string | ReplaceTextTags (string text) |
Replaces text tags - intended for offline maps and campaigns. Use [TEXT=language.textId] to insert text from language texts by text id (case sensitive and uses the server's language setting). Use [KEY=KEY_CODE] to insert player one's keybindings. See config.ini file for the KEY_CODE names for the keybindings. More... | |
abstract int | MapTotalPlayers [get] |
Gets the number of total players defined by the map. Only available for campaigns and survival type maps. Returns 0 if not set. More... | |
abstract float | CurrentDifficulty [get] |
Gets the current difficulty based on map mode, players and progress in range [0.0-1.0]. Survival maps returns current players / total players. Campaigns maps returns 0.25 for easy, 0.5 for normal, 0.75 for hard and 1.0 for expert. Other maps return 1.0. More... | |
abstract DifficultyLevel | SelectedDifficultyLevel [get] |
Gets the selected difficulty level in the current map. Only applicable for campaign maps where this will return the selected difficulty choosen by the host. Any other map will return DifficultyLevel.None and CurrentDifficulty 1.0. More... | |
abstract int | MapRound [get] |
Gets the current map round while playing the same map - resets on map change. Starts on 1 and increment for each round while playing the same map. More... | |
abstract int | CampaignCurrentMapPartIndex [get] |
Gets the current map part index for a campaign. Returns -1 for non-campaign maps. More... | |
abstract int | CampaignTotalMapParts [get] |
Gets the total map parts for a campaign. Returns 0 for non-campaign maps. More... | |
abstract int | SurvivalWave [get] |
Gets the current survival wave while playing the same map - resets on map change/restart. Starts on 1 and increment for each survival wave finished. More... | |
abstract int | SurvivalExtraLives [get, set] |
Gets or Sets current survival extra lives for survival type maps - resets on map change/restart. More... | |
abstract bool | SurvivalWaveCompleted [get] |
Gets if current survival wave is completed. Only updated after IsGameOver is true. This property returns false if all survivors are dead. More... | |
abstract bool | StatsToKeepEnabled [get, set] |
Gets or Sets if stats should be kept when progressing on the same playthrough. This only applies to survival (clearing a wave or retrying a wave) and campaign (progressing to a new map part or dying). More... | |
abstract void | SetStatsToKeep (StatsToKeep statsToKeep) |
Sets what kind of stats should be kept when progressing on the same playthrough. This only applies to survival (clearing a wave or retrying a wave) and campaign (progressing to a new map part or dying). More... | |
abstract StatsToKeep | GetStatsToKeep () |
Gets what kind of stats should be kept when progressing on the same playthrough. This only applies to survival (clearing a wave or retrying a wave) and campaign (progressing to a new map part or dying). More... | |
abstract bool | StartupSequenceEnabled [get, set] |
Gets or Sets if the startup sequence of the map is enabled. The startup sequence will show GET READY and FIGHT text + play sound. More... | |
abstract bool | DeathSequenceEnabled [get, set] |
Gets or Sets if the death sequence of the map is enabled. The death sequence will show a text "YOU ARE DEAD" + play sound. More... | |
abstract bool | SuddenDeathEnabled [get] |
Gets if sudden death is enabled. More... | |
abstract bool | SuddenDeathActive [get] |
Gets if sudden death is currently active. More... | |
abstract void | ForceStartSuddenDeath (int suddenDeathTimeSeconds=45) |
Starts sudden death if not yet active. Sudden death means that no more crates will spawn and the time is reduced to the specified limit. Once the timer runs out and if there's no winner, everyone dies forcing a draw. More... | |
abstract bool | TimeLimitActive [get] |
Gets if time limit is active and ticking. Remaining time can be retrieved via GetTimeLimitRemaining(). More... | |
abstract int | TimeLimit [get] |
Gets the total time limit in the game in seconds. Returns 0 if TimeLimitActive is false. Use GetRemainingTimeLimit() to get the remaining time. More... | |
abstract TimeSpan | GetRemainingTimeLimit () |
Returns time limit remaining. Returns TimeSpan.Zero if TimeLimitActive is false. More... | |
abstract WeatherType | GetWeatherType () |
Gets the current weather type. More... | |
abstract void | SetWeatherType (WeatherType value) |
Sets the current weather type. More... | |
abstract bool | AutoVictoryConditionEnabled [get, set] |
Gets or Sets if auto victory condition is enabled. Auto victory condition applies to Versus and Challange map types. Custom, Survival and Campaign map types must be controlled when it's GameOver via triggers or scripts. More... | |
abstract MapType | GetMapType () |
Gets the current map type. More... | |
abstract void | SetMapType (MapType gameType) |
OBSOLETE. DO NOT USE. This function is kept for backwards compatibility with olders scripts using this function. This does NOT change the MapType of the map. QUIRK: Setting MapType.Custom will be the same as setting AutoVictoryConditionEnabled = false; Setting MapType.Versus will be the same as setting AutoVictoryConditionEnabled = true; Using other MapTypes will be totally ignored by this function! More... | |
abstract bool | IsGameOver [get] |
Checks if the game is over More... | |
abstract bool | ChallengeCompleted [get, set] |
Gets or Sets if the challenge is completed successfully when calling SetGameOver(). This only works for Challenge type maps. More... | |
abstract void | SetGameOver (string gameOverText) |
Sets the game as game over and shows a custom text. For Campaigns this will start the campaign all over. For Survival maps this will indicate that the current survival wave is over, if all players are dead the current wave will restart, if someone's alive it will progress. For Challenges this will end the challenge, the Game.ChallengeCompleted property determines if the challenge is completed successfully or not. More... | |
abstract void | SetGameOver () |
Sets the game as game over based on current map type. For Campaigns this will start the campaign all over. For Survival maps this will indicate that the current survival wave is over, if all players are dead the current wave will restart, if someone's alive it will progress. For Challenges this will end the challenge, the Game.ChallengeCompleted property determines if the challenge is completed successfully or not. /// More... | |
abstract void | SetChallengeTimeLimit (int seconds) |
Sets a timeout in seconds for a challenge type map. Only works for challenge maps. The host controls the time limit in other map types (such as versus). QUIRK: To update the time limit you must first disable this (by setting 0) and in the next main update cycle set this to the new value you want to apply. More... | |
abstract void | SetCampaignMapPart (int mapPartIndex) |
Sets the next campaign map part to the specified index. This also loads the next part instant. Assigning the same index as the current active map part index will restart the current map part, restoring the players' stats. Only works for campaign maps. More... | |
abstract IUser[] | GetActiveUsers () |
Gets all current connected users. This returns connected users and bots set up in the lobby. More... | |
abstract IUser | GetActiveUser (int userIdentifier) |
Gets current connected user by UserIdentifier. More... | |
abstract IPlayer[] | GetPlayers () |
Gets all players currently spawned. More... | |
abstract IPlayer | GetPlayer (int uniqueID) |
Gets the player with the given UniqueID. More... | |
abstract IObject[] | GetObjectsByCustomID (string customID) |
Gets all Objects with the provided custom ID. More... | |
abstract T[] | GetObjectsByCustomID< T > (string customID) |
Gets all Objects with the provided custom ID matching the specific generic type. More... | |
abstract IObject[] | GetObjectsByCustomID (string[] customIDs) |
Gets all Objects with the provided custom IDs. More... | |
abstract T[] | GetObjectsByCustomID< T > (string[] customIDs) |
Gets all Objects with the provided custom IDs matching the specific generic type. More... | |
abstract IObject | GetSingleObjectByCustomID (string customID) |
Returns the first found object with the provided custom ID. More... | |
abstract T | GetSingleObjectByCustomID< T > (string customID) |
Returns the first found object with the provided custom ID matching the specific generic type. More... | |
abstract T[] | GetObjects< T > () |
Gets all Objects matching the given type. More... | |
abstract IObject[] | GetObjectsByName (string name) |
Gets all Objects matching the given tile name. More... | |
abstract IObject[] | GetObjectsByName (string[] names) |
Gets all Objects matching the given tile names. More... | |
abstract IObject[] | GetObjectsByArea (Area area, PhysicsLayer physicsLayer=PhysicsLayer.Active) |
Gets all objects that overlap with their AABB with the given area. More... | |
abstract T[] | GetObjectsByArea< T > (Area area, PhysicsLayer physicsLayer=PhysicsLayer.Active) |
Gets all objects that overlap with their AABB with the given area matching the specific generic type. More... | |
abstract IObject | GetSingleObjectByArea (Area area, PhysicsLayer physicsLayer=PhysicsLayer.Active) |
Gets the first object that overlap with its AABB with the given area. More... | |
abstract T | GetSingleObjectByArea< T > (Area area, PhysicsLayer physicsLayer=PhysicsLayer.Active) |
Gets the first object that overlap with its AABB with the given area matching the specific generic type. More... | |
abstract IObject[] | GetObjects (string customID) |
Gets all Objects with the provided custom ID. More... | |
abstract T[] | GetObjects< T > (string customID) |
Gets all Objects with the provided custom ID matching the specific generic type. More... | |
abstract IObject[] | GetObjects (Area area) |
Gets all objects that overlap with their AABB with the given area. Does not work with far background objects. More... | |
abstract T[] | GetObjects< T > (Area area) |
Gets all objects that overlap with their AABB with the given area matching the specific generic type. More... | |
abstract IObject | GetFirstObject (string customID) |
Gets the first best Object with the provided custom ID. More... | |
abstract T | GetFirstObject< T > (string customID) |
Gets the first best Object with the provided custom ID matching the specific generic type. More... | |
abstract IObject | GetFirstObject (Area area) |
Gets first best object that overlap with their AABB with the given area. Does not work with far background objects. More... | |
abstract T | GetFirstObject< T > (Area area) |
Gets first best object that overlap with their AABB with the given area matching the specific generic type. Does not work with far background objects. More... | |
abstract IObject | GetObject (int uniqueID) |
Gets the IObject by uniqueID. More... | |
abstract IObject | GetObject (string customID) |
Gets the first best Object with the provided custom ID. More... | |
abstract T | GetObject< T > (string customID) |
Gets the first best Object with the provided custom ID. More... | |
abstract IObject[] | GetBurningObjects () |
Gets all current objects on fire (where IObject.IsBurning is true). Note: The returned result is NOT ordered as burning objects get updated. More... | |
abstract T[] | GetBurningObjects< T > () |
Gets all current objects on fire (where IObject.IsBurning is true). Note: The returned result is NOT ordered as burning objects get updated. More... | |
abstract FireNode[] | GetFireNodes () |
Gets all current active fire nodes in the world. More... | |
abstract FireNode[] | GetFireNodes (Area area) |
Gets all current active fire nodes in the world in the specified area. More... | |
abstract void | EndFireNode (int instanceID) |
Ends the life of the specified fire node in the next fire update cycle. More... | |
abstract IObject[] | GetTargetAIEnabledObjects () |
Gets all objects currently enabled for bots to target. More... | |
abstract IObject[] | GetMissileObjects () |
Gets all objects currently tracked as missiles. Missile objects can collide with players and deal damage based on velocity even if collision is disabled. Normally used for smaller objects being thrown. Once the object collides with the world it will lose it's missile status. More... | |
abstract IProjectile[] | GetProjectiles () |
Gets all current projectiles. More... | |
abstract IProjectile | GetProjectile (int projectileInstanceID) |
Gets the projectile with the specified projectile instanceID. More... | |
abstract IObject | CreateObject (string objectID) |
Creates a new object in the world. More... | |
abstract IObject | CreateObject (string objectID, Vector2 worldPosition) |
Creates a new object in the world. More... | |
abstract IObject | CreateObject (string objectID, Vector2 worldPosition, float angle) |
Creates a new object in the world. More... | |
abstract IObject | CreateObject (string objectID, Vector2 worldPosition, float angle, Vector2 linearVelocity, float angularVelocity) |
Creates a new object in the world. More... | |
abstract IObject | CreateObject (string objectID, Vector2 worldPosition, float angle, Vector2 linearVelocity, float angularVelocity, int faceDirection) |
Creates a new object in the world. More... | |
abstract bool | AutoSpawnSupplyCratesEnabled [get, set] |
Gets or Sets auto spawn item crates. More... | |
abstract IObjectSupplyCrate | SpawnSupplyCrate (bool forceSpawn=false) |
Tries to create a new SupplyCrate in the world at a random position if it can be found. Returns null if failed.To spawn a SupplyCrate at a specific location, use Game.CreateObject("SupplyCrate00", new Vector2(x, y)); instead. More... | |
abstract IObject | SpawnItemCrate (bool forceSpawn=false) |
Tries to create a new Item in the world at a random position if it can be found. Returns null if failed. This can return a SupplyCrate or StreetsweeperCrate - depending on spawn chances. To spawn a SupplyCrate at a specific location, use Game.CreateObject("SupplyCrate00", new Vector2(x, y)); instead. To spawn a StreetsweeperCrate at a specific location, use Game.CreateObject("StreetsweeperCrate", new Vector2(x, y)); instead. More... | |
abstract Dictionary< short, int > | GetWeaponSpawnChances () |
Gets all current weapon spawn chances as a dictionary. Key is the enum WeaponItem converted as short (short)WeaponItem for defined weapons. Value is the total weight (0 = none, 1-100 = spawn weight/chance). More... | |
abstract void | UpdateWeaponSpawnChances (Dictionary< short, int > values) |
Update current weapon spawn chances for defined weaponitems. Example: More... | |
abstract void | ClearWeaponSpawnChances () |
Sets spawn chance to 0 for all WeaponItems. More... | |
abstract WeaponItem | GetRandomWeaponItem () |
Returns a random weapon item based on current weapon spawn chances. More... | |
abstract IObjectWeaponItem | SpawnWeaponItem (WeaponItem weaponItem, Vector2 worldPosition) |
Spawns a weapon item in the world with default values and despawn time. More... | |
abstract IObjectWeaponItem | SpawnWeaponItem (WeaponItem weaponItem, Vector2 worldPosition, bool enablePhysics) |
Spawns a weapon item in the world with default values and despawn time. More... | |
abstract IObjectWeaponItem | SpawnWeaponItem (WeaponItem weaponItem, Vector2 worldPosition, bool enablePhysics, float despawnTime) |
Spawns a weapon item in the world with default values and despawn time. More... | |
abstract IProjectile | SpawnProjectile (ProjectileItem projectileID, Vector2 worldPosition, Vector2 direction) |
Spawns a projectile in the world. Returns null if ProjectileItem.NONE is used or other non-defined enum values. More... | |
abstract IProjectile | SpawnProjectile (ProjectileItem projectileID, Vector2 worldPosition, Vector2 direction, ProjectilePowerup powerup) |
Spawns a projectile in the world. Returns null if ProjectileItem.NONE is used or other non-defined enum values. More... | |
abstract IPlayer | CreatePlayer (Vector2 worldPosition) |
Creates a blank player. More... | |
abstract CameraMode | GetAllowedCameraModes () |
Gets allowed camera modes. More... | |
abstract void | SetAllowedCameraModes (CameraMode cameraModes) |
Sets allowed camera modes that can be toggled between. More... | |
abstract void | SetCurrentCameraMode (CameraMode cameraMode) |
Sets the current camera mode to be used. This overrides allowed camera modes. More... | |
abstract Area | GetCameraArea () |
Gets the current camera area. This is the minimum allowed camera area after aspect correction and max zoom limits. More... | |
abstract Area | GetCameraMaxArea () |
Gets the current camera max area. This is the maximum possible camera area depending on users resolution. More... | |
abstract void | SetCameraArea (Area area) |
Sets the world's camera area. Only applicable if there's no active CameraAreaTrigger. Too small areas will expand to be within aspect ratio and max zoom levels. More... | |
abstract void | SetCameraArea (int top, int left, int bottom, int right) |
Sets the world's camera area. Only applicable if there's no active CameraAreaTrigger. Too small areas will expand to be within aspect ratio and max zoom levels. More... | |
abstract int | GetWorldBottom () |
Gets the world bottom height. More... | |
abstract void | SetWorldBottom (int height) |
Sets the world bottom height. More... | |
abstract bool | AutoScoreConditionEnabled [get, set] |
Gets or Sets if auto score condition is enabled. Auto score condition increases a player's score if they survive a wave in survival, progress a campaign map or is alive at the end of a round for versus/custom map types. If set to false score must be increased manually per user by using the IUser.IncreaseScore() function before the game victory text is shown (it's displayed shortly after Game.IsGameOver is true). More... | |
abstract int | TotalScore [get, set] |
Gets or Sets the total score in the current map (applies to Survival type maps). More... | |
abstract void | ResetScore () |
Resets all score for current game users and total score. More... | |
abstract void | TriggerExplosion (Vector2 worldPosition) |
Triggers an explosion at the given world coordinate. More... | |
abstract void | TriggerFireplosion (Vector2 worldPosition, float worldRadius=10f) |
Triggers a fire "explosion" at the given world coordinate causing everything inside to be ignited. More... | |
abstract FireNode | SpawnFireNode (Vector2 worldPosition, Vector2 velocity, FireNodeType fireNodeType=FireNodeType.Default) |
Spawns a fire node in the world. More... | |
abstract FireNode[] | SpawnFireNodes (Vector2 worldPosition, int totalNodeCount, Vector2 baseVelocity, float expandVelocity, float randomVelocity, FireNodeType fireNodeType=FireNodeType.Default) |
Spawns several fire nodes in the world in a circle. More... | |
abstract FireNode[] | SpawnFireNodes (Vector2 worldPosition, int totalNodeCount, float expandVelocity, FireNodeType fireNodeType=FireNodeType.Default) |
Spawns several fire nodes in the world in a circle. More... | |
abstract BaseObject[] | GetFocusedCameraObjects () |
Returns current objects the camera should keep focus on. Union for all PrimaryTarget, SecondaryTargets and InfoTargets from current active CameraAreaTrigger. (The final camera view depend on the end user, where he/she is and active camera mode (static/dynamic)) More... | |
abstract IDialogue | CreateDialogue (string text, Vector2 worldPosition, string name="", float duration=-1, bool showInChat=true) |
Creates a new dialogue item and returns newly created dialogue. More... | |
abstract IDialogue | CreateDialogue (string text, IObject targetObject, string name="", float duration=-1, bool showInChat=true) |
Creates a new dialogue item and returns newly created dialogue. More... | |
abstract IDialogue | CreateDialogue (string text, Color textColor, Vector2 worldPosition, string name="", float duration=-1, bool showInChat=true) |
Creates a new dialogue item and returns newly created dialogue. More... | |
abstract IDialogue | CreateDialogue (string text, Color textColor, IObject targetObject, string name="", float duration=-1, bool showInChat=true) |
Creates a new dialogue item and returns newly created dialogue. More... | |
abstract IDialogue[] | GetDialogues () |
Returns all active dialogues. More... | |
abstract RayCastResult[] | RayCast (Vector2 start, Vector2 end, RayCastInput input) |
Performs a ray cast in the world. Use with care as it can get CPU intense depending on your raycast distance and how many you perform each update! Does not work with far background objects. More... | |
abstract void | PlayEffect (string effectID, Vector2 worldPosition) |
Plays an effect at a specific world postion. See EffectName for available effects and possible arguments for each effect. More... | |
abstract void | PlayEffect (string effectID, Vector2 worldPosition, params object[] args) |
Plays an effect at a specific world postion. See EffectName for available effects and possible arguments for each effect. More... | |
abstract void | PlaySound (string soundID, Vector2 worldPosition) |
Plays a sound at a specific world position. More... | |
abstract void | PlaySound (string soundID, Vector2 worldPosition, float volume) |
Plays a sound at a specific world position. More... | |
abstract void | ShowPopupMessage (string message) |
Shows popup message. More... | |
abstract void | ShowPopupMessage (string message, Color color) |
Shows popup message. More... | |
abstract void | HidePopupMessage () |
Hides popup message. More... | |
abstract void | ShowChatMessage (string message) |
Shows a chat message to all users. More... | |
abstract void | ShowChatMessage (string message, Color color) |
Shows a chat message to all users. More... | |
abstract void | ShowChatMessage (string message, int userIdentifier) |
Shows a chat message to a specific user. More... | |
abstract void | ShowChatMessage (string message, Color color, int userIdentifier) |
Shows a chat message to a specific user. More... | |
abstract ColorPackage | GetColorPackage (string colorPackageName) |
Gets ColorPackage by name. More... | |
abstract ColorPalette | GetColorPalette (string colorPaletteName) |
Gets ColorPalette by name containing all available ColorPackages. More... | |
abstract string | GetClothingItemColorPaletteName (string clothingItemName) |
Returns the name of the color palette for a clothing item. More... | |
abstract string[] | GetClothingItemNamesSkin (Gender gender) |
Gets available items for the skin slot. More... | |
abstract string[] | GetClothingItemNamesChestUnder (Gender gender) |
Gets available items for the chest under slot. More... | |
abstract string[] | GetClothingItemNamesLegs (Gender gender) |
Gets available items for the legs slot. More... | |
abstract string[] | GetClothingItemNamesWaist (Gender gender) |
Gets available items for the waist slot. More... | |
abstract string[] | GetClothingItemNamesFeet (Gender gender) |
Gets available items for the feet slot. More... | |
abstract string[] | GetClothingItemNamesChestOver (Gender gender) |
Gets available items for the chest over slot. More... | |
abstract string[] | GetClothingItemNamesAccessory (Gender gender) |
Gets available items for the accessory slot. More... | |
abstract string[] | GetClothingItemNamesHands (Gender gender) |
Gets available items for the hands slot. More... | |
abstract string[] | GetClothingItemNamesHead (Gender gender) |
Gets available items for the head slot. More... | |
abstract void | RunCommand (string command) |
Runs a command. Only certain commands are available for maps. Extension scripts can run all existing commands. More... | |
abstract void | WriteToConsole (params object[] messages) |
Writes a message out to the console and map debug options menu while testing a map in the map editor. More... | |
abstract void | WriteToConsoleF (string format, params object[] args) |
Writes a message out to the console and map debug options menu while testing a map in the map editor. If the custom format fails, a default one will be used instead. More... | |
abstract IGameHelpers | Helpers [get] |
Access to certain helper functions More... | |
abstract void | DrawLine (Vector2 p1, Vector2 p2, Color c) |
Draws a debugging line to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 512 lines available in total to be drawn. More... | |
abstract void | DrawLine (Vector2 p1, Vector2 p2) |
Draws a debugging line to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 512 lines available in total to be drawn. More... | |
abstract void | DrawCircle (Vector2 center, float radius, Color c) |
Draws a debugging circle to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 512 circles available in total to be drawn. More... | |
abstract void | DrawCircle (Vector2 center, float radius) |
Draws a debugging circle to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 512 circles available in total to be drawn. More... | |
abstract void | DrawArea (Area area, Color c) |
Draws a debugging area to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 256 areas available in total to be drawn. More... | |
abstract void | DrawArea (Area area) |
Draws a debugging area to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 256 areas available in total to be drawn. More... | |
abstract void | DrawText (string text, Vector2 position, Color c) |
Draws a debugging text to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 128 texts available in total to be drawn. More... | |
abstract void | DrawText (string text, Vector2 position) |
Draws a debugging text to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 128 texts available in total to be drawn. More... | |
Access to certain information and functions about the currently running game world. Example:
*/ /* public void OnStartup() { // The game will always call the following method "public void OnStartup()" during a map start (or script activates). No triggers required. This is run before triggers that activate on startup (and before OnStartup triggers). Game.ShowPopupMessage("Hello World"); // To enable an update loop you can type the following Events.UpdateCallback.Start(OnUpdate, 0); } public void AfterStartup() { // The game will always call the following method "public void AfterStartup()" after a map start (or script activates). No triggers required. This is run after triggers that activate on startup (and after OnStartup triggers). } public void OnShutdown() { // The game will always call the following method "public void OnShutdown()" before a map restart (or script deactivates). Perform some cleanup here or store some final information to Game.LocalStorage if needed. } public void OnUpdate(float ms) { // Update logic here to run each update. } */ /**
|
pure virtual |
Sets spawn chance to 0 for all WeaponItems.
|
pure virtual |
Creates a new dialogue item and returns newly created dialogue.
text | Text to display. Max 200 characters. |
textColor | Text color |
targetObject | Target object to display dialogue at If null Vector2.Zero will be used. |
name | Name to be displayed in the chat. |
duration | Display duration. 0=infinite duration (until closed). -1=based on text length. |
showInChat | If the dialogue is to be shown in the chat. |
|
pure virtual |
Creates a new dialogue item and returns newly created dialogue.
text | Text to display. Max 200 characters. |
textColor | Text color |
worldPosition | World position to display dialogue at. |
name | Name to be displayed in the chat. |
duration | Display duration. 0=infinite duration (until closed). -1=based on text length. |
showInChat | If the dialogue is to be shown in the chat. |
|
pure virtual |
Creates a new dialogue item and returns newly created dialogue.
text | Text to display. Max 200 characters. |
targetObject | Target object to display dialogue at If null Vector2.Zero will be used. |
name | Name to be displayed in the chat. |
duration | Display duration. 0=infinite duration (until closed). -1=based on text length. |
showInChat | If the dialogue is to be shown in the chat. |
|
pure virtual |
Creates a new dialogue item and returns newly created dialogue.
text | Text to display. Max 200 characters. |
worldPosition | World position to display dialogue at. |
name | Name to be displayed in the chat. |
duration | Display duration. 0=infinite duration (until closed). -1=based on text length. |
showInChat | If the dialogue is to be shown in the chat. |
|
pure virtual |
Creates a new object in the world.
objectID | Object ID to be created (name as seen in the tile-list in the editor) |
If the object ID doesn't exist a default object will still be created (often in the shape of a magenta square). Future content changes might rename or remove certain object IDs.
Creates a new object in the world.
objectID | Object ID to be created (name as seen in the tile-list in the editor) |
worldPosition | World position |
If the object ID doesn't exist a default object will still be created (often in the shape of a magenta square). Future content changes might rename or remove certain object IDs.
Creates a new object in the world.
objectID | Object ID to be created (name as seen in the tile-list in the editor) |
worldPosition | World position |
angle | Angle in radians |
If the object ID doesn't exist a default object will still be created (often in the shape of a magenta square). Future content changes might rename or remove certain object IDs.
|
pure virtual |
Creates a new object in the world.
objectID | Object ID to be created (name as seen in the tile-list in the editor) |
worldPosition | World position |
angle | Angle in radians |
linearVelocity | Initial linear velocity. Only applies to dynamic objects. |
angularVelocity | Initial angular velocity. Only applies to dynamic objects. |
If the object ID doesn't exist a default object will still be created (often in the shape of a magenta square). Future content changes might rename or remove certain object IDs.
|
pure virtual |
Creates a new object in the world.
objectID | Object ID to be created (name as seen in the tile-list in the editor) |
worldPosition | World position |
angle | Angle in radians |
linearVelocity | Initial linear velocity. Only applies to dynamic objects. |
angularVelocity | Initial angular velocity. Only applies to dynamic objects. |
faceDirection | Initial face direction. Valid values are -1 (left) or 1 (right). |
If the object ID doesn't exist a default object will still be created (often in the shape of a magenta square). Future content changes might rename or remove certain object IDs.
Creates a blank player.
worldPosition | World position |
|
pure virtual |
Draws a debugging area to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 256 areas available in total to be drawn.
area | Area |
Draws a debugging area to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 256 areas available in total to be drawn.
|
pure virtual |
Draws a debugging circle to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 512 circles available in total to be drawn.
center | World position for the circle's center |
radius | Radius |
Draws a debugging circle to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 512 circles available in total to be drawn.
center | World position for the circle's center |
radius | Radius |
c | Color |
Draws a debugging line to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 512 lines available in total to be drawn.
p1 | World position A |
p2 | World position B |
Draws a debugging line to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 512 lines available in total to be drawn.
p1 | World position A |
p2 | World position B |
c | Color |
|
pure virtual |
Draws a debugging text to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 128 texts available in total to be drawn.
text | Text to be drawn. The shorter the better. |
position | World position |
Draws a debugging text to be shown next drawn frame. Note: You must enable "Show Script Debug Information" in the map debug options before this is shown. Note: All debug information will be accumulated until the next drawn frame is rendered, several updates can run between drawn frames. Note: Max 128 texts available in total to be drawn.
text | Text to be drawn. The shorter the better. |
position | World position |
c | Color |
|
pure virtual |
Ends the life of the specified fire node in the next fire update cycle.
instanceID | Fire node's instanceID |
|
pure virtual |
Starts sudden death if not yet active. Sudden death means that no more crates will spawn and the time is reduced to the specified limit. Once the timer runs out and if there's no winner, everyone dies forcing a draw.
suddenDeathTimeSeconds | Time in seconds the sudden death will be. Does not override the current timer, only lowers it. Min allowed is 5 seconds, max allowed is 3600 seconds (1 hour). |
|
pure virtual |
Gets current connected user by UserIdentifier.
userIdentifier | UserIdentifier of the user. |
|
pure virtual |
Gets all current connected users. This returns connected users and bots set up in the lobby.
|
pure virtual |
Gets allowed camera modes.
|
pure virtual |
Gets all current objects on fire (where IObject.IsBurning is true). Note: The returned result is NOT ordered as burning objects get updated.
|
pure virtual |
Gets all current objects on fire (where IObject.IsBurning is true). Note: The returned result is NOT ordered as burning objects get updated.
T | : | IObject |
|
pure virtual |
Gets the current camera area. This is the minimum allowed camera area after aspect correction and max zoom limits.
|
pure virtual |
Gets the current camera max area. This is the maximum possible camera area depending on users resolution.
|
pure virtual |
Returns the name of the color palette for a clothing item.
itemName | Name of the clothing item. |
|
pure virtual |
Gets available items for the accessory slot.
gender | Gender |
|
pure virtual |
Gets available items for the chest over slot.
gender | Gender |
|
pure virtual |
Gets available items for the chest under slot.
gender | Gender |
|
pure virtual |
Gets available items for the feet slot.
gender | Gender |
|
pure virtual |
Gets available items for the hands slot.
gender | Gender |
|
pure virtual |
Gets available items for the head slot.
gender | Gender |
|
pure virtual |
Gets available items for the legs slot.
gender | Gender |
|
pure virtual |
Gets available items for the skin slot.
gender | Gender |
|
pure virtual |
Gets available items for the waist slot.
gender | Gender |
|
pure virtual |
Gets ColorPackage by name.
colorPackageName | Name of the ColorPackage. |
|
pure virtual |
Gets ColorPalette by name containing all available ColorPackages.
colorPaletteName | Name of the ColorPalette. |
|
pure virtual |
Returns all active dialogues.
|
pure virtual |
Gets all current active fire nodes in the world.
Gets all current active fire nodes in the world in the specified area.
area | If the area is empty, all fire nodes in the world will be included. |
Gets first best object that overlap with their AABB with the given area. Does not work with far background objects.
area |
|
pure virtual |
Gets the first best Object with the provided custom ID.
customID | custom ID |
|
pure virtual |
Gets first best object that overlap with their AABB with the given area matching the specific generic type. Does not work with far background objects.
area |
T | : | IObject |
|
pure virtual |
Gets the first best Object with the provided custom ID matching the specific generic type.
customID | custom ID |
T | : | IObject |
|
pure virtual |
Returns current objects the camera should keep focus on. Union for all PrimaryTarget, SecondaryTargets and InfoTargets from current active CameraAreaTrigger. (The final camera view depend on the end user, where he/she is and active camera mode (static/dynamic))
|
pure virtual |
Gets the current map type.
|
pure virtual |
Gets all objects currently tracked as missiles. Missile objects can collide with players and deal damage based on velocity even if collision is disabled. Normally used for smaller objects being thrown. Once the object collides with the world it will lose it's missile status.
|
pure virtual |
|
pure virtual |
Gets the first best Object with the provided custom ID.
customID | custom ID |
|
pure virtual |
Gets the first best Object with the provided custom ID.
customID | custom ID |
T | : | IObject |
Gets all objects that overlap with their AABB with the given area. Does not work with far background objects.
area | Area |
|
pure virtual |
Gets all Objects with the provided custom ID.
customID | custom ID |
|
pure virtual |
Gets all Objects matching the given type.
T | : | IObject |
|
pure virtual |
Gets all objects that overlap with their AABB with the given area matching the specific generic type.
area | Area |
T | : | IObject |
|
pure virtual |
Gets all Objects with the provided custom ID matching the specific generic type.
customID | custom ID |
T | : | IObject |
|
pure virtual |
Gets all objects that overlap with their AABB with the given area.
area | Area |
|
pure virtual |
Gets all objects that overlap with their AABB with the given area matching the specific generic type.
area | Area |
T | : | IObject |
|
pure virtual |
Gets all Objects with the provided custom ID.
customID | custom ID |
|
pure virtual |
Gets all Objects with the provided custom IDs.
customIDs | array of custom IDs |
|
pure virtual |
Gets all Objects with the provided custom ID matching the specific generic type.
customID | custom ID |
T | : | IObject |
|
pure virtual |
Gets all Objects with the provided custom IDs matching the specific generic type.
customIDs | array of custom IDs |
T | : | IObject |
|
pure virtual |
Gets all Objects matching the given tile name.
name | object name |
|
pure virtual |
Gets all Objects matching the given tile names.
names | array of names |
|
pure virtual |
Gets the player with the given UniqueID.
uniqueID | UniqueID of the player. |
|
pure virtual |
Gets all players currently spawned.
|
pure virtual |
Gets the projectile with the specified projectile instanceID.
projectileInstanceID | Projectile instance ID |
|
pure virtual |
Gets all current projectiles.
|
pure virtual |
Returns a random weapon item based on current weapon spawn chances.
|
pure virtual |
Returns time limit remaining. Returns TimeSpan.Zero if TimeLimitActive is false.
|
pure virtual |
Gets access to a shared local storage, based on a name. Name must be valid (see parameter for more info). Calling this function the first time during a map will read the storage if it exist from file.
Note: This is a shared storage and any other script or map can also access it using the same name. Other scripts can update this data live. Storing a key-value in one frame will not guarantee it exist in the next frame, depending on what other scripts do. You are safe to write and read key-values in the same frame though.
Quirk: Getting the shared storage the first time can potentially cause the game to freeze randomly for a short period in case the end-user's disk activity is busy or currently sleeping. To avoid potential freezing problems make sure to access any shared storage you may want to access in the OnStartup() function in your script as your script and map has already been read from file a few moments ago and therefor the disk activity is ready to read again. To access it just run Game.GetSharedStorage("Abc") for example.
name | The name must only contain letters (and no whitespace characters) and be a valid filename and must not exceed 40 characters and be at least 3 characters long. This is case insensitive, so 'ABC', 'Abc' and 'abc' will all point to the same shared storage. |
|
pure virtual |
Gets the first object that overlap with its AABB with the given area.
area | Area |
|
pure virtual |
Gets the first object that overlap with its AABB with the given area matching the specific generic type.
area | Area |
T | : | IObject |
|
pure virtual |
Returns the first found object with the provided custom ID.
customID | custom ID |
|
pure virtual |
Returns the first found object with the provided custom ID matching the specific generic type.
customID | custom ID |
T | : | IObject |
|
pure virtual |
Gets what kind of stats should be kept when progressing on the same playthrough. This only applies to survival (clearing a wave or retrying a wave) and campaign (progressing to a new map part or dying).
|
pure virtual |
Gets all objects currently enabled for bots to target.
|
pure virtual |
Gets all current weapon spawn chances as a dictionary. Key is the enum WeaponItem converted as short (short)WeaponItem for defined weapons. Value is the total weight (0 = none, 1-100 = spawn weight/chance).
|
pure virtual |
Gets the current weather type.
|
pure virtual |
Gets the world bottom height.
|
pure virtual |
Hides popup message.
|
pure virtual |
Plays an effect at a specific world postion. See EffectName for available effects and possible arguments for each effect.
effectID | Effect to play. See EffectName for available effects and possible arguments for each effect. |
worldPosition | Position to play effect at |
|
pure virtual |
Plays an effect at a specific world postion. See EffectName for available effects and possible arguments for each effect.
effectID | Effect to play. See EffectName for available effects and possible arguments for each effect. |
worldPosition | Position to play effect at |
args | Effect arguments. See EffectName for available effects and possible arguments for each effect. |
|
pure virtual |
Plays a sound at a specific world position.
soundID | Sound to play. This is the same ID as found in the sounds.sfds file (the first word in each line). |
worldPosition | Position to play sound at |
|
pure virtual |
Plays a sound at a specific world position.
soundID | Sound to play. This is the same ID as found in the sounds.sfds file (the first word in each line). |
worldPosition | Position to play sound at |
volume | Volume [0.0-1.0] |
|
pure virtual |
Performs a ray cast in the world. Use with care as it can get CPU intense depending on your raycast distance and how many you perform each update! Does not work with far background objects.
start | Start position |
end | End position |
input | Input parameters |
|
pure virtual |
Replaces text tags - intended for offline maps and campaigns. Use [TEXT=language.textId] to insert text from language texts by text id (case sensitive and uses the server's language setting). Use [KEY=KEY_CODE] to insert player one's keybindings. See config.ini file for the KEY_CODE names for the keybindings.
text | Text to replace tags in. |
|
pure virtual |
Resets all score for current game users and total score.
|
pure virtual |
Runs a command. Only certain commands are available for maps. Extension scripts can run all existing commands.
command | Command to run. |
|
pure virtual |
Sets allowed camera modes that can be toggled between.
cameraModes | Flags |
|
pure virtual |
Sets the world's camera area. Only applicable if there's no active CameraAreaTrigger. Too small areas will expand to be within aspect ratio and max zoom levels.
area | Area the camera area should cover |
|
pure virtual |
Sets the world's camera area. Only applicable if there's no active CameraAreaTrigger. Too small areas will expand to be within aspect ratio and max zoom levels.
top | Top world coordinate for the camera border |
left | Left world coordinate for the camera border |
bottom | Bottom world coordinate for the camera border |
right | Right world coordinate for the camera border |
|
pure virtual |
Sets the next campaign map part to the specified index. This also loads the next part instant. Assigning the same index as the current active map part index will restart the current map part, restoring the players' stats. Only works for campaign maps.
mapPartIndex | Map part index. Any negative values are ignored. Positive values are capped to the last map part index if it should exceed that value. |
|
pure virtual |
Sets a timeout in seconds for a challenge type map. Only works for challenge maps. The host controls the time limit in other map types (such as versus). QUIRK: To update the time limit you must first disable this (by setting 0) and in the next main update cycle set this to the new value you want to apply.
seconds | Challenge time limit in seconds. Max allowed is 10 minutes (600 seconds). |
|
pure virtual |
Sets the current camera mode to be used. This overrides allowed camera modes.
cameraMode | Flag |
|
pure virtual |
Sets the game as game over based on current map type. For Campaigns this will start the campaign all over. For Survival maps this will indicate that the current survival wave is over, if all players are dead the current wave will restart, if someone's alive it will progress. For Challenges this will end the challenge, the Game.ChallengeCompleted property determines if the challenge is completed successfully or not. ///
/* // Example use: public void OnStartup() { if (Game.GetMapType() == MapType.Challenge) { // Challenge maps have AutoVictoryConditionEnabled true by default and will play out like a versus game. // Set it to false if you want to control when the user has completed the challenge. Game.AutoVictoryConditionEnabled = false; } } // Example code to trigger victory/defeat for all map types through code if you need more advanced rules than a GameOverTrigger. public void CheckGameOver() { switch(Game.GetMapType()) { case MapType.Custom: { // Custom map types requires you to increase the score of the individual users bool victory = false; foreach(IUser user in Game.GetActiveUsers()) { IPlayer plr = user.GetPlayer(); if (plr != null && !plr.IsDead) { user.IncreaseScore(); victory = true; } } Game.SetGameOver((victory ? "Victory!" : "Defeat")); } break; case MapType.Survival: { // Survival map types are automatic. Just call Game.SetGameOver(). // If anyone is alive the survival will progress to the next wave. // If everyone is dead the survival wave will restart if any retries remains. Game.SetGameOver(); } break; case MapType.Challenge: { // For challenges AutoVictoryConditionEnabled is by default true which means once every hostile enemy is dead the challenge is completed. // If it's false you need to set Game.ChallengeCompleted and call Game.SetGameOver() manually. bool victory = false; foreach(IUser user in Game.GetActiveUsers()) { IPlayer plr = user.GetPlayer(); if (plr != null && !plr.IsDead) { victory = true; break; } } Game.ChallengeCompleted = victory; Game.SetGameOver(); } break; case MapType.Campaign: { // For campaigns you must decide when to progress to the next part, // when the campaign is won or if the users need to restart the current part. bool victory = false; foreach(IUser user in Game.GetActiveUsers()) { IPlayer plr = user.GetPlayer(); if (plr != null && !plr.IsDead) { victory = true; break; } } if (!victory) { // Restart current part again Game.SetCampaignMapPart(Game.CampaignCurrentMapPartIndex); } else { if ((Game.CampaignCurrentMapPartIndex + 1) == Game.CampaignTotalMapParts) { // campaign won! Game.SetGameOver("The End"); } else { // Go to next part Game.SetCampaignMapPart(Game.CampaignCurrentMapPartIndex + 1); } } } break; case MapType.Versus: { // AutoVictoryConditionEnabled is true by default for versus maps. No need to do anything. } break; } } */ ///
|
pure virtual |
Sets the game as game over and shows a custom text. For Campaigns this will start the campaign all over. For Survival maps this will indicate that the current survival wave is over, if all players are dead the current wave will restart, if someone's alive it will progress. For Challenges this will end the challenge, the Game.ChallengeCompleted property determines if the challenge is completed successfully or not.
gameOverText | Custom game over text. |
|
pure virtual |
OBSOLETE. DO NOT USE. This function is kept for backwards compatibility with olders scripts using this function. This does NOT change the MapType of the map. QUIRK: Setting MapType.Custom will be the same as setting AutoVictoryConditionEnabled = false; Setting MapType.Versus will be the same as setting AutoVictoryConditionEnabled = true; Using other MapTypes will be totally ignored by this function!
gameType | MapType.Custom |
OBSOLETE
|
pure virtual |
Sets what kind of stats should be kept when progressing on the same playthrough. This only applies to survival (clearing a wave or retrying a wave) and campaign (progressing to a new map part or dying).
statsToKeep | StatsToKeep |
|
pure virtual |
Sets the current weather type.
|
pure virtual |
Sets the world bottom height.
height |
|
pure virtual |
Shows a chat message to all users.
message | Message to show. Max 400 characters. |
|
pure virtual |
Shows a chat message to all users.
message | Message to show. Max 400 characters. |
color | Color |
|
pure virtual |
Shows a chat message to a specific user.
message | Message to show. Max 400 characters. |
color | Color |
userIdentifier | User to show message to. This is the IUser.UserIdentifier/IPlayer.UserIdentifier. If the user doesn't exist no chat message is sent. |
|
pure virtual |
Shows a chat message to a specific user.
message | Message to show. Max 400 characters. |
userIdentifier | User to show message to. This is the IUser.UserIdentifier/IPlayer.UserIdentifier. If the user doesn't exist no chat message is sent. |
|
pure virtual |
Shows popup message.
message | Message to show |
|
pure virtual |
Shows popup message.
message | Message to show |
color | Color |
|
pure virtual |
Spawns a fire node in the world.
worldPosition | World coordinate |
velocity | Velocity |
fireNodeType | Fire node type |
|
pure virtual |
Spawns several fire nodes in the world in a circle.
worldPosition | World coordinate |
totalNodeCount | Total fire nodes to spawn evenly spread to form a circle (molotov default: 22) |
expandVelocity | Expand velocity for each node in the circle (molotov default: 3f) |
fireNodeType | Fire node type |
|
pure virtual |
Spawns several fire nodes in the world in a circle.
worldPosition | World coordinate |
totalNodeCount | Total fire nodes to spawn evenly spread to form a circle (molotov default: 22) |
baseVelocity | Base velocity for each node (molotov default: LinearVelocity * 0.04f) |
expandVelocity | Expand velocity for each node in the circle (molotov default: 3f) |
randomVelocity | Random expand velocity for each node (molotov default: 0.5f) |
fireNodeType | Fire node type |
|
pure virtual |
Tries to create a new Item in the world at a random position if it can be found. Returns null if failed. This can return a SupplyCrate or StreetsweeperCrate - depending on spawn chances. To spawn a SupplyCrate at a specific location, use Game.CreateObject("SupplyCrate00", new Vector2(x, y)); instead. To spawn a StreetsweeperCrate at a specific location, use Game.CreateObject("StreetsweeperCrate", new Vector2(x, y)); instead.
forceSpawn | Forces the crate to spawn at the last known random position even if no new random position was found. |
|
pure virtual |
Spawns a projectile in the world. Returns null if ProjectileItem.NONE is used or other non-defined enum values.
projectileID | Projectile to spawn. Must be correctly defined or null is returned. |
worldPosition | Initial position of the projectile |
direction | Direction of the projectile as a normalized vector |
|
pure virtual |
Spawns a projectile in the world. Returns null if ProjectileItem.NONE is used or other non-defined enum values.
projectileID | Projectile to spawn. Must be correctly defined or null is returned. |
worldPosition | Initial position of the projectile |
direction | Direction of the projectile as a normalized vector |
powerup | Projectile powerup |
|
pure virtual |
Tries to create a new SupplyCrate in the world at a random position if it can be found. Returns null if failed.To spawn a SupplyCrate at a specific location, use Game.CreateObject("SupplyCrate00", new Vector2(x, y)); instead.
forceSpawn | Forces the crate to spawn at the last known random position even if no new random position was found. |
|
pure virtual |
Spawns a weapon item in the world with default values and despawn time.
weaponItem | WeaponItem to spawn |
worldPosition | World position |
|
pure virtual |
Spawns a weapon item in the world with default values and despawn time.
weaponItem | WeaponItem to spawn |
worldPosition | World position |
enablePhysics | If the item should initially have physics on (true) or stay frozen the air (false) |
|
pure virtual |
Spawns a weapon item in the world with default values and despawn time.
weaponItem | WeaponItem to spawn |
worldPosition | World position |
enablePhysics | If the item should initially have physics on (true) or stay frozen the air (false) |
despawnTime | Despawn time in ms. 0=No despawn time. |
|
pure virtual |
Triggers an explosion at the given world coordinate.
worldPosition | World coordinate |
|
pure virtual |
Triggers a fire "explosion" at the given world coordinate causing everything inside to be ignited.
worldPosition | World coordinate |
worldRadius | World radius (molotov default: 10f) |
Does not spawn fire nodes or any visual effect
|
pure virtual |
Gets a text by id from the language file.
textId | TextId of the text, case sensitive |
value | Value out |
|
pure virtual |
Gets a text by id from the language file.
textId | TextId of the text, case sensitive |
value | Value out |
args | Parameters used by the textId. Number of arguments must match. |
|
pure virtual |
Update current weapon spawn chances for defined weaponitems. Example:
*/ /* public void OnStartup() { Dictionary<short, int> weaponChances = new Dictionary<short, int>(); weaponChances.Add((short)WeaponItem.PISTOL, 100); // Game.ClearWeaponSpawnChances(); // To clear all current weapon spawn chances first and only allow pistols to spawn! Game.UpdateWeaponSpawnChances(weaponChances); } */ /**
values | Updates weapon spawn chances. Key is the enum WeaponItem converted as short (short)WeaponItem for defined weapons. WeaponItems not added to the dictionary will keep their current spawn chance. Value is the total weight (-1 = default, 0 = none, 1-100 = spawn weight/chance). |
|
pure virtual |
Writes a message out to the console and map debug options menu while testing a map in the map editor.
|
pure virtual |
Writes a message out to the console and map debug options menu while testing a map in the map editor. If the custom format fails, a default one will be used instead.
|
getset |
Gets or Sets if auto score condition is enabled. Auto score condition increases a player's score if they survive a wave in survival, progress a campaign map or is alive at the end of a round for versus/custom map types. If set to false score must be increased manually per user by using the IUser.IncreaseScore() function before the game victory text is shown (it's displayed shortly after Game.IsGameOver is true).
|
getset |
Gets or Sets auto spawn item crates.
|
getset |
Gets or Sets if auto victory condition is enabled. Auto victory condition applies to Versus and Challange map types. Custom, Survival and Campaign map types must be controlled when it's GameOver via triggers or scripts.
|
get |
Gets the current map part index for a campaign. Returns -1 for non-campaign maps.
|
get |
Gets the total map parts for a campaign. Returns 0 for non-campaign maps.
|
getset |
Gets or Sets if the challenge is completed successfully when calling SetGameOver(). This only works for Challenge type maps.
|
get |
Gets the current difficulty based on map mode, players and progress in range [0.0-1.0]. Survival maps returns current players / total players. Campaigns maps returns 0.25 for easy, 0.5 for normal, 0.75 for hard and 1.0 for expert. Other maps return 1.0.
|
getset |
Use the SessionStroage or LocalStorage instead. This property is kept for backwards compatibility.
Gets or Sets the session data string that is maintained between games for individual level scripts or extension scripts. This is reset when the server changes to a different map or the server restarts.
|
getset |
Gets or Sets if the death sequence of the map is enabled. The death sequence will show a text "YOU ARE DEAD" + play sound.
|
get |
Access to certain helper functions
|
get |
Gets if this is run in the editor while testing a map. Useful if you want to enable (or disable) certain features for testing only.
|
get |
Gets if the code is executing during the first update.
|
get |
Checks if the game is over
|
get |
Gets access to local storage. This storage is permanent between server restarts and between different played levels. Data is stored based on the current map/script's file path. Quirk: You're limited to a practical max storage limit to about 10 MB file sizes. Quirk: Changing the filename or placing the script in another folder will change the file path for the stored data. Quirk: You must test on a saved map for this to save data between runs in the map editor.
|
get |
Gets the author of the map.
|
get |
Gets the last saved GUID of the map, when the map was last updated.
|
get |
Gets the name of the map.
|
get |
Gets the original GUID of the map, when the map was first created.
|
get |
Gets the current map round while playing the same map - resets on map change. Starts on 1 and increment for each round while playing the same map.
|
get |
Gets the number of total players defined by the map. Only available for campaigns and survival type maps. Returns 0 if not set.
|
get |
Gets the selected difficulty level in the current map. Only applicable for campaign maps where this will return the selected difficulty choosen by the host. Any other map will return DifficultyLevel.None and CurrentDifficulty 1.0.
|
get |
Gets access to session storage. This storage is maintained between games for individual level scripts or extension scripts. This is reset when the server changes to a different map or the server restarts. For permanent storage use LocalStorage instead.
|
get |
Gets the slowmotion/time modifier in the game affected by slowmotion items and /settime command.
|
getset |
Gets or Sets if the startup sequence of the map is enabled. The startup sequence will show GET READY and FIGHT text + play sound.
|
getset |
Gets or Sets if stats should be kept when progressing on the same playthrough. This only applies to survival (clearing a wave or retrying a wave) and campaign (progressing to a new map part or dying).
|
get |
Gets if sudden death is currently active.
|
get |
Gets if sudden death is enabled.
|
getset |
Gets or Sets current survival extra lives for survival type maps - resets on map change/restart.
|
get |
Gets the current survival wave while playing the same map - resets on map change/restart. Starts on 1 and increment for each survival wave finished.
|
get |
Gets if current survival wave is completed. Only updated after IsGameOver is true. This property returns false if all survivors are dead.
|
get |
Gets the total time limit in the game in seconds. Returns 0 if TimeLimitActive is false. Use GetRemainingTimeLimit() to get the remaining time.
|
get |
Gets if time limit is active and ticking. Remaining time can be retrieved via GetTimeLimitRemaining().
|
get |
Gets the total elapsed game-time, affected by slowmotion, in milliseconds since the game started.
|
get |
Gets the total elapsed real-time in milliseconds since the game start.
|
getset |
Gets or Sets the total score in the current map (applies to Survival type maps).