Enemies Following an Actor Type?

rbuckley25

  • *
  • Posts: 19
I'm trying to get the enemies in my game to follow/chase my player... the catch is my player has multiple different actor types for the different weapons he can hold.  I'm editing the "follow a target" behavior to fit what I'm looking for but I'm having some trouble making the "target actor" for my enemies change whenever my player changes weapons... Ideas?

dtrungle

  • Posts: 1938
Whenever the player changes Actor Type, send a reference of that Actor to each enemy so that they have a new Actor to chase.

You can also modify it so that the Actor Type of the player doesn't change, only his Animation changes.

rbuckley25

  • *
  • Posts: 19
Thanks for the response.  I'll definitely consider combining all the Actor Types into one and just using a lot of animations.  I'm also considering making a ghost actor that will mirror the movement of my player and act as target actor.  I'm not too familiar with the other option you mentioned.  Would you mind explaining what you mean by sending a reference of the actor to each enemy?  Maybe provide an example of how this might look in the behavior editor?  Thanks!

dtrungle

  • Posts: 1938
For your follow target code, you need to provide an Actor instance to follow. This Actor instance can be set/get using appropriate blocks. You can search the forums as I remember seeing them before.

Check this article for set/get blocks.
http://www.stencyl.com/help/view/set-get-attributes-remotely/

rbuckley25

  • *
  • Posts: 19
ahhhh, that's the block I was looking for.  thanks for your help!