WitcherScript is a proprietary [[Domain Specific Programming Language]] for building and modding [[Witcher 3]] written in [[C++]].
- [Documentation](https://cdprojektred.atlassian.net/wiki/spaces/W3REDkit/pages/36307090/WS+Language+Guide)
- [Documentation](https://witcherscript.readthedocs.io/en/latest/) (Traderain's docs with info on `exec` and `latent` functions)
- [Documentation](https://witcher-games.fandom.com/wiki/Witcher_Script) (fandom wiki)
> Witcher Script (.ws) is the primary scripting language for The Witcher 3: The Wild Hunt. A very large chunk of the game’s logic is written in Witcher Script. And thus can drastically change game behavior.
# Notability
Predecessor to [[RedMod Script]].
# Philosophy
Developed by [[Yigsoft]] and [[CDProjekt Red]].
## Comparison
The syntax is very similar to [[UnrealScript]] with [[Kotlin]]-like colon-based syntax and types, this makes it look very similar to [[Typescript]]. [[UnrealScript]] was itself heavily inspired by [[Javascript]] and [[Java]]. [[RedMod Script]] is a direct descendant of [[WitcherScript]].
```kotlin
// Kotlin
fun double(x : Int)
{
var result : Int
result = x * 2
return result
}
```
```typescript
// WitcherScript
exec function double( num : int ) : int
{
var result : int;
result = num * 2;
return result;
}
```
```typescript
// Cyberpunk 2077 script
function double( x : int ) : int
{
var result : int;
result = num * 2;
return result;
}
```
```typescript
// TypeScript
function double( num : number ) : number
{
var result : int;
result = num * 2;
return result;
}
```
```typescript
// UnrealScript
function int double( int num )
{
var int result;
result = num * 2;
return result;
}
```
# Platform Support
# Features
## Function Specifiers
[[UnrealScript]] calls them "Function Specifiers" but [[WitcherScript]] just calls them "different kinds of functions". Some of the explanations for the same specifier names seem to indicate that their usage differs somewhat between the two game scripting languages.
# Tips
# References