• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Need help with a "hero lock" trigger

Status
Not open for further replies.
Level 2
Joined
Oct 16, 2013
Messages
18
Hey guys, I was wondering if anyone knew how to make a "hero lock" trigger that essentially allows you to lock selection on one hero so that you can't accidentally deselect them by left clicking.

I have tried countless triggers, but none of them have even worked remotely so I won't bother posting them on here. I have searched google and nothing is coming up that helps.

So does anyone have any idea how you would go about creating something like that?

Edit: If it helps, I know Dota had it in the later versions, though I can't seem to find a copy of their trigger anywhere.
 
Level 4
Joined
Jan 19, 2008
Messages
69
Try something like this?

  • asd
    • Events
      • Player - Player 1 (Red) Deselects a unit
      • Player - Player 2 (Blue) Deselects a unit
    • Conditions
      • (Triggering unit) Equal to Hero[(Player number of (Triggering player))]
    • Actions
      • Selection - Select (Triggering unit) for (Triggering player)
 
Level 2
Joined
Oct 16, 2013
Messages
18
Try something like this?

  • asd
    • Events
      • Player - Player 1 (Red) Deselects a unit
      • Player - Player 2 (Blue) Deselects a unit
    • Conditions
      • (Triggering unit) Equal to Hero[(Player number of (Triggering player))]
    • Actions
      • Selection - Select (Triggering unit) for (Triggering player)

I tried that, what basically happens is that you can't cast spells because it immediately reselects you when you try to cast an ability.

I'm not sure how Dota did it but they had a version where you could just type -hl and it would lock to your hero without bugging out your ability to cast spells.
 
Level 2
Joined
Oct 16, 2013
Messages
18
You can do this with my system. It is a hero locking camera system. http://www.hiveworkshop.com/forums/.../?prev=status=g&d=list&r=20&u=deathismyfriend

This would also lock the camera on the unit though.

I have never played Dota. If this is not what you want please explain exactly what and how you want it to work.

This is very close to what I'm looking for. Is there any way to lock the selection on the unit, but not lock the camera? If so, that would be perfect.
 
This is very close to what I'm looking for. Is there any way to lock the selection on the unit, but not lock the camera? If so, that would be perfect.

Remove the trigger "lock camera." Then make it so that there is an exception for casting spells. Maybe a "wait" would work before the "select unit" returns the selection to your character.
 

sentrywiz

S

sentrywiz

I tried that, what basically happens is that you can't cast spells because it immediately reselects you when you try to cast an ability.

I'm not sure how Dota did it but they had a version where you could just type -hl and it would lock to your hero without bugging out your ability to cast spells.

Just add this to your triggers:

  • Game - Disable selection and deselection functionality (Enable selection circles)
This disables any object selection in-game. Units cannot be selected/deselected but you still control the unit. This is how DotA did it, most likely. Then you can select a unit for a player via triggers like:

  • Selection - Select Any Unit for Player X (Color)
Note that there are two other selections for different selection enable or disable.
Try them yourself and see which works best for you.
 
Level 2
Joined
Oct 16, 2013
Messages
18
Just add this to your triggers:

  • Game - Disable selection and deselection functionality (Enable selection circles)
This disables any object selection in-game. Units cannot be selected/deselected but you still control the unit. This is how DotA did it, most likely. Then you can select a unit for a player via triggers like:

  • Selection - Select Any Unit for Player X (Color)
Note that there are two other selections for different selection enable or disable.
Try them yourself and see which works best for you.

Awesome! This was perfect, thanks so much! I've had to do some workarounds to allow the heroes to shop (adding the shop to selection when they come in range, then removing when they leave) but this was exactly what I needed. Thanks a thousand times!
 

sentrywiz

S

sentrywiz

Awesome! This was perfect, thanks so much! I've had to do some workarounds to allow the heroes to shop (adding the shop to selection when they come in range, then removing when they leave) but this was exactly what I needed. Thanks a thousand times!

No prob. And thanks for the shop tip, I was planning to also include a similar system in my map but was wondering how to deal with the shop. +rep for your unintentional suggestion :D
 
Status
Not open for further replies.
Top