Easy ally targeting systems?

jaybles169

New Member
Reaction score
2
Is there any easy way to make a targeting system for allied hero's? In context it would be used for something like making it easier as a healer to target another player without having to click on them. Any ideas?
 

Kikac_NNGK

Well-Known Member
Reaction score
33
pick every units within 300 range (for ex.) matching ((matching unit is a hero) and (matching unit is an ally of triggering unit))
Loop Actions:
Unit Order triggering unit to human sorceress-heal picked unit
 

jaybles169

New Member
Reaction score
2
That's kind of link an auto-target isn't it? Ideally it would be cool to have their portraits on screen (for instance, lined up to the right of your own) but I'm not totally sure that's possible. Is it?
 

jaybles169

New Member
Reaction score
2
Sure. Basically this is for a Hero D type map, so there are a decent amount of mobs on the screen. Some Heros are Tank types, some DPS types, Some Healer types, Some Hybrid types. With so many mobs on the screen, its hard for the Healer types to select the Heros that are in the middle of it all to get a heal them, so I'm looking for a way to make that possible. What you described seemed like an auto-heal of someone in the vacinity of the healer, which would work, but it wouldn't allow the healer to pick which unit to heal.

I'm looking for a way like (if I had to throw an idea out there) WoW for example, where you have fellow Hero's portraits on screen, so that if you wanted to heal someone you could just click the heal ability, then click on their portrait and it heals them (similar to the way that you can do that to your own Hero icon). Think Diablo 2 party.

I suppose one way I might go about doing it is binding a key (using a key-pressed trigger or something) like F1 to player1, F2 to player 2, etc.

I'll try and see how that works.

EDIT: Oh jeez, I didn't realize how limited the Keyboard Event was...scratch that last idea
 

Azlier

Old World Ghost
Reaction score
461
I have an idea of how it could work. Though it would require a few dummy heroes and some order redirection triggers. It's kinda like this.

Someone picks a hero, create a dummy hero for an unused player in an unused location. Have that unused player share control with everyone. Boom, a portrait. But not good enough. Whenever a hero is issued an order targetting the 'portrait', redirect it to the real thing with a nice, simple trigger.

Now, just have a timer going at all times. Set the life of the 'portrait' to the life of the real thing, mana too, to achieve the best effect. There, a nice WoW-like party interface. I'd post an example, but I'm kinda in the middle of writing an essay.

The only downside is that the player would be able to see himself twice in the interface. Kind of an annoyance. The only workaround to that would be having an unused player for every human player that could safely share control. Or, create dummy heroes for every single human player. Works, but more work for you.

I do believe that there was a certain Molten Core map that used a WoW-like interface, but I never played the map myself. I can only assume that they used a similar method.
 

jaybles169

New Member
Reaction score
2
You are a God amongst men, azlier; that's exactly what I was going for. I haven't tried it yet but I'll get right on it and post the results. I might not have it done tonight, considering it's almost 4 am, but it seems easy enough. Thanks a million.

EDIT: Is it possible to share to be able to share unit control from player to player instead of for the entire force? For instance, there is actually a computer player that is on the same force as the Heros, and I think I could potentially make the dummy units for that player, IF I could have each player be able to share it's units. Know what I mean?
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Another idea, that could make targeting easier would be to create a spell book for each ally-targeting spell. Then, inside the spell book, create a spell that "Heals the nearest low health hero", or "heals Blue's hero" or something similar. :)
 

jaybles169

New Member
Reaction score
2
@Darthfett Not a bad idea either, would be a drag to make that many spells though, as there is a possibility of 8 players. But I guess there are only 3 healing spells. But still.

As for my attempts at the shared unit control deal:
I ran into a few problems. Here are the two triggers I tried.
Trigger:
  • Creation
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Sacrifice Me!
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set TempPointA = (Center of DummyHeros <gen>)
          • Unit - Create 1 (Unit-type of (Last created unit)) for Player 10 (Light Blue) at TempPointA facing 90.00 degrees
          • Set DummyHero[0] = (Last created unit)
          • Custom script: call RemoveLocation(udg_TempPointA)
        • Else - Actions


and

Trigger:
  • SelectionRouting
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
      • Defeat Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DummyHero[0] is selected by Player 1 (Red)) Equal to True
        • Then - Actions
          • Selection - Select Player[0] for Player 1 (Red)
        • Else - Actions


I couldn't get the selection rerouting to actually work right. Is that the right way to try to do it? Oh I also have shared units between player 1 and player 10. Another problem I ran into was that if you share units and the shared team has heros(which is the whole purpose here), the portraits don't start directly below your own portrait, they start maybe like 3 slots down, and won't show more than 4. I guess one way I could try to do it, which would be extremely tedious, would be to make a dummy hero for each hero created and then for each player that is playing. Which I think would be like a max of 64 extra heros just sitting around somewhere; not very efficient.

EDIT:The triggers above are of course the most base case, where player 1 would be selecting himself, through a different portrait.
 

ChaosWarlock

New Member
Reaction score
7
The only way I can think of to redirect the spell would be a bit cumbersome depending on how many spells you have that can target allies. It also requires you to trigger all of the spells that you want to be able to be cast on allies.

In the beginning of every trigger you need an if then that sets a unit variable that we will call "Trigger".

If target of ability being cast is "Teammate1" <--- Dummy unit used for Player1's hero icon
Then set "Target" to Player 1's hero
If target of ability being cast is "Teammate2" <--- Dummy unit used for Player2's hero icon
Then set "Target" to Player 2's hero
Else set "Target" to target of ability being cast.

Then you would have to replace all of the instance when you refer to "target of ability being cast" with the variable "Target"


Edit: My map needs a similar system so I will create one and put it up in a new thread when its done.
 
General chit-chat
Help Users

      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