Redscript
HomeGitHubDiscord
  • Home
  • Getting Started
    • Downloads
    • Setup for VSCode
    • Setup for JetBrains IDEs
    • How to start REDscripting
      • Step 1: Mod structure
      • Step 2: Finding the right class
  • Language
    • Intro
      • REDscript in 2 minutes
      • How to create a hook
        • Things to hook
    • Language Features
      • Intrinsics
      • Loops
      • Strings
      • Modules
      • Annotations
      • Conditional compilation
      • Configurable user hints
    • Built-in Types
    • Built-in Functions
      • Math
      • Random
      • Utilities
  • References and examples
    • Common Patterns
      • Safe downcasting
      • Class constructors
      • Hash maps
      • Heterogeneous array literals
      • Scriptable systems (singletons)
      • DelaySystem and DelayCallback
      • Generic callbacks
      • Persistence
    • Logging
    • UI Scripting
      • Logging Widget Trees
      • Popups
    • Vehicle system
    • Weapons
    • Codeware callbacks
      • Scriptables comparison
    • Libraries
    • Gameplay
      • Sleeping and Skipping Time
  • Help
    • Community
    • Troubleshooting
Powered by GitBook
On this page
  1. Language
  2. Language Features

Intrinsics

Intrinsics are low-level operations that are natively supported in REDscript.

PreviousLanguage FeaturesNextLoops

Last updated 10 months ago

Was this helpful?

CtrlK

Was this helpful?

Intrinsic
Type
Description

Equals

(A, A) -> Bool

Equality check (for references, enums, strings and booleans)

NotEquals

(A, A) -> Bool

Inequality check (same as above)

IsDefined

(ref<A>) -> Bool

(wref<A>) -> Bool

Null check

ToString

(A) -> String

String conversion

EnumInt

(A) -> Int32

Enum-to-Int32 conversion

IntEnum

(Int32) -> A

Int32-to-enum conversion

ToVariant

(A) -> Variant

Variant constructor

FromVariant

(Variant) -> A

Variant extractor (fails at runtime if the type does not match)

ArraySize

([A]) -> Int32

([A; N]) -> Int32

ArrayPush

([A], A) -> Void

Push item on stack (order is LIFO).

ArrayPop

([A]) -> A

Pop item from stack (order is LIFO).

ArrayClear

([A]) -> Void

ArrayResize

([A], Int32) -> Void

ArrayFindFirst

([A], A) -> Int32

([A; N], A) -> Int32

ArrayFindLast

([A], A) -> Int32

([A; N], A) -> Int32

ArrayContains

([A], A) -> Bool

([A; N], A) -> Bool

ArrayCount

([A], A) -> Int32

([A; N], A) -> Int32

ArraySort

([A]) -> Void

Only accepts arrays of primitives

ArrayInsert

([A], Int32, A) -> Void

ArrayRemove

([A], A) -> Bool

ArrayGrow

([A], Int32) -> Void

ArrayErase

([A], Int32) -> Void

ArrayLast

([A]) -> A

([A; N]) -> A

Legend:

  • [A] - array of A

  • [A; N] static array of A with size N