There were a few mistakes in the code, here is the fixed version
dropbox.com/scl/fi/prmccc8ug38lfr1ryjl26/V6_.c3p
No, r should be a global or a local variable, not instance variable.
You probably need to do the same with the Random function - pick Respawn instance by UID.
I don't really understand why you need those functions. You can spawn new monster directly in event #1
Then setting a random value to a variable should definitely work.
On start of layout: Set r to random(sprite.animationFrameCount) Sprite set frame to r
Develop games in your browser. Powerful, performant & highly capable.
You do not have permission to view this post
In NWjs export you can change window title with NW.js object.
In a web game this may be possible with scripting.
document.title = "This is the new page title.";
Can you explain the task?
Do you need to set one random frame to all instances? (say, frame 4 for all)
Or random frames to each instance, without repetition?
You need to pick the right spawner instance inside the function. Add another function parameter - SpawnerUID. Pass Respawn.UID when calling the function. Inside the function use "Respawn Pick by unique ID" condition.
Or you can set "Copy picked" in function properties, then they should inherit the picked scope.
You want the frame to be the same for all instances? Then assign it to a variable:
set r to random(sprite.animationFrameCount)
Sprite set frame to r
Member since 26 May, 2016