Log In  

Hello,
Reading the user manual, I see there are states for actors (in 10.3.1: Common Actor Events).
Is it possible to access those states in lua, like a bool or a function?
Thank You

P#60765 2019-01-12 10:11 ( Edited 2019-01-12 10:13)

1

Not currently (this is planned for 0.3.6).

A slightly messy work-around in the meantime is to create a modifier (under the New Item menu), use the desired state as the trigger, and with a length (duration) of 1. So the modifier will be active only when that state is true, frame by frame.

You can then check the state of that modifier from inside a script:

function draw()
    if this:is_active("is_standing") then
        local x,y,z = this:get_xyz()
        sphere(x,y,z-20,4,14)
    end
end
P#60767 2019-01-12 10:55 ( Edited 2019-01-12 11:01)

That did it, thank you!

P#60768 2019-01-12 11:03 ( Edited 2019-01-12 11:59)

Fun little bit :)

P#60777 2019-01-12 22:10

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 08:46:39 | 0.006s | Q:12