crosscode-map-editor
crosscode-map-editor copied to clipboard
`SELECT_RANDOM` support
This event/action step is currently not supported properly. Can this be added?
I've also used SELECT_FIRST recently but it's quite a hassle with manual json. Can this be supported as well?
Can you show an example of how it should look?
Here is an example of the SELECT_FIRST event step. Although note that there is an identical action step version of it too.
It has a list of conditions, and an event for each condition. It will execute the event corresponding to the first true condition in the "options" array. In the example, if tmp.test ==3, then the result is "This is the 3rd option.".
{
"0": [
{
"message": {
"en_US": "This is the 1st option."
},
"type": "SHOW_SIDE_MSG",
"person": {
"person": "main.lea",
"expression": "DEFAULT"
}
}
],
"1": [
{
"message": {
"en_US": "This is the 2nd option."
},
"type": "SHOW_SIDE_MSG",
"person": {
"person": "main.lea",
"expression": "DEFAULT"
}
}
],
"2": [
{
"message": {
"en_US": "This is the 3rd option."
},
"type": "SHOW_SIDE_MSG",
"person": {
"person": "main.lea",
"expression": "DEFAULT"
}
}
],
"3": [
{
"message": {
"en_US": "This is the 4th option."
},
"type": "SHOW_SIDE_MSG",
"person": {
"person": "main.lea",
"expression": "DEFAULT"
}
}
],
"type": "SELECT_FIRST",
"options": [
"tmp.test == 1",
"tmp.test == 2",
"tmp.test == 3",
"tmp.test == 4"
]
}