Hello guys
How have you solved making a simple State Machine in Construct 2?
I'm not talking big advanced ones, only minor ones to create some AI-feeling.
All ideas you may have are appreciated. But please keep it simple So I learn.
I've experimented with this working with booleans, I'm wondering if there are other ways you could achieve this?
Right now I'm working on making a "Worker" kind of like in Empire Earth, that gather resources and then unload it in a town house. I've managed, so far, to make it work pretty nicely... However, I'm having problems when I have more than 1 worker active.
...So if I have a condition that this specific worker, identified with a unique id - triggers when overlapping this specific resource.
When I perform actions when these conditions are met - other workers also sometimes do the actions.
Have I missed something here, on how the mechanics work in Construct 2. On how conditions are met, and actions are performed. What have I been missing? Any suggestions on what may be in conflict would be very helpful.
How would you design a basic wandering enemy - that has some basic states, like "Roaming" - "Targeting" - "Attacking" - "Evading" ? Using states...
Ok - that's the question's.
I now will describe a bit more the problems I have, it can be a bit long to read - but it's not needed for you to read to answer my question, only if you want to.
-
---
My programming friends says they are using classes when they create State Machines
sometimes they do it with Switches. Mostly they work in C or Java.
Booleans or Switches are the only way I can think of right now of using to achieve this in Construct.
I don't wanna use families, cause I haven't afford to buy the full version of Construct yet.
There seems to be some conflict in separating the objects in Construct.
To explain...
Say you have a state "Found Resource"
then you want the worker to go to the resource. When he arrived You perhaps have a state like "At resource"
And later "Extracting Resource". Something kind a like that
I make this work perfectly using only one instance of my Worker. The states on the worker seems to work good. But when I create a second Worker, or more, some actions are performed on all workers (this I don't wanna).
Even though I have a unique identification of each worker - to make construct separate different instances. Somehow sometimes, construct perform some actions on all the workers.
I don't know which mechanic that is in play here and that is the problem.
For example, if I have a boolean "ExtractWood"
And then I have a condition like "If worker is ExtractWood"
it should do certain actions.
The problem is that Construct perform actions to other workers, even though they are not "ExtractWood"
I may have other conditions as well, like sensing if the Worker are overlapping the correct resource, and so on...
So lets say my worker have targeted a resource - it is on its way there - then arrives.
Then a condition comes in to play when the worker are overlapping that specific resource.
What we have now is a specific worker (alone) overlapping a specific sprite (resource).
So if I have a condition that this specific worker, identified with a unique id - triggers when overlapping this specific resource.
When I perform actions when these conditions are met - other workers also sometimes do the actions.
Have I missed something here, on how the mechanics work in Construct 2. On how conditions are met, and actions are performed. What have I been missing? Any suggestions on what may be in conflict would be very helpful.
You can do so much designing a game without any programming at all. There are basic functions and methods to achieve stuff that is common regardless of programming language or editor. That's exactly what I'm interested in to know more about but with some practical examples that I can try in Construct.
This post is exactly what I'm talking about:
...and right now I'm interested in creating a finite-state-machine, and later implement that in Construct 2.
And in the future start working on a Real Time Strategy game.
-
That's THE END of my little novel here Sorry if I've written too much.
Regards!
///Soulmachine!