2024-06-22 07:24:13 +00:00
|
|
|
# Decl/Defs {#scripting}
|
|
|
|
|
|
|
|
## Constants
|
2023-07-15 16:32:21 +00:00
|
|
|
|
|
|
|
Often you want to be able to use aliases for values inside your **EntityDef** files.
|
|
|
|
|
|
|
|
For that, you can have a name/value pair mapping inside a text file named `scripts/constants.txt`.
|
|
|
|
|
|
|
|
```
|
|
|
|
// some comments here
|
|
|
|
WEAPON_NONE 0
|
|
|
|
WEAPON_CROWBAR 1
|
|
|
|
WEAPON_GLOCK 2
|
|
|
|
[...]
|
|
|
|
DEFAULT_NAME "Max"
|
|
|
|
```
|
|
|
|
|
|
|
|
And then you use the identifers in place of those constants. Similar to environment variables in the **UNIX** shell.
|
|
|
|
|
|
|
|
```
|
|
|
|
entityDef weapon_glock {
|
|
|
|
"spawnclass" "NSItem"
|
|
|
|
"inv_item" "$WEAPON_GLOCK"
|
|
|
|
[...]
|
|
|
|
}
|
2024-06-22 07:24:13 +00:00
|
|
|
```
|