Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
If you read my post last week, you’ll know I was rather excited about the fact that my NPCs were pretty much all working, and life was wonderful. Except as I’m...
Hey Laura_D, what you need is to focus on a FSM (Finite Stame Machine) approach to your game. I've created my own C3 plugins to make this easier, but you can implement it with simple instance variables and you will need a global variable for your whole game state. This is a simple and effective approach since all the actions depend on your object's state. For instance, if you NPC is being controller by the player, it may have the state "PLAYER_CONTROL" as a string in it, then if you trigger the dialog box you may change the state to "PLAYER_DIALOGUE", and in your event sheet you have to condition the "control handling" of the player to the state "PLAYER_CONTROL" so your game knows when you are either moving around, or seeing a conversation.
I just implemented the same stuff I described for my last games and workload reduces a lot becuase your conditions to trigger more stuff in the game depends on a state, instead of tons of variables and animations.
Hope it helps
Appreciate the input, but I'm already using states - we had this discussion on stream a few weeks ago! I just hadn't put them in for the player, only NPCs.
That's actually very handy... for instance, an "Active" state for the player lets the user move, jump, run, use his power ups... then when you receive damage you change the state to "Damage" and you may inactivate the controls and throw the player a couple of pixels away like receiving an impact, then return to "Active" and enable movement again. And for special powers they may be "sub-states" of the main "Active" state. Is usefull also for handling animations with more complex effects. When I did this I first used instance variables for my objects, and months later I was able to develop a behavior and a plugin for handling the whole game state and each object's state.