Jump to content


Photo

How to make a monster follow pean trail


  • Please log in to reply
4 replies to this topic

#1 xboxown

xboxown

    GMC Member

  • GMC Member
  • 47 posts

Posted 10 April 2012 - 07:22 PM

In my game the character will be dropping beans and the monster who is exploring the level randomly when they are close to the peans I want them to follow the trail of the peans. How do I do that in game maker? The intention is that they stop their current AI where they explore the level randomly and simply follow the trail of the beans on the ground and when they follow the trail, they consume the beans ones the beans are consume they return back to their original AI. I do not know where to begin on this, any help would be SWEETLY appreciate it! Thanks in advance. :biggrin:
  • 0

#2 XTIDIA Games

XTIDIA Games

    GMC Member

  • GMC Member
  • 198 posts
  • Version:GM8

Posted 10 April 2012 - 07:34 PM

In my game the character will be dropping beans and the monster who is exploring the level randomly when they are close to the peans I want them to follow the trail of the peans. How do I do that in game maker? The intention is that they stop their current AI where they explore the level randomly and simply follow the trail of the beans on the ground and when they follow the trail, they consume the beans ones the beans are consume they return back to their original AI. I do not know where to begin on this, any help would be SWEETLY appreciate it! Thanks in advance. :biggrin:


Easy - for AI
if distance_to_object(bean) < 100 {move_towards_point(x,y,bean.x,bean.y,2)]

May not be working since i hadnt use this in a while
distance_to_point maybe ? not sure

Edited by XTIDIA Games, 10 April 2012 - 07:35 PM.

  • 0

#3 commanderej

commanderej

    GMC Member

  • GMC Member
  • 47 posts
  • Version:GM8

Posted 10 April 2012 - 07:40 PM

What your gonna want to do is make a path activate when your close to the beans with the functionthe other guy was saying about:

Easy - for AI
if distance_to_object(bean) < 100 {move_towards_point(x,y,bean.x,bean.y,2)

May not be working since i hadnt use this in a while

take out the move_towards event and put in a function (no idea what this is sorry :dry: ) but once you find the function it should work fine. ::lmao::
  • 0

#4 xboxown

xboxown

    GMC Member

  • GMC Member
  • 47 posts

Posted 11 April 2012 - 12:00 AM

What your gonna want to do is make a path activate when your close to the beans with the functionthe other guy was saying about:

Easy - for AI
if distance_to_object(bean) < 100 {move_towards_point(x,y,bean.x,bean.y,2)

May not be working since i hadnt use this in a while

take out the move_towards event and put in a function (no idea what this is sorry :dry: ) but once you find the function it should work fine. ::lmao::



I wanted to thank you ALL for all your helps fast reply! :biggrin: Seriously, I will list your names in my credit in my game for your help, no help here goes unappreciate it with me :smile:
  • 0

#5 GameRoom

GameRoom

    GMC Member

  • GMC Member
  • 677 posts
  • Version:GM:Studio

Posted 15 April 2012 - 06:56 PM

Shouldn't it be an instance_nearest bean? Make sure to do that.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users