Search the Community
Showing results for tags 'npc interaction'.
-
Hello together, I'm currently trying to figure out how a player (avatar) on a topdown map may interact with other objects on screen by pressing the action button. And I'm totally locked in a stalemate. Here is my set up: A player sprite with a body (arcade) which is movable with a facing direction (up, down, left, right) a isLocked flag (if he interacts, prevent new interaction) A group of NPC, each sprite has a body with an interactionType (dialogue, shop, none) an optional dialogueList [dialogues [{speaker, spokenText}, ..], ..] to choose from. an optional shoppingList [{item, price, quantity},...] A group of (non-physical) Objects with an interactionType (pickup, door, event) an optional itemId and itemType (item | weapon | questItem) an optional eventKey (to call the event) an optional locationKey (to set the map for changing) An input key which, when pressed, will check a nearby object, which means an object standing on, or an npc standing next and evaluate the object (interactionType) and make a decision how to work with it (open a dialogue with passing a random set of dialogueLinesWhile evaluating the object actually comes easy, finding and passing by an object brings the horror. If tried collides, overlaps and touching, all falls short while it is needed actually walk into an object to trigger a function - if I just stand next a npc and stare at him, none of the events is true. I've read about blocked, but it will just tell me if true or false, but nothing about what is blocking me. And for none-physical objects all four options fall short, as they must not have a body (so the player can stand of it). Can anyone help me to set my mind back to the right direction?
- 2 replies
-
- npc interaction
- rpg
-
(and 2 more)
Tagged with: