RPG Targeting System a la Tales Of

0 favourites
  • 7 posts
From the Asset Store
Design for game, asset for game, game kit, UI design, completed design for game, mobile game, Grimm Tales
  • I am trying to do a thing where the player can select a target a la Tales of Eternia or Phantasia. I simply want it to be where each time the targeting button is pressed, it selects an opponent from left to right. Kind of like this:

    |Player|________________________________|Enemy 1|__|Enemy 2|__|Enemy 3|

    When it is pressed the first time, it should select the enemy closest, then if pressed again will switch to Enemy 2, then Enemy 3, then Enemy 1 again. I suspect I need to use the Pick condition, possibly by evaluate. I'm just not sure what to put there. Thank you!

    Tagged:

  • Not sure exactly on the system as I've not played those games but assuming like most turn based RPGs where they are set positions you can use variables so on first press you're at position '1' and then press it again you're at position '2' etc.

    You could also use something like 'for each enemy (ordered by X)' which would pick each enemy in order across the screen and you could assign them variables 1,2,3 which relates to the above.

  • Thanks for the reply! Since the battles are randomly generated (with 1-4 enemies in each battle), how would I plan ahead for the counting? Does it make sense what I'm asking? Because I could certainly just assign them variables when designing the layout, but the randomness is what necessitates the being able to pick by X. I hope that makes sense. Maybe I could do a start of layout event in which I assign the enemies a target ID using a for each event. Any other ideas?

  • Depends on the design of the game but sure start with something like that. The for each only assigns to the enemies that exist on the layout so it works for any number.

  • Okay, I'm trying to make it happen by doing an event that looks like this:

    Start of Layout

    for each family.enemies(ordered by X)--------> Set Enemies.TargetID to round(random(1,Enemies.Count))

    But I get duplicate numbers, which I don't want. Any suggestions on how to avoid duplicates?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Set targetId to loopindex

  • Welp, that fixed it. Thanks! Sorry for the long delay.

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