First unit in line of shot? Ability question...

ninjaalamode

New Member
Reaction score
0
The map I'm making is based on Megaman Battle Network, where battles randomly occur and take place on a 3x9 grid, such as;

[][][]|[][][]
[][][]|[][][]
[][][]|[][][]

The player is allowed to move on the left side panels while the enemies (viruses) move on the right side.

What I need help with is this... I want to make an ability that runs my unit's attack animation and damages the first, and ONLY the first, unit in the direction he is facing.
 

ninjaalamode

New Member
Reaction score
0
Bump, could someone at least help me with an ability that fires an object into the east and damages the first thing it hits?
 

FireBladesX

Eating my wings!
Reaction score
123
You can do it by periodically moving a dummy unit towards 0 degrees, checking if enemy units are in range. If it picks a unit, remove the dummy unit and damage the picked unit.
 

ninjaalamode

New Member
Reaction score
0
You can do it by periodically moving a dummy unit towards 0 degrees, checking if enemy units are in range. If it picks a unit, remove the dummy unit and damage the picked unit.
That's what I was trying to do by using 3 seperate triggers. I'd have one trigger (being started by the ability being cast) make the unit and set the unit to a unit variable. I was going to make the second trigger move it periodically while the third trigger would damage anything that comes within 10 range of the variable and then remove the variable itself.

I was going to make the third trigger with the event "A unit comes within A range of B", but it won't let me use the unit variable I set earlier as the B.
 

FireBladesX

Eating my wings!
Reaction score
123
Instead of unit comes in range, use a unit group and pick units within X radius of the position of the sliding unit. Pick every unit and remove the sliding unit, and damage the target unit.
 

ninjaalamode

New Member
Reaction score
0
Instead of unit comes in range, use a unit group and pick units within X radius of the position of the sliding unit. Pick every unit and remove the sliding unit, and damage the target unit.
Okay, I'm kind of confused. Are you telling me how I would do the third trigger, or... yeah, I'm sorry but I'm now following.
 

FireBladesX

Eating my wings!
Reaction score
123
I was saying instead of 3 triggers, do 2:

In the periodic trigger, the actions would be

Move SlideUnit to Point
Pick every unit in 100 radius of Point matching (Matching unit is an enemy and matching unit is alive) and do Actions:
Unit - remove SlideUnit from the game
Unit - damage Picked Unit

Fix the leaks, tho.
 

Genyuumaru

New Member
Reaction score
15
Use a boolean that is false by default and is set to true when a unit is hit.

When you encounter a unit, check if it's true. If it IS, then don't damage it, because some unit was already damaged.
 

ninjaalamode

New Member
Reaction score
0
I was saying instead of 3 triggers, do 2:

In the periodic trigger, the actions would be

Move SlideUnit to Point
Pick every unit in 100 radius of Point matching (Matching unit is an enemy and matching unit is alive) and do Actions:
Unit - remove SlideUnit from the game
Unit - damage Picked Unit

Fix the leaks, tho.
Thanks, I got it working now.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top