Villager Simulation

This forum is currently in read-only mode.
  • I am trying to make a simulation game and the part of it I'm working on right now is the AI..

    So two sprites walk randomly in the map and when by chance, they collide with each other they would pause and interact whatsoever.

    The problem I have is that I don't thoroughly understand how objects and event scripting works in Construct.

    The two sprite objects are of the same type. I'm having a hard time scripting using events though because I don't know how to manage who is who. For example if i want to edit a private variable of one of the sprites and not the other one. What's the easiest way of doing it.?

  • Well, I've tried making a solution to this one, but I'm afraid I failed

    I can make a whole village of people that walk around on their own, but I can't make them interact. I know there's a way to do it with some clever family picking, but the method eludes me. Perhaps someone else can have a go?

  • My first approach would be to use detectors on the four sides of the villager, and if they want to move, it has to check if the detector is over a obstacle (house, rock, person, ect.)

    This thread explains it better:

    I dunno, maybe it'll work with that method?

  • Well I guess the moving itself of the sprites isn't the problem midnight.

    But couldn't you like have some interaction detector together with the sprite/hitbox. Then on creation set a private variable of the detector to the UID of the sprite. Now if that detector overlaps another one of the same type of sprite which has a different UID than stored in the variable => interaction.

    Or maybe I'm missing something important just my first thought on it, didn't try it myself yet. Maybe you could go more into detail what you're exactly doing eventwise right now hero_bash.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yeha I know that moving it isn't the problem, I was just suggesting using detectors on all four sides to check is movement was legal. That's a good idea though setting a UID for each of the sprites.

    I think there's something about this question that confuses us all lol

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)