State Machine Plugin -v.91 - Beta[updated 2/17/20]

New releases and general discussions.

Post » Tue Feb 16, 2010 3:25 pm

[size=150:2uei4omm]State Machine Plugin v.90 beta.[/size:2uei4omm]

Actions:
->Add State
Params : State name. Starting State.
Description: Adds a new state with the given name. State names are case sensitive so Lol is different from lol.

-> Switch State
Params: State Name.
Description: Switches the named state IE lol is false lol will become true when the state is switched.

Conditions
->State is True
Params: State Name
Description: Returns if the state is true. Invert the condition if you want to see if the state is false.

-> On State Deactivated
Params: State Name
Description: Triggers when a state goes from True To False.

-> On State Activated
Params: State Name
Description: Triggers when the state goes from False To True.

-> On State Toggled
Params: State Name
Description: Triggers when the state toggles.

v.91 up dates
[add] - On State Toggle
[add] - You can now set the default state value

[change] - Now called state deactivated and activated.
___________________________________________________________________________________
Planned additions :
-> Set default state when you add a state. - done
-> Make state Params case insensitive.
-> In IDE addition of States.
-> Adaptation to a behavior.
-> On State Toggled. -done

Any other suggestions or Ideas post here. Any bugs or problems post here as well.


Get It Here
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Tue Feb 16, 2010 3:36 pm

Excuse my ignorance, but could you explain what a 'State Machine' is? I've seen it mentioned before but never understood what it was and the advantages it brings to the table. Maybe an example *.cap will help?
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Tue Feb 16, 2010 3:53 pm

There is an example cap included with the plugin files.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Tue Feb 16, 2010 4:19 pm

Have you thought about making the naming a bit more intuitive? I might go with "State is active" rather than "state is true", and "On state deactivated"/"On state activated" rather than the true-to-false terminology. Interesting idea for a plugin though!
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Feb 16, 2010 4:43 pm

I could change that nothing too hard to change. That is better terminology, I couldn't think of what to call those lol.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Tue Feb 16, 2010 6:58 pm

[quote="Shady":2lcqf4k6]Excuse my ignorance, but could you explain what a 'State Machine' is? I've seen it mentioned before but never understood what it was and the advantages it brings to the table. Maybe an example *.cap will help?[/quote:2lcqf4k6]

A state machine is a logical construct. It's basically a way to simplify handling an object by reducing it's flood of information down into one single "state" variable, that returns simple values like "walking" or "dying" so that you can interact with it it more easily.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Feb 16, 2010 7:02 pm

Sweeeet

damnit I wanted to do this one but I could never get the SDK to compile with VS9 Express =(

Downloading

Edit: Nice... but could it be a behavior instead? I think it'd be much more useful that way (for AI, for example, each instance having its own state). I have no idea how hard it would be to turn it into a behavior though :P
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Feb 16, 2010 7:07 pm

*yoink*

I'll tell you alter how much I love you!
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Feb 16, 2010 7:27 pm

[quote="madster":10gzvzsh]Sweeeet

damnit I wanted to do this one but I could never get the SDK to compile with VS9 Express =(

Downloading

Edit: Nice... but could it be a behavior instead? I think it'd be much more useful that way (for AI, for example, each instance having its own state). I have no idea how hard it would be to turn it into a behavior though :P[/quote:10gzvzsh]

its not too bad. I will get around to it I have the basics there its just a matter of doing a few things in the SDK
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Tue Feb 16, 2010 7:58 pm

Here are a couple terminology suggestions:

- On State Entry (from False to True)
- On State Exit (from True to False)

Also, I believe that "Transition" is the term used for changing states, but I guess Switch works just as well.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests