• 🏆 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!

single entity

Status
Not open for further replies.
Level 7
Joined
Apr 1, 2010
Messages
289
is it possible to make a non-structure unit to not be drag selectable. as an example say you made a tank turret and you want to still be able to select the tank turret, but you don't want to be able to select the turret and other units.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Yes, it is possible.

You can add locust ability to the unit.

Adding locust makes it unselectable and invulnerable.

If you want to make the unit not invulnerable, and be able to be targeted by other units, then remove locust from the unit.

You can add locust in object editor.

Remove it with:
  • Custom script: call UnitRemoveAbility(*yourunit*, 'Aloc')
Adding/removing locust makes the unit vulnerable and targetable by other units, but the unit can't be selected.
 
Level 7
Joined
Apr 1, 2010
Messages
289
what i meant was that the unit could be selected. Just could not be drag selected.

I know that in starcraft 1 using data edit you could enable the flag, single entity which made so that, that unit couldn't be drag selected. and i was wondering if it was possible to do anything similar to that with warcraft3 without making the unit be a structure.
 
Level 11
Joined
May 31, 2008
Messages
698
I dont think you can do that. You could disable drag selection..for everything
Idk if you wanna do that tho lol

If you wanna hide the turrets health bar tho, set selection size to -1, i dont think that prevents it from being drag selected, you could try tho xD
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Try play with these actions:
  • Actions
    • Game - Enable selection and deselection functionality (Enable selection circles)
    • Game - Disable drag-selection functionality (Disable drag-selection box)
    • Game - Enable pre-selection functionality (Enable pre-selection circles, life bars, and object info)
I suggest use GetLocalPlayer to refer the correct player respectively
 
Level 7
Joined
Apr 1, 2010
Messages
289
okay i will see what i can do with those, but i guess that making a unit non-drag selectable but still selectable is impossible.
Thanks for your advice i'll see if i can come up with something.

edit: is there anyway to set a players selection box to a region variable?
edit2: here is my solution, but i would prefer if i could use a region for the selection, it would make things a lot easier and more elegant.
  • Selected
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
      • Player - Player 9 (Gray) Selects a unit
      • Player - Player 10 (Light Blue) Selects a unit
      • Player - Player 11 (Dark Green) Selects a unit
      • Player - Player 12 (Brown) Selects a unit
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set Region = (Current camera bounds)
      • Set Group1 = (Units currently selected by Player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Group1) Greater than 1
        • Then - Actions
          • Unit Group - Pick every unit in Group1 and do (Actions)
            • Loop - Actions
              • Set Turret = (Picked unit)
              • Set Loc_to_remove1 = (Position of Turret)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Turret (Ancient Protector) for Turret) Equal to 1
                • Then - Actions
                  • Selection - Remove Turret from selection for Player 1 (Red)
                  • Set Real2 = 0.00
                  • For each (Integer AS) from 1 to 5, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Real2 Equal to 0.00
                        • Then - Actions
                          • Set Real1 = (100.00 x (Real(AS)))
                          • Set Group2 = (Units within Real1 of Loc_to_remove1 matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is in Group1) Equal to False)) and (((Owner of (Matching unit)) Equal to Player) and ((Level of Turret (Ancient Protector) for (Matching unit)) E
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in Group2) Greater than 0
                            • Then - Actions
                              • Set Tank = (Random unit from Group2)
                              • Selection - Add Tank to selection for Player
                              • Set Real2 = 1.00
                            • Else - Actions
                          • Custom script: call DestroyGroup(udg_Group2)
                        • Else - Actions
                • Else - Actions
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Group1)
 
Last edited:
Status
Not open for further replies.
Top