Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Using X,Y coords with NPC's

This could go in either Support or a script request, but I'll put it here to start.

First, just a head's up. I am trying to make NPC's more interesting than the normal ones that just sit around and say the same old thing everytime you talk to them. So far I've been able to make them so they say a variety of different things depending on the time of day. The hard part is in the movement of the NPC's. I want them to wander randomly, but within a certian area. This way they don't get too far from where they are supposed to be. I figure that you could set something for the certian event that says that the NPC can go to sqaure 5x34 but no farther. You would just set the X,Y restrictions in a big box or whatever shape then let the NPC roam.

The second part of what I need, is something that would make the NPC return to a specified place when a variable meets the requirements. I just don't know how you would code it in the NPC. It would seem like you would just tell the NPC to go to this coord inside a conditional branch, but it would require scripting since there is no option in the set move route command. Any help here would be greatly appreciated. Thanks.


Also, just FYI, I am using the DTS v4. Thanks!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top