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

Unselectable unit - but selectable with triggers

Status
Not open for further replies.
Level 9
Joined
Aug 27, 2009
Messages
473
Hmm.. I thought that wont a problem, but else.

.. You could try add the Trigger that makes the players camera lock to a unit (selected unit, before going to the other dummy unit) while use this unit.. And in that way, make unlock when unselect or cast a "Cancel" ability or something.

This is a wierd problem man.. :)

EDIT:
You can also lock it to current camera. :)
 
Level 4
Joined
Feb 23, 2009
Messages
99
If you mean it will be selectable after an ability is casted(for example here : Roar) and I think an unselectable unit means it has 'Locust' ability.

Unit Group(Pick every units within 12000 of(Caster) of type(the unit type)) and do (Actions))

Unit - Remove the ability Locust from (Picked Unit)
 
Level 9
Joined
Aug 27, 2009
Messages
473
Add locust to the dummy unit.
Add dummy unit to be placed ON the hero / unit, cast ability etc.
When cast a spell / do the thing, make dummy unit remove locust.
Select Dummy unit for player.
And when not selected add Locust, and stuff.

You have to make dummy unit invenlurnable to, also make him small, no model, and stuff like that. Now you also need all players to select the Unit / Hero over the dummy unit instead of the Dummy Unit. You can do that by adding locust agein every time a player not owning the unit selects it, and then turn off agein (and selected by the owner agein). Also make sure that the priority of the Hero / Unit is higher then the Dummy Units.

O.,o

EDIT:
Or you could mix my first idea with CrazyKiDs.. :)
 
Level 11
Joined
Feb 14, 2009
Messages
884
Locust units are immune to "All pick" triggers (or that's what I've heard). How about that: You create a unit without locust, save it in a variable and add locust to it.
 
Level 9
Joined
Aug 27, 2009
Messages
473
I writed this for not so long ago said:
You have to make dummy unit invenlurnable to, also make him small, no model, and stuff like that. Now you also need all players to select the Unit / Hero over the dummy unit instead of the Dummy Unit. You can do that by adding locust agein every time a player not owning the unit selects it, and then turn off agein (and selected by the owner agein). Also make sure that the priority of the Hero / Unit is higher then the Dummy Units.
But that is gonna fix the problem ^^
 
Level 7
Joined
Mar 8, 2009
Messages
360
  • deselect
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Selection - Remove (Triggering unit) from selection for Player 1 (Red)
You can try this (add condition, more players, etc). But check first that this trigger isn't triggered by your select trigger

EDIT: i saw that basee suggested this and that it doesn't work :s
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
UNSELECTABLE UNIT FOR PLAYER

model file>shift+enter>.mdl

all you have to do is go to model file of your unit pressing shift+enter and type ".mdl"

unit can be visible (in fog of war) but players will not be able to select that unit and triggers will

tell me if you have some problems....


not sure what you think about the camera but....
if you click on hero icon camera will not be moved

if on worker icon it will
than you might need to move unit every 1 sec of game
 
Level 11
Joined
Jun 21, 2007
Messages
505
So, before a unit casts Roar, no one, except for player 1 can select it? If you mean that only Player 1 may select it, then you might have to use
if GetLocalPlayer() == Player(0) then
(actions)
endif

The functions above makes all functions in it be done only for one player. You could add locust ability via triggers (it's rawcode is 'Aloc') to a unit, on machines of all players except for Player 1 (0)
Then do this:
  • Events
  • Conditions
  • Actions
    • For each Integer A from 1 to 11 do (Actions)
      • Custom script: if GetLocalPlayer() == Player(GetForLoopIndexA()) then
      • -------- actions --------
      • Custom script: endif
If you do it some other way, then it will affect all players equally. So, if one player can't select a unit, then all players won't succeed either.

EDIT: you can the unit invisible and owned by player 1
 
Level 30
Joined
Dec 6, 2007
Messages
2,228
@ edit: Allies could check it.

@ eleljrk: As soon as locust is added, every player deselects the unit.

I hoped to avoid local palyer functions since there happen desyncs from time to time.
Apparently it seems to be the one and only solution :/

However, you all helped me a lot, thanks.

Edit: ZlatniLav, i guess i won't do that.
 
Level 10
Joined
Dec 13, 2008
Messages
222
@ edit: Allies could check it.

@ eleljrk: As soon as locust is added, every player deselects the unit.

I hoped to avoid local palyer functions since there happen desyncs from time to time.
Apparently it seems to be the one and only solution :/

However, you all helped me a lot, thanks.

Edit: ZlatniLav, i guess i won't do that.

thank u very polite +rep
 
Level 11
Joined
Jun 21, 2007
Messages
505
Er, I meant that you can make the unit seen by all with locust ability and seen by all. And the unit which can be selected is a model with 100% transparency which is invisible, doesn't have the locust ability and is seen only by player 1.
If there are allies in the game then you can disable shared vision.
 
Level 9
Joined
Aug 27, 2009
Messages
473
Palodon, this is what meen man.. ^^ See how it works now? :)
  • DontSelect!
    • 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
      • (Owner of (Triggering unit)) Not equal to (Triggering player)
      • (Unit-type of (Triggering unit)) Equal to - - DO NOT SELECT ME - -
    • Actions
      • Unit - Add Locust to (Triggering unit)
      • Unit - Remove Locust from (Triggering unit)
      • Selection - Add (Triggering unit) to selection for (Owner of (Triggering unit))
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Palodon, this is what meen man.. ^^ See how it works now? :)
  • DontSelect!
    • 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
      • (Owner of (Triggering unit)) Not equal to (Triggering player)
      • (Unit-type of (Triggering unit)) Equal to - - DO NOT SELECT ME - -
    • Actions
      • Unit - Add Locust to (Triggering unit)
      • Unit - Remove Locust from (Triggering unit)
      • Selection - Add (Triggering unit) to selection for (Owner of (Triggering unit))

the only way to add/remove locust ability is to add it in spellbook

i don't know what is wrong with clear selection for x player but if you think that action has delay its wrong

the event player selects a unit is delaying

only if you do something like

every 0.01
if YourUnit is selected by player 2
than do action
clear selection for player 2

it will be a bit faster ...witch means that action-clear unit from selection is not delaying
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
All this selection, deselection options always need around half a second to tigger in which you have selected the wrong unit :/
yes but i think the event is delaying because you deselect unit faster when you check condition every 0.01 sec

also that half seconds delay is so stupid......
you could do a lot of things that there is no delay....
 
Level 11
Joined
Jun 21, 2007
Messages
505
I guess the only way to solve the problem is for Paladon to explain to us why does he need a unit not be selected before it casts Roar ability, what does he need that for, and how is that linked to his project he's making. Then we will easily find an alternative way, it will then become a question of map/game design, not triggering.
 
Level 30
Joined
Dec 6, 2007
Messages
2,228
/double post on purpose

The whole GetLocalPlayer() thing doesn't work, of course, since it will definitely cause desynchronisations between players.
The problem is up again.

I do not need an unselectable unit (just selectable by trigger selection) in particular, a unit which is only visible for one player would do it as well - but allied players should still see other invisible units of this player, just the determined unit not.
 
Level 11
Joined
Jun 21, 2007
Messages
505
It seems that only Dr Super Good can help you now.

Oh, and what about Unit - Hide action? If you want a player who casts Roar ability with one of his/her units gains the ability to select a unit which was unavailable to be selected before, then you can make two units - one unit, seen by all, has locust ability. The other unit is 100% transparent version of it, being constantly moved to the position of visible unit after the Roar was cast. Before the roar was cast you do this:
  • Events
  • Conditions
  • Actions
    • Set Point = Center of Playable map area
    • Custom script: call RemoveLocation(udg_Point)
    • Unit - Move DummySelectableUnit (Instantly) to Point
 
Level 9
Joined
Oct 15, 2006
Messages
339
I am in need of the same resource. Let me help you all understand a bit better of how this function is needed and could help for map makers.

I have a Shop. The Shop gives the "sellable" units of "Armor", "Weapons", etc. So when you click on "Armor" you are forced to select the Armory section of the shop. The Armory is just another shop, smaller, no collision, at the same point as the observable shop.
The armory and weapon depot aspect of the shop NEEDS to be there at the point of the shop so that when a Hero is out of range of the shop he is ALSO out of range of the depot, and again no one will be able to click on the portrait and see the "trick", it'll just be uber awesome.
The problem is that, at times, when selecting the shop, or, toward the middle of the shop, you sometimes "accidentally" select the armory or weaponry shop.

The visibility and semi-selectability has nothing to do with it since they are supposed to be neutral and hidden anyway.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
I am in need of the same resource. Let me help you all understand a bit better of how this function is needed and could help for map makers.

I have a Shop. The Shop gives the "sellable" units of "Armor", "Weapons", etc. So when you click on "Armor" you are forced to select the Armory section of the shop. The Armory is just another shop, smaller, no collision, at the same point as the observable shop.
The armory and weapon depot aspect of the shop NEEDS to be there at the point of the shop so that when a Hero is out of range of the shop he is ALSO out of range of the depot, and again no one will be able to click on the portrait and see the "trick", it'll just be uber awesome.
The problem is that, at times, when selecting the shop, or, toward the middle of the shop, you sometimes "accidentally" select the armory or weaponry shop.

The visibility and semi-selectability has nothing to do with it since they are supposed to be neutral and hidden anyway.
For that you just need to set model of unit to .mdl or _ pressing shift + enter
your only problem will be that you cannot have a shop art on display in game left

if you want it you would have to put YOUR dummy unit in place that will never be visible (in some corner of map......)
than select shop that is in that corner (your own shop that u were talking about) and that order (my dummy unit) to do the same.......

:fp:i think you should just set model file of your dummy unit to ".mdl" or "_" pressing shift+enter
 
Level 2
Joined
Apr 25, 2009
Messages
20
I got an idea.
make a boolean variable and make it start as false.
make a trigger like this

Events:player Selects a Unit
Condition:
Unit is equal to (put your unit here)
(Your Boolean Variable Here)is equal to False
Actions:
Clear selection for Triggering Player

and then another another trigger like this

Event:
(whatever you want to set off the selection of the unit)
Condition:
(whatever you want the conditions to be)
Actions:
Set (your variable here) to True
Select (your unit here) for player (Triggering Player i guesss?, whatever you want to be selected. )

that should work
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
You can make it deselect the unit when you select it.
Its not that easy because the event - unit is selected/deselected SUCKS,it has a delay

however there is a faster way to deselect a unit since the action does not have delay (or any other thing connected to selection)

this is the faster way but it is still not so good ,
-100% sure that player cannot click to do something with unit you deselect
-only problem is that player can see icons of that unit
-its bad if you have to much of this triggers

event - every 0,01 seconds of game
if UNIT is selected by PLAYER X
-clear selection for PLAYER X

but guys.... i wanna know what is the problem with unit that has no model and cannot be selected by player and can with triggers ???
 
Status
Not open for further replies.
Top