Analogue Controls

New releases and general discussions.

Post » Wed Sep 02, 2009 6:42 am

I'm trying to figure this out...

- [CHANGE] Controls are between 0 - 1 to allow for analogue controls

I don't quite get it - where can I actually set this up? I think David once told me how it works, but it was a bit more complicated and I forgot it.

Basically, this should probably be implemented in a better way. Like, right now when you're setting up a 'control is down' action, there are 2 options: One for the control, one for the player number. Wouldn't it make sense to just put an 'Analogue Threshold' as a third option up there?

Practical example would be:

"Move Right"
Player 1
Analogue .5

= Walk

"Move Right"
Player 1
Analogue 1.0

= Run
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Wed Sep 02, 2009 7:16 am

instead of using on-control, or controldown
you can use 'Always', and the 'GetControlState' expression in mouse/keyboard
(I will also add it to my custom controls plugin, I left it out by mistake)

for instance,
[code:12uw5klu] Always-Set Velocity X to GetControlState("Move Right") * 10[/code:12uw5klu]
Get Control State returns a value between 0 and 1
also, many behaviors automatically set the speed depending on the 0-1 value

also, if you want to set up your actions more similarly to how you said
you could use the system-compare condition
if GetControlState("Move Right",1) is greater than 0 - Walk
if GetControlState("Move Right",1) is greater than 0.5 - Run
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Sep 02, 2009 2:35 pm

Awesome, thanks Lucid! :)
B
6
S
2
G
3
Posts: 520
Reputation: 2,690


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests