playMaker

Author Topic: Cycle selection of enemies based on proximity[SOLVED]  (Read 5948 times)

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #15 on: October 30, 2015, 11:17:32 AM »
Hi Jean,

It was in the previous post, I'll link again.
http://www.nickelcitypixels.com/ArrayMakerDynamicDistanceSortingAction.unitypackage
Thanks as always!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14244
  • Official Playmaker Support
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #16 on: November 02, 2015, 01:36:28 AM »
Hi,

 ok, so maybe I am not understandsing what you want.

 this action assumes that you define a number of GameObjects in an arrayList so that they can be sorted by distance, but you seem to expect that it search within the hieararchy and store directly objects ? correct?

for this I would use ArrayListFindGameObjectsByTag ( and all your ennemies woudl be tagged "Ennemy"), and then you'll have your arrayList populated.

 but really, since they are ennemies, you'll have do to a lot of house keeping, everytime an ennemy is created or deleted. so I would suggest that ennemies add themselves to this array AND remove themselved when killed.

 Bye,

 Jean

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #17 on: November 02, 2015, 07:28:57 AM »
Hi Jean,

I need to add enemies to an array dynamically and then sort them continuously according to their distance from the player. This is needed for the purpose of cycling selection.

So far I can do anyone of these things separately but not in conjunction. For example, adding enemies dynamically by tag prohibits me from sorting them by distance (the Sort By Distance Action has no effect on the resulting array).

I can do this in code but ultimately I'd like to incld. a Playmaker tutorial on this subj. in my course. BTW, once the add and sort problems are fixed I foresee trouble w/ the cycling selection process...

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #18 on: November 02, 2015, 03:58:04 PM »
This is the behavior I'm trying to achieve (after spawning the enemies into an array);

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #19 on: November 06, 2015, 01:14:10 PM »
So basically cycling selection of enemies (dynamically, from a spawn pool) based on proximity. 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14244
  • Official Playmaker Support
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #20 on: November 07, 2015, 11:53:32 AM »
Hi,

 sorry, will deal with this next week, haven't had time to look at this properly yet... please keep bumping :)

 Bye,

 Jean

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #21 on: November 12, 2015, 03:56:19 PM »
OK, will do, thanks!

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #22 on: November 16, 2015, 02:21:56 PM »
Bump!

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #23 on: November 22, 2015, 08:09:21 PM »
bump!

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #24 on: December 04, 2015, 01:50:33 AM »
Bump! Hi Jean, you had said to msg you for a .unitypackage example, I did. Thanks! Hope to hear back soon.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14244
  • Official Playmaker Support
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #25 on: January 26, 2016, 05:47:02 AM »
Hi,

 Did I made some progress on your case? don't hesitate to bump me, I have so many things to do, that I need reminders :)

Bye,

 Jean

mikejkelley

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #26 on: January 29, 2016, 01:44:30 PM »
Hi Jean,

Yes, thank you it was very helpful (that doesn't mean I won't have questions later on lol). Thanks again, I understand you're super busy and I know what that's like!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14244
  • Official Playmaker Support
    • View Profile
Re: Cycle selection of enemies based on proximity
« Reply #27 on: May 25, 2016, 01:05:15 AM »
Hi,

 Good. Yes, never take it personally if I seem to have skipped something, simply bump.

I'll tag this thread solved.

 Bye,

 Jean