Skip to content

fixed_var_template

Kamran Wali edited this page Dec 1, 2024 · 7 revisions

Inherits: Resource

Resource template script for creating new fixed var type variables.

Description

fixed_var_template is a Resource template script. You can use this template script to create new scripts/objects that will act as a fixed var. These scripts basically stores values and will share the stored value through reference. Example of fixed var scripts are cop_fixed_bool_var, cop_fixed_float_var and cop_fixed_int_var.

Note: Make sure to give a unique class name for the new script so that you can create it in the editor.

Tutorial

Properties

Type Name Default Value
int _value

Methods

Return Type Name
untype get_value()

Property Descriptions

int _value

This is the property that will store a value. You can change type of the value to any type you want.

Note: The reason for making the default type to int is because during writing this script script templates requires that @export property to have a type otherwise the property will NOT be added when creating a script template.


Method Descriptions

untype get_value ()

This method returns the stored _value. The return type is untype. So make sure to give the return type same as the _value's type. If NOT done so then this script will give an error whenever this method is called.


Clone this wiki locally