### Ravenscript Basic Syntax Example Source: https://ravenfieldgame.com/ravenscript/getting-started Demonstrates fundamental Ravenscript syntax, including comments, variable declaration, function definition, conditional statements, and table manipulation. Ravenscript is based on Lua, encouraging local scope for variables and functions. ```lua -- This is a comment. It is ignored by Ravenscript. -- Try to declare all functions and variables as local. Each Ravenscript mod -- is confined to a separate environment. Rendering name collisions with -- other mods impossible. Nevertheless, it is still good practice. local a = 3 local function addTwo(x) return x + 2 end if addTwo(a) == 5 then print("it worked!") end local names = {} -- An empty table table.insert(names, "foo") print(names[1]) -- foo ``` -------------------------------- ### Setting Initial State in Start() for RavenScript Source: https://ravenfieldgame.com/ravenscript/api-behaviours Illustrates the use of the `Start()` callback method in RavenScript to set initial states, such as setting a position for a `LineRenderer`. `Start()` is called once after `Awake()` and is safe for interacting with other components. ```lua function Rachael:Start() local p = Vector3(0, 0, range) self.line.SetPosition(1, p) end ``` -------------------------------- ### Configure VSCode for .txt as Lua Syntax Highlighting Source: https://ravenfieldgame.com/ravenscript/installation This configuration snippet ensures that Visual Studio Code applies Lua syntax highlighting to all .txt files within the Ravenfield Tools Pack folder. This is necessary because Ravenscript files use the .txt extension and are treated as Text Assets in Unity. ```json { "files.associations": { "*.txt": "lua" } } ``` -------------------------------- ### Initializing Components in Awake() for RavenScript Source: https://ravenfieldgame.com/ravenscript/api-behaviours Shows how to use the `Awake()` callback method in RavenScript to get references to other components, such as `LineRenderer`. `Awake()` is called once when the script is instantiated and is ideal for setup. ```lua function Rachael:Awake() self.line = self.gameObject.GetComponent(LineRenderer) end ``` -------------------------------- ### Spawn Point Selection Source: https://ravenfieldgame.com/ravenscript/api/ActorManager Get random spawn points for various scenarios. ```APIDOC ## Spawn Point Selection ### Description Provides functions to retrieve random spawn points for different strategic purposes, such as enemy spawns or frontline spawns. ### Method GET ### Endpoint `/ActorManager` ### Parameters #### Query Parameters - **team** (Team) - The team for which to find a spawn point. ### Request Example ```json { "example": "Parameters are passed as arguments to the functions." } ``` ### Response #### Success Response (200) - **RandomEnemySpawnPoint(team)** (SpawnPoint) - Returns a random enemy spawn point for the team. - **RandomFrontlineSpawnPointForTeam(team)** (SpawnPoint) - Returns a random frontline spawn point for the team. - **RandomSpawnPoint()** (SpawnPoint) - Returns a random spawn point from all available spawn points. - **RandomSpawnPointForTeam(team)** (SpawnPoint) - Returns a random spawn point for the specified team. #### Response Example ```json { "RandomEnemySpawnPoint": { "id": "esp1", "team": "Team2" }, "RandomFrontlineSpawnPointForTeam": { "id": "flsp1", "team": "Team1" }, "RandomSpawnPoint": { "id": "rsp1" }, "RandomSpawnPointForTeam": { "id": "rsp_team1", "team": "Team1" } } ``` ``` -------------------------------- ### Ravenscript Behaviour Declaration and Start Function Source: https://ravenfieldgame.com/ravenscript/getting-started Shows how to declare a Ravenscript behaviour and define its 'Start' function, which is executed when the behaviour is initialized. This is the basic structure for creating interactive elements in Ravenfield mods. ```lua behaviour("MyBehaviour") function MyBehaviour:Start() print("Hello World") end ``` -------------------------------- ### SpawnUi Class Source: https://ravenfieldgame.com/ravenscript/api Handles the user interface for spawn point selection and related actions. ```APIDOC ## SpawnUi Class ### Description Manages the spawn UI, allowing players to select spawn points, open battle plans, and override loadout and minimap visibility. ### Methods - `SpawnUi::Close()` - `SpawnUi::GetSelectedSpawnPoint()` - `SpawnUi::Open()` - `SpawnUi::OpenBattlePlan()` - `SpawnUi::SetLoadoutOverride()` - `SpawnUi::SetLoadoutVisible()` - `SpawnUi::SetMinimapOverride()` - `SpawnUi::SetMinimapVisible()` - `SpawnUi::SetSelectedSpawnPoint()` ``` -------------------------------- ### Configure VSCode Debugger for MoonSharp Attach Source: https://ravenfieldgame.com/ravenscript/debugging This JSON configuration snippet is used in VSCode's launch.json file to set up the debugger for attaching to a MoonSharp process. It specifies the debugger type, a debug server port, and the request type as 'attach'. Ensure the 'xanathar.moonsharp-debug' extension is installed. ```json { "version": "0.2.0", "configurations": [ { "name": "MoonSharp Attach", "type": "moonsharp-debug", "debugServer" : 41912, "request": "attach" } ] } ``` -------------------------------- ### Input Component API Source: https://ravenfieldgame.com/ravenscript/api Documentation for the Input component, outlining its constructors and methods. ```APIDOC ## Input Component API ### Description Handles user input events and provides access to input states. ### Constructors - `Input()` ### Methods - [List of Input methods would go here] ### Static Members - [List of Input static members would go here] ### Static Methods - [List of Input static methods would go here] ``` -------------------------------- ### Camera API Source: https://ravenfieldgame.com/ravenscript/api Comprehensive documentation for the Camera component, covering its properties, methods, and static members. ```APIDOC ## Camera API ### Description Provides extensive details on the Camera component, including its rendering properties, transformation matrices, and utility methods. ### Methods - **Camera::CalculateObliqueMatrix(Vector4 projectionMatrix)**: Calculates an oblique projection matrix. - **Camera::CompareTag(string tag)**: Checks if the GameObject attached to this camera has the specified tag. - **Camera::CopyFrom(Camera other)**: Copies the camera settings from another camera. - **Camera::GetGateFittedFieldOfView()**: Returns the field of view adjusted for the camera's aspect ratio. - **Camera::GetGateFittedLensShift()**: Returns the lens shift adjusted for the camera's aspect ratio. - **Camera::GetHashCode()**: Returns the hash code for this instance. - **Camera::RemoveAllCommandBuffers()**: Removes all command buffers from the camera. - **Camera::Render()**: Renders the scene from the camera's perspective. - **Camera::RenderDontRestore()**: Renders the scene without restoring the render state. - **Camera::Reset()**: Resets the camera to its default settings. - **Camera::ResetAspect()**: Resets the camera's aspect ratio. - **Camera::ResetCullingMatrix()**: Resets the camera's culling matrix. - **Camera::ResetProjectionMatrix()**: Resets the camera's projection matrix. - **Camera::ResetReplacementShader()**: Resets the camera's replacement shader. - **Camera::ResetStereoProjectionMatrices()**: Resets the camera's stereo projection matrices. - **Camera::ResetStereoViewMatrices()**: Resets the camera's stereo view matrices. - **Camera::ResetTransparencySortSettings()**: Resets the camera's transparency sort settings. - **Camera::ResetWorldToCameraMatrix()**: Resets the camera's world-to-camera matrix. - **Camera::ScreenPointToRay(Vector3 position)**: Creates a ray from the screen point to the world. - **Camera::ScreenToViewportPoint(Vector3 position)**: Converts a screen point to a viewport point. - **Camera::ScreenToWorldPoint(Vector3 position)**: Converts a screen point to a world point. - **Camera::ToString()**: Returns a string that represents the current object. - **Camera::ViewportPointToRay(Vector3 position)**: Creates a ray from the viewport point to the world. - **Camera::ViewportToScreenPoint(Vector3 position)**: Converts a viewport point to a screen point. - **Camera::ViewportToWorldPoint(Vector3 position)**: Converts a viewport point to a world point. - **Camera::WorldToScreenPoint(Vector3 position)**: Converts a world point to a screen point. - **Camera::WorldToViewportPoint(Vector3 position)**: Converts a world point to a viewport point. ### Static Methods - **Camera::FieldOfViewToFocalLength(float fov, float sensorHeight)**: Converts field of view to focal length. - **Camera::FocalLengthToFieldOfView(float focalLength, float sensorHeight)**: Converts focal length to field of view. - **Camera::GetAllCameras()**: Returns an array of all enabled cameras in the scene. ### Members - **activeTexture** (RenderTexture): The render texture that the camera is currently rendering to. - **allowDynamicResolution** (bool): Whether to allow dynamic resolution scaling. - **allowHDR** (bool): Whether to allow High Dynamic Range rendering. - **allowMSAA** (bool): Whether to allow Multi-Sample Anti-Aliasing. - **areVRStereoViewMatricesWithinSingleCullTolerance** (bool): Checks if stereo view matrices are within tolerance for single culling. - **aspect** (float): The aspect ratio of the camera. - **backgroundColor** (Color): The background color of the camera. - **cameraToWorldMatrix** (Matrix4x4): The matrix that transforms from camera space to world space. - **clearStencilAfterLightingPass** (bool): Whether to clear the stencil buffer after the lighting pass. - **commandBufferCount** (int): The number of command buffers attached to the camera. - **cullingMask** (int): The culling mask used for rendering. - **cullingMatrix** (Matrix4x4): The culling matrix used for rendering. - **depth** (float): The depth of the camera (determines rendering order). - **enabled** (bool): Whether the camera is enabled. - **eventMask** (int): The event mask for camera events. - **farClipPlane** (float): The distance to the far clipping plane. - **fieldOfView** (float): The field of view of the camera in degrees. - **focalLength** (float): The focal length of the camera in millimeters. - **forceIntoRenderTexture** (bool): Forces the camera to render into a render texture. - **gameObject** (GameObject): The game object this component is attached to. - **isActiveAndEnabled** (bool): Returns true if the component is active and enabled. - **layerCullDistances** (float[]): Distances at which layers are culled. - **layerCullSpherical** (bool): Whether to use spherical culling for layers. - **lensShift** (Vector2): The lens shift of the camera. - **name** (string): The name of the object. - **nearClipPlane** (float): The distance to the near clipping plane. - **nonJitteredProjectionMatrix** (Matrix4x4): The non-jittered projection matrix. - **orthographic** (bool): Whether the camera is orthographic. - **orthographicSize** (float): The orthographic size of the camera. - **overrideSceneCullingMask** (int): An override for the scene culling mask. - **pixelHeight** (int): The height of the camera's pixel buffer. - **pixelRect** (Rect): The pixel rectangle of the camera. - **pixelWidth** (int): The width of the camera's pixel buffer. - **previousViewProjectionMatrix** (Matrix4x4): The previous view-projection matrix. - **projectionMatrix** (Matrix4x4): The projection matrix of the camera. - **rect** (Rect): The rectangle of the camera in normalized screen coordinates. - **scaledPixelHeight** (int): The scaled height of the camera's pixel buffer. - **scaledPixelWidth** (int): The scaled width of the camera's pixel buffer. - **sensorSize** (Vector2): The size of the camera's sensor. - **stereoConvergence** (float): The stereo convergence distance. - **stereoEnabled** (bool): Whether stereo rendering is enabled. - **stereoSeparation** (float): The stereo separation distance. - **tag** (string): The tag of this GameObject. - **targetDisplay** (int): The display the camera renders to. - **targetTexture** (RenderTexture): The render texture to render to. - **transform** (Transform): The Transform attached to this GameObject. - **transparencySortAxis** (Vector3): The axis used for transparency sorting. - **useJitteredProjectionMatrixForTransparentRendering** (bool): Whether to use jittered projection matrix for transparent rendering. - **useOcclusionCulling** (bool): Whether to use occlusion culling. - **usePhysicalProperties** (bool): Whether to use physical camera properties. - **velocity** (Vector3): The velocity of the camera. - **worldToCameraMatrix** (Matrix4x4): The matrix that transforms from world space to camera space. ``` -------------------------------- ### ConfigurationData Methods Source: https://ravenfieldgame.com/ravenscript/api Methods for manipulating configuration data, including setting float, integer, range, and string values, as well as converting to a string representation. ```APIDOC ## ConfigurationData Methods ### Description Methods for manipulating configuration data, including setting float, integer, range, and string values, as well as converting to a string representation. ### Methods - `SetFloat(string key, float value)`: Sets a float value for the given key. - `SetInt(string key, int value)`: Sets an integer value for the given key. - `SetRange(string key, float min, float max)`: Sets a float range for the given key. - `SetString(string key, string value)`: Sets a string value for the given key. - `ToString()`: Converts the configuration data to a string representation. ``` -------------------------------- ### PlayerHud Methods Source: https://ravenfieldgame.com/ravenscript/api Methods for managing the Player HUD UI elements. ```APIDOC ## PlayerHud Methods ### Description Manages the visibility and tracking of UI elements within the Player HUD. ### Methods - `ClampElementTracking()` - `HideUIElement()` - `RegisterElementTracking()` - `RemoveElementTracking()` - `ShowUIElement()` ``` -------------------------------- ### IngameDialog API Source: https://ravenfieldgame.com/ravenscript/api Details the static methods available for interacting with the in-game dialog system. ```APIDOC ## IngameDialog API ### Description This section outlines the static methods provided by the `IngameDialog` class for managing and displaying in-game text messages. ### Static Methods - `Hide()` - Hides the in-game dialog. - `HideAfter(float time)` - Hides the in-game dialog after a specified time. - `HideInstant()` - Hides the in-game dialog immediately. - `PrintActorText(string text, Actor actor)` - Prints text associated with a specific actor. - `PrintActorText(string text, Actor actor)` - Overloaded method for printing actor text. - `PrintActorText(string text, Actor actor)` - Overloaded method for printing actor text. - `PrintActorText(string text, Actor actor)` - Overloaded method for printing actor text. ``` -------------------------------- ### Actor Bone Manipulation Source: https://ravenfieldgame.com/ravenscript/api/Actor Functions to get and set the scale of specific bones within an actor's humanoid or ragdoll skeleton. ```RavenScript Transform GetHumanoidTransformAnimated(HumanBodyBones bone) { // Get the animated bone transform of the specified HumanoidBodyBone. } Transform GetHumanoidTransformRagdoll(HumanBodyBones bone) { // Get the ragdoll bone transform of the specified HumanoidBodyBone. } void SetHumanoidBoneScale(HumanBodyBones bone, Vector3 scale) { // Set the bone local scale of the specified HumanoidBodyBone. } void SetHumanoidBoneScale(HumanBodyBones bone, float scale) { // Set the bone local scale of the specified HumanoidBodyBone. } ``` -------------------------------- ### Vehicle Spawner API Source: https://ravenfieldgame.com/ravenscript/api This section details the VehicleSpawner class, which is responsible for spawning vehicles in the game. It includes methods for getting prefabs, checking spawn status, and initiating spawns. ```APIDOC ## VehicleSpawner ### Description Provides functionality to spawn and manage vehicles. ### Methods * **`GetPrefab()`**: Returns the prefab of the vehicle to be spawned. * **`GetPrefabVehicle()`**: Returns the vehicle prefab. * **`SpawnIsBlocked()`**: Checks if the spawn point is currently blocked. * **`SpawnNow()`**: Immediately spawns a vehicle. * **`SpawnVehicle()`**: Spawns a vehicle. * **`SpawnVehicleImposter()`**: Spawns an imposter vehicle. * **`ToString()`**: Returns a string representation of the VehicleSpawner. ### Members * **`gameObject`**: The game object associated with the spawner. * **`lastSpawnedVehicle`**: The last vehicle that was spawned. * **`lastSpawnedVehicleHasBeenUsed`**: A boolean indicating if the last spawned vehicle has been used. * **`parentSpawnPoint`**: The parent spawn point of this spawner. * **`spawnType`**: The type of vehicle to be spawned (e.g., `VehicleSpawnType::BomberPlane`). * **`transform`**: The transform component of the spawner. ``` -------------------------------- ### ParticleSystem Class Methods Source: https://ravenfieldgame.com/ravenscript/api Information on the constructors, members, and methods of the ParticleSystem class for managing particle effects. ```APIDOC ## ParticleSystem Class ### Description Controls and manages particle effects in the scene. ### Constructors * `ParticleSystem()` ### Members * `gameObject` (GameObject) - The game object this component is attached to. * `isEmitting` (bool) - Is the particle system currently emitting particles? * `isPaused` (bool) - Is the particle system paused? * `isPlaying` (bool) - Is the particle system playing? * `isStopped` (bool) - Is the particle system stopped? * `name` (string) - The name of the component. * `particleCount` (int) - The number of particles currently in the system. * `proceduralSimulationSupported` (bool) - Is procedural simulation supported? * `randomSeed` (uint) - The seed for the random number generator. * `tag` (string) - The tag of the GameObject. * `time` (float) - The current time of the particle system. * `transform` (Transform) - The transform component of the GameObject. * `useAutoRandomSeed` (bool) - Should the system use an automatically generated random seed? ### Methods * `AllocateAxisOfRotationAttribute()` * `AllocateMeshIndexAttribute()` * `Clear()` * `Clear()` * `CompareTag(string tag)` (bool) - Is the tag of this GameObject equal to the tag? * `Emit()` * `GetHashCode()` (int) - Returns the hash code for this object. * `IsAlive()` (bool) * `IsAlive()` (bool) * `Pause()` * `Pause()` * `Play()` * `Play()` * `Simulate()` * `Simulate()` * `Simulate()` * `Simulate()` * `Stop()` * `Stop()` * `ToString()` (string) - Returns a string that represents the current object. * `TriggerSubEmitter()` * `ResetPreMappedBufferMemory()` * `SetMaximumPreMappedBufferCounts()` ``` -------------------------------- ### Create Ravenscript Behavior Source: https://ravenfieldgame.com/ravenscript/api-built-in Defines a Ravenscript behavior class with a specified name. This is conceptually similar to creating a class and defining its methods, such as a 'Start' function. ```lua behaviour("Rachael") -- conceptually equal to `Rachael = class()` function Rachael:Start() print("Hello World") end ``` -------------------------------- ### Rigidbody Methods Source: https://ravenfieldgame.com/ravenscript/api This section details the various methods available for the Rigidbody component. ```APIDOC ## Rigidbody Methods ### Description Provides a collection of methods for interacting with and manipulating Rigidbody components. ### Methods - `ClosestPointOnBounds()` - `CompareTag()` - `GetHashCode()` - `GetPointVelocity()` - `GetRelativePointVelocity()` - `IsSleeping()` - `MovePosition()` - `MoveRotation()` - `ResetCenterOfMass()` - `ResetInertiaTensor()` - `SetDensity()` - `Sleep()` - `SweepTest()` - `SweepTestAll()` - `ToString()` - `WakeUp() ``` -------------------------------- ### Actor Skin Management Source: https://ravenfieldgame.com/ravenscript/api/Actor Functions to manage the visual skin of an actor. This includes resetting to the team skin, applying custom unmanaged skins with specified meshes and materials, or getting the current override skin. ```RavenScript void ApplyTeamSkin() { // Resets the skin of the actor to the game-managed team skin. } void SetSkin(ActorSkin actorSkin) { // Sets the skin of this actor to an unmanaged skin. } void SetSkin(Mesh mesh, array materials, int teamMaterialIndex) { // Sets the skin of this actor to an unmanaged skin. } ActorSkin GetOverrideActorSkin() { // Gets the current actor skin. Returns nil if actor is using the default team skin. } ``` -------------------------------- ### Screen Static Methods Source: https://ravenfieldgame.com/ravenscript/api Details the static methods for controlling the screen cursor. ```APIDOC ## Screen Static Methods ### Description Provides static methods for interacting with the screen, such as cursor management. ### Methods - `LockCursor()` - `UnlockCursor() ``` -------------------------------- ### Actor Creation and Management Source: https://ravenfieldgame.com/ravenscript/api/ActorManager Create AI actors, manage their spawning, and control player takeover of bots. ```APIDOC ## Actor Creation and Management ### Description Functions for creating AI actors, obtaining actors for spawning, and allowing the player to take control of a bot. ### Method POST ### Endpoint `/ActorManager` ### Parameters #### Query Parameters - **team** (Team) - The team to which the actor belongs. - **actor** (Actor) - The actor to be taken over by the player. ### Request Example ```json { "example": "Parameters are passed as arguments to the functions." } ``` ### Response #### Success Response (200) - **CreateAIActor(team)** (Actor) - Creates a new AI actor on the specified team. Use `Actor.SpawnAt(...)` to spawn. - **GetSpawnableAIActor(team)** (Actor) - Gets an AI actor available for spawning on the team. Creates a new one if all are alive. - **PlayerTakeOverBot(actor)** - Assumes control over the target actor. The current player actor and the bot actor are killed. #### Response Example ```json { "CreateAIActor": { "id": "newAIActor1", "team": "Team2" }, "GetSpawnableAIActor": { "id": "spawnableAIActor1", "team": "Team1" }, "PlayerTakeOverBot": "Success" } ``` ``` -------------------------------- ### Updating Object Position in Update() for RavenScript Source: https://ravenfieldgame.com/ravenscript/api-behaviours Provides an example of using the `Update()` callback method in RavenScript to modify the GameObject's position every frame. `Update()` is suitable for continuous game logic and movement. ```lua function Rachael:Update() local position = self.transform.position position = position + Vector3.one * Time.deltaTime self.transform.position = position end ``` -------------------------------- ### KeyBinds API Source: https://ravenfieldgame.com/ravenscript/api Lists the available keybinds for player actions. ```APIDOC ## KeyBinds API ### Description This section lists the predefined keybinds available for various player actions within the game. ### Keybinds - `Horizontal` - Horizontal movement input. - `Vertical` - Vertical movement input. - `Fire` - Primary fire action. - `Aim` - Aim down sights action. - `Lean` - Lean left/right action. - `Reload` - Reload weapon action. - `Use` - Use item or interact action. - `Crouch` - Crouch action. - `Sprint` - Sprint action. - `Jump` - Jump action. - `Weapon1` - Switch to weapon slot 1. - `Weapon2` - Switch to weapon slot 2. - `Weapon3` - Switch to weapon slot 3. - `Weapon4` - Switch to weapon slot 4. - `Weapon5` - Switch to weapon slot 5. - `NextWeapon` - Switch to the next weapon. - `OpenLoadout` - Open the loadout menu. - `Map` - Open the map. - `AimX` - Mouse X-axis input for aiming. - `AimY` - Mouse Y-axis input for aiming. - `Kick` - Kick action (e.g., in vehicles). - `Slowmotion` - Activate slow motion. - `CarSteer` - Steering input for cars. - `CarThrottle` - Throttle input for cars. - `HeliPitch` - Pitch input for helicopters. - `HeliYaw` - Yaw input for helicopters. ``` -------------------------------- ### ReflectionProbe API Source: https://ravenfieldgame.com/ravenscript/api Provides details on the ReflectionProbe component, including its properties and methods for managing reflection probes in the scene. ```APIDOC ## ReflectionProbe API ### Description This section details the properties and methods available for the `ReflectionProbe` component, used for capturing and rendering reflections. ### Properties - **backgroundColor** (Color) - The background color used for rendering the reflection probe. - **bakedTexture** (Texture) - The baked texture assigned to the reflection probe. - **blendDistance** (float) - The distance over which the reflection probe's influence blends. - **bounds** (Bounds) - The bounding box of the reflection probe. - **boxProjection** (bool) - Whether to use box projection for reflections. - **center** (Vector3) - The center of the reflection probe's bounding box. - **cullingMask** (int) - The layer mask used for culling during reflection probe rendering. - **customBakedTexture** (Texture) - A custom baked texture for the reflection probe. - **enabled** (bool) - Whether the reflection probe component is enabled. - **farClipPlane** (float) - The far clipping plane distance for the reflection probe camera. - **gameObject** (GameObject) - The game object this component is attached to. - **hdr** (bool) - Whether the reflection probe uses HDR rendering. - **importance** (float) - The importance of the reflection probe for rendering. - **intensity** (float) - The intensity multiplier for the reflection probe. - **isActiveAndEnabled** (bool) - Returns true if the component is active and enabled. - **name** (string) - The name of the component. - **nearClipPlane** (float) - The near clipping plane distance for the reflection probe camera. - **realtimeTexture** (Texture) - The realtime texture assigned to the reflection probe. - **renderDynamicObjects** (bool) - Whether to render dynamic objects in the reflection probe. - **resolution** (int) - The resolution of the reflection probe texture. - **shadowDistance** (float) - The shadow distance for the reflection probe rendering. - **size** (Vector3) - The size of the reflection probe's bounding box. - **tag** (string) - The tag of the game object this component is attached to. - **texture** (Texture) - The texture assigned to the reflection probe. - **textureHDRDecodeValues** (Vector3) - HDR decode values for the reflection probe texture. - **transform** (Transform) - The transform of the game object this component is attached to. ### Methods - **CompareTag(string tag)** (bool) - Checks if the tag of the attached game object matches the provided tag. - **GetHashCode()** (int) - Returns the hash code for this instance. - **IsFinishedRendering()** (bool) - Checks if the reflection probe has finished rendering. - **RenderProbe()** - Renders the reflection probe. - **Reset()** - Resets the reflection probe to its default values. - **ToString()** (string) - Returns a string that represents the current object. ``` -------------------------------- ### Team and Spawn Point Queries Source: https://ravenfieldgame.com/ravenscript/api/ActorManager Retrieve information about teams, capture points, spawn points, and squads. ```APIDOC ## Team and Spawn Point Queries ### Description Functions to query information about teams, including owned capture points, spawn points, squads, and the status of the team. ### Method GET ### Endpoint `/ActorManager` ### Parameters #### Query Parameters - **team** (Team) - The team to query information for. ### Request Example ```json { "example": "Parameters are passed as arguments to the functions." } ``` ### Response #### Success Response (200) - **GetActorsOnTeam(team)** (array) - Returns all actors on the specified team. - **GetAliveActorsOnTeam(team)** (array) - Returns all alive actors on the specified team. - **GetCapturePointsOwnedByTeam(team)** (array) - Returns capture points owned by the team. - **GetNumberOfBotsInTeam(team)** (int) - Returns the number of bots on the team. - **GetSpawnPointsOwnedByTeam(team)** (array) - Returns spawn points owned by the team. - **GetSquadsOnTeam(team)** (array) - Returns squads on the team. - **IsTeamDead(team)** (bool) - Returns true if all actors on the team are dead. - **TeamHasAnySpawnPoint(team)** (bool) - Returns true if the team has any spawn points. #### Response Example ```json { "GetActorsOnTeam": [ { "id": "actor4" } ], "GetAliveActorsOnTeam": [ { "id": "actor5" } ], "GetCapturePointsOwnedByTeam": [ { "id": "cp2" } ], "GetNumberOfBotsInTeam": 5, "GetSpawnPointsOwnedByTeam": [ { "id": "sp2" } ], "GetSquadsOnTeam": [ { "id": "squad1" } ], "IsTeamDead": false, "TeamHasAnySpawnPoint": true } ``` ``` -------------------------------- ### PlayerCamera Methods Source: https://ravenfieldgame.com/ravenscript/api Methods available for controlling the player's camera. ```APIDOC ## PlayerCamera Methods ### Description Provides methods for manipulating the player's camera, including recoil, rotation, and different camera perspectives. ### Methods - `KickCamera()` - `OverrideActiveCamera()` - `ResetRecoil()` - `RotateFirstPersonCamera()` - `ThirdPersonCamera()` ``` -------------------------------- ### SpawnPoint Class Source: https://ravenfieldgame.com/ravenscript/api Provides information and functionality related to spawn points in the game. ```APIDOC ## SpawnPoint Class ### Description Represents a spawn point in the game, with properties for its neighbors, owner, container, position, transform, and associated spawners. ### Methods - `SpawnPoint::neighoursOutgoing` - `SpawnPoint::owner` - `SpawnPoint::spawnpointContainer` - `SpawnPoint::spawnPosition` - `SpawnPoint::transform` - `SpawnPoint::turretSpawners` - `SpawnPoint::vehicleSpawners` - `SpawnPoint::ToString()` ``` -------------------------------- ### PlayableDirector Class Methods Source: https://ravenfieldgame.com/ravenscript/api Details on the PlayableDirector class, used for controlling playable assets and timelines. ```APIDOC ## PlayableDirector Class ### Description Controls playable assets and timelines. ### Constructors * `PlayableDirector()` ### Members * `duration` (double) - The duration of the playable director. * `initialTime` (double) - The initial time of the playable director. * `playOnAwake` (bool) - Should the playable director play on awake? * `time` (double) - The current time of the playable director. ### Events * `paused` (callback) * `played` (callback) * `stopped` (callback) ### Methods * `DeferredEvaluate()` * `Evaluate()` * `Pause()` * `Play()` * `RebindPlayableGraphOutputs()` * `RebuildGraph()` * `Resume()` * `Stop()` * `ToString()` (string) - Returns a string that represents the current object. ``` -------------------------------- ### ConfigurationData Methods in RavenScript Source: https://ravenfieldgame.com/ravenscript/api Details the methods for the ConfigurationData class in RavenScript, covering data serialization, deserialization, and retrieval of various data types (bool, float, int, string, dropdown, range). ```csharp ConfigurationData::ConfigurationData() ConfigurationData::Clear() ConfigurationData::Deserialize() ConfigurationData::GetBool() ConfigurationData::GetDropdown() ConfigurationData::GetFloat() ConfigurationData::GetInt() ConfigurationData::GetRange() ConfigurationData::GetString() ConfigurationData::HasBool() ConfigurationData::HasDropdown() ConfigurationData::HasFloat() ConfigurationData::HasInt() ConfigurationData::HasRange() ConfigurationData::HasString() ConfigurationData::SerializeField() ConfigurationData::SetBool() ConfigurationData::SetDropdown() ``` -------------------------------- ### MathUtils API Source: https://ravenfieldgame.com/ravenscript/api Provides a collection of static utility methods for mathematical operations. ```APIDOC ## MathUtils API ### Description A utility class offering various static mathematical functions for calculations like damping, line-segment intersections, and rotations. ### Static Methods - `MathUtils::Damp(float from, float to, float curve, float dt)` (float) - Smoothly interpolates between two float values. - `MathUtils::Damp(Vector3 from, Vector3 to, float curve, float dt)` (Vector3) - Smoothly interpolates between two Vector3 values. - `MathUtils::DampLinear(float from, float to, float lambda)` (float) - Linearly interpolates between two float values. - `MathUtils::DampSpherical(Quaternion from, Quaternion to, float curve, float dt)` (Quaternion) - Smoothly interpolates between two Quaternion values using spherical interpolation. - `MathUtils::LineSegmentVsPointClosest(Vector3 a, Vector3 b, Vector3 point)` (Vector3) - Finds the closest point on a line segment to a given point. - `MathUtils::LineSegmentVsPointClosestT(Vector3 a, Vector3 b, Vector3 point)` (float) - Finds the parameter t for the closest point on a line segment to a given point. - `MathUtils::LineVsPointClosest(Vector3 a, Vector3 b, Vector3 point)` (Vector3) - Finds the closest point on an infinite line to a given point. - `MathUtils::LineVsPointClosestT(Vector3 a, Vector3 b, Vector3 point)` (float) - Finds the parameter t for the closest point on an infinite line to a given point. - `MathUtils::LookRotationConstrainUp(Vector3 forward, Vector3 upwards)` (Quaternion) - Creates a rotation that looks along a forward direction while constraining the up direction. ``` -------------------------------- ### Rigidbody API Source: https://ravenfieldgame.com/ravenscript/api Documentation for the Rigidbody component, used to simulate realistic physics behavior for GameObjects. ```APIDOC ## Rigidbody API ### Description This section details the `Rigidbody` component, which enables physics simulation for GameObjects, allowing them to be affected by forces, gravity, and collisions. ### Properties - **angularDrag** (float) - The amount of angular drag. - **angularVelocity** (Vector3) - The angular velocity of the rigidbody. - **centerOfMass** (Vector3) - The center of mass of the rigidbody. - **collisionDetectionMode** (CollisionDetectionMode) - The mode for collision detection. - **constraints** (RigidbodyConstraints) - Constraints applied to the rigidbody's movement and rotation. - **detectCollisions** (bool) - Whether the rigidbody should detect collisions. - **drag** (float) - The amount of linear drag. - **freezeRotation** (bool) - Whether to freeze the rotation of the rigidbody. - **gameObject** (GameObject) - The game object this component is attached to. - **inertiaTensor** (Vector3) - The inertia tensor of the rigidbody. - **inertiaTensorRotation** (Quaternion) - The rotation of the inertia tensor. - **interpolation** (RigidbodyInterpolation) - The interpolation mode for the rigidbody. - **isKinematic** (bool) - Whether the rigidbody is kinematic (controlled by script, not physics). - **mass** (float) - The mass of the rigidbody. - **maxAngularVelocity** (float) - The maximum angular velocity of the rigidbody. - **maxDepenetrationVelocity** (float) - The maximum velocity for depenetration. - **name** (string) - The name of the component. - **position** (Vector3) - The position of the rigidbody in world space. - **rotation** (Quaternion) - The rotation of the rigidbody in world space. - **sleepThreshold** (float) - The threshold for the rigidbody to fall asleep. - **solverIterations** (int) - The number of solver iterations for physics calculations. - **solverVelocityIterations** (int) - The number of velocity solver iterations. - **tag** (string) - The tag of the game object this component is attached to. - **transform** (Transform) - The transform of the game object this component is attached to. - **useGravity** (bool) - Whether gravity affects the rigidbody. - **velocity** (Vector3) - The linear velocity of the rigidbody. - **worldCenterOfMass** (Vector3) - The center of mass of the rigidbody in world space. ### Methods - **AddExplosionForce(float force, Vector3 position, float radius)** - Applies an explosion force to the rigidbody. - **AddExplosionForce(float force, Vector3 position, float radius, float upwardsModifier)** - Applies an explosion force with an upwards modifier. - **AddExplosionForce(float force, Vector3 position, float radius, float upwardsModifier, ForceMode mode)** - Applies an explosion force with a specified force mode. - **AddForce(Vector3 force)** - Applies a force to the rigidbody. - **AddForce(Vector3 force, ForceMode mode)** - Applies a force with a specified force mode. - **AddForceAtPosition(Vector3 force, Vector3 position)** - Applies a force at a specific position. - **AddForceAtPosition(Vector3 force, Vector3 position, ForceMode mode)** - Applies a force at a specific position with a specified force mode. - **AddRelativeForce(Vector3 force)** - Applies a force in the rigidbody's local space. - **AddRelativeForce(Vector3 force, ForceMode mode)** - Applies a force in local space with a specified force mode. - **AddRelativeTorque(Vector3 torque)** - Applies a torque in the rigidbody's local space. - **AddRelativeTorque(Vector3 torque, ForceMode mode)** - Applies a torque in local space with a specified force mode. - **AddTorque(Vector3 torque)** - Applies a torque to the rigidbody. - **AddTorque(Vector3 torque, ForceMode mode)** - Applies a torque with a specified force mode. - **CompareTag(string tag)** (bool) - Checks if the tag of the attached game object matches the provided tag. - **GetHashCode()** (int) - Returns the hash code for this instance. - **ToString()** (string) - Returns a string that represents the current object. ``` -------------------------------- ### Behaviours - Callback Methods Source: https://ravenfieldgame.com/ravenscript/api This section outlines the standard callback methods available for behaviours in RavenScript. ```APIDOC ## Behaviours - Callback Methods ### Description Standard methods that are automatically called by the RavenScript engine during the lifecycle of a behaviour. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response (N/A) - **Awake()** (method) - Called when the script instance is being loaded. - **Start()** (method) - Called before the first frame update. - **Update()** (method) - Called every frame. #### Response Example N/A ``` -------------------------------- ### Campaign Progress Saving in RavenScript Source: https://ravenfieldgame.com/ravenscript/api Demonstrates how to save the game progress for the Campaign entity in RavenScript. This method is crucial for persistent game states. ```csharp Campaign::SaveProgress() ``` -------------------------------- ### LoadoutSet API Source: https://ravenfieldgame.com/ravenscript/api Represents a collection of gear and weapons that constitute a player's loadout. ```APIDOC ## LoadoutSet API ### Description Defines a complete set of equipment for a player, including primary and secondary weapons, and three gear slots. ### Constructors - `LoadoutSet()` ### Members - `gear1` (Gear) - The item in the first gear slot. - `gear2` (Gear) - The item in the second gear slot. - `gear3` (Gear) - The item in the third gear slot. - `primary` (Weapon) - The primary weapon. - `secondary` (Weapon) - The secondary weapon. ### Methods - `ToString()` (string) - Returns a string representation of the LoadoutSet. ``` -------------------------------- ### WireGuidedMissileProjectile Class Source: https://ravenfieldgame.com/ravenscript/api Represents a wire-guided missile projectile with detailed properties and behavior. ```APIDOC ## WireGuidedMissileProjectile Class Documentation ### Description Manages the behavior and properties of a wire-guided missile projectile, including its damage, trajectory, and interaction with the game world. ### Members - **`armorDamage`** (float) - The amount of damage dealt to armor. - **`balanceDamage`** (float) - Damage used for balancing purposes. - **`damage`** (float) - The base damage of the projectile. - **`distanceTravelled`** (float) - The distance the projectile has traveled. - **`explosionConfiguration`** (ExplosionConfiguration) - Configuration for the projectile's explosion. - **`gameObject`** (GameObject) - The GameObject associated with the projectile. - **`gravityMultiplier`** (float) - Multiplier affecting the projectile's gravity. - **`impactForce`** (float) - The force applied on impact. - **`isActive`** (bool) - Indicates if the projectile is currently active. - **`isExplodingProjectile`** (bool) - True if this projectile causes an explosion. - **`isGrenadeProjectile`** (bool) - True if this projectile is a grenade type. - **`isRigidbodyProjectile`** (bool) - True if this projectile uses a Rigidbody for physics. - **`isRocketProjectile`** (bool) - True if this projectile is a rocket type. - **`isTargetSeekingMissileProjectile`** (bool) - True if this projectile seeks a target. - **`isTravellingTowardsPlayer`** (bool) - True if the projectile is moving towards the player. - **`isWireGuidedMissileProjectile`** (bool) - True if this projectile is specifically wire-guided. - **`killCredit`** (float) - The kill credit awarded for destroying a target with this projectile. - **`source`** (GameObject) - The originating GameObject of the projectile. - **`sourceWeapon`** (Weapon) - The weapon that fired this projectile. - **`transform`** (Transform) - The transform component of the projectile. - **`velocity`** (Vector3) - The current velocity of the projectile. ### Methods #### `Stop()` Stops the movement of the projectile. - **Method**: `Stop()` - **Return Type**: `void` #### `ToString()` Converts the projectile object to its string representation. - **Method**: `ToString()` - **Return Type**: `string` ```