Escape Logic
Last updated
Last updated
Customizing the Escape Logic of a Custom Role is a very important way to make the users experience even more beautiful.
UCR does provide a powerful tool to decide almost everything about the escape.
The Escape object is a simple Dictionary (object) with a key and a value. It should look like this:
The syntax for handling the escape logic is quite complicated but when you'll learn how to use it you'll see that it's very powerful.
As you can see from the example of the YAML every key-value pair represents a different scenario.
The key represents the condition that you want to handle.
If the condition is not present the default
one will be used.
In the condition there are two variable elements: InternalTeam
and ChaosInsurgency
.
The plain syntax is:
There are two available Groups: InternalTeam
and CustomRole
.
If you put InternalTeam
you then have to put as the Subject a value of the .
If you instead put CustomRole
you then have to put as the Subject the Custom Role Id.
Let's see some examples:
The value represents the action that the plugin will do to the player. The syntax is really clear:
For example, if we put CustomRole 2
and the associated condition is true the player will be spawned as the Custom Role with Id=2 when they escape.
Let's see some examples:
Now that we have both the key and the value if we put them together we have a condition=>action group.
For example, if we have this configuration:
If we escape not cuffed then we will become spectators
If we escape cuffed by Custom Role 5 we'll become Custom Role 10
If we escape cuffed by a member of the Scientists team we'll become Custom Role 9
If we escaped cuffed by Custom Role 1 we'll become Class-Ds
There are two available groups: InternalRole
and CustomRole
.
If you put InternalRole
you then have to put as the Target a value of the .
If you instead put CustomRole
you then have to put as the Target the Custom Role Id.