Hello,
I would like to know how I would write out a custom script that does the following
[Pick one of the random following:
>>ShowVAnimOnSpriteset(001, "testanim1", 60, 60, true)
>>ShowVAnimOnSpriteset(002, "testanim2", 60, 60, true)
>>ShowVAnimOnSpriteset(003, "testanim3", 60, 60, true)
>>ShowVAnimOnSpriteset(004, "testanim4", 60, 60, true)
]
I know I can do this via Else/If cond branches in the database, but circumstances in my game would make it a lot easier if I could just make a script call directly doing the above. How to I do this?
Looking at some javascript threads I came up with this:
But I am getting the error "Error: --SyntaxError: Invalid or unexpected token"
I would like to know how I would write out a custom script that does the following
[Pick one of the random following:
>>ShowVAnimOnSpriteset(001, "testanim1", 60, 60, true)
>>ShowVAnimOnSpriteset(002, "testanim2", 60, 60, true)
>>ShowVAnimOnSpriteset(003, "testanim3", 60, 60, true)
>>ShowVAnimOnSpriteset(004, "testanim4", 60, 60, true)
]
I know I can do this via Else/If cond branches in the database, but circumstances in my game would make it a lot easier if I could just make a script call directly doing the above. How to I do this?
Looking at some javascript threads I came up with this:
Code:
const anim01 = ShowVAnimOnSpriteset(001, "test_idle01", 60, 60, true)"
const anim02 = ShowVAnimOnSpriteset(002, "test_idle02", 60, 60, true)"
const anim03 = ShowVAnimOnSpriteset(003, "test_idle03", 60, 60, true)"
const anim04 = ShowVAnimOnSpriteset(004, "test_idle04", 60, 60, true)"
const test = ["anim01", "anim02", "anim03", "anim04"];
const random = Math.floor(Math.random() * test.length);
console.log(random, test[random]);-------------
But I am getting the error "Error: --SyntaxError: Invalid or unexpected token"