Ok so Im pretty new to this program but Ive got the hang of the system of making scenes and using events and such, but Im stumped on how to make a character make choices on what they want to do.
Ok I'll give you the run down on my project, The people are going into an arcade and have several games to choose to play, they wont always be the same as the player can make many choices. Id like them to basically have free will to do whatever they like. I have my game machines set up to have these settings
Machine_Active = 0 or 1 (Is the machine usable by a person)
Machine_InUse = 0 or 1 (Is the machine is use or not)
Machine_Popularity = 0 to 100 (How popular the unit is and how appealing)
Machine_Age = 0 to Infinite Years (Just the age of the unit to reflect popularity)
Machine_Damage = 0 to 100 (This is when the machine gets older or angry people are around it)
Machine_Dirt = 0 to 100 (This is just how dirty the unit is so it can be cleaned and people dislike the dirt)
The person is a basic png for testing, they have these settings
Person_Age = 10 to 65
Person_Money_Silver = 10 to 100
Person_Money_Gold = 0 to 1
Person_Speed = 100 - Person_Age
Person_Shirt = Random Color
Person_Pants = Random Color
I could look up a tutorial about how to make the person walk around aimlessly or go for a specific spot but how would I go about making them steer towards and engage in playing on a machine they desire?
Any help will be greatly apreciated, Thanks
Develop games in your browser. Powerful, performant & highly capable.
Sort of a starting hunch, but you could either approach it (or do both, very likely) with button presses and hitboxes (for interactive objects) and have certain keys do x, and have a variable checking each key check if an action with the object was already done, and if so, prevent it. The other method, for NPCs, is probably a textbox, where you'll have a textbox graphic and text set up to appear with it (and then disappear on key release) when talking to someone.
I'm not sure of the exact eventing logistics, but you could have multiple texts set, with each having an arrow pointing to it. Set the mouse up to use a cursor/hand icon to select an arrow or have the hand icon restricted to certain x/y positions (at your discretion) and use the down/up keys to move it next to an arrow, and do most of the jist I suggested for key presses (when arrow is clicked or when you hit enter, set a variable and then use that as a condition both for checking for future conditions and to prevent the same dialog from reoccurring) and that's it.
So the characters are NPCs? Try searching for some pathfinding tutorials. If you can have them go to a certain spot this is an extension of that.
For each NPC, set up a list of preferred machines, and pick one randomly from that list. This represents the choice. This can be modified by variables such as machine popularity.
When they reach the machine, toggle the machine availability and change the animation of the sprite to represent they are using it.
Or am I on the wrong track because I seem to have answered completely differently from previous poster. Maybe clarify exactly what you are trying to do?
Yes they are npcs, generated to walk into the arcade and play games at random or acording to popularity. Thanks for the replies, gives me some ideas
While you're at it you may be interested in looking up some tutorials on state machines.
https://www.scirra.com/tutorials/search ... %20machine
It sounds like you already have a plan in place, but it may give you some ideas for organizing your NPCs behaviour.