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

Is unit visible to unit

Status
Not open for further replies.
Level 6
Joined
Jun 4, 2017
Messages
172
Hi guys, thanks for answering. But however I have no invisible units in my map, I'm trying to make an AI for units who are controlled by player 2 and player 3. This AI make units able to see only what there is in front of them. I use a loop of 1 second for this trigger which check if player 1 unit is in range of 650 of point which I put in front of each unit. The trigger worked fine but I see that units were able to see the unit over the walls too. This is because I search for a condition like "Is unit visible to unit".
Sorry for my bad English.
 
Level 6
Joined
Jun 4, 2017
Messages
172
I use cliff for make walls, however they are able to see player unit over the wall because I used the condition "unit in range", with this condition doesn't matter if the vision is blocked or not, I used the other condition "Is unit visible to player" but if there is some unit of the same player over the wall, they manage to see the player 1 unit. I tried to make a non-shared vision to units of the same player, but it didn't work.
 
Level 6
Joined
Jun 4, 2017
Messages
172
This is my trigger, I've also put the acquisition range of player 2 and player 3 units to 100 at map initialization:

Events:
Time - Every 1.00 seconds of game time;


Conditions:


Actions:
Pick every unit in AI and do (Actions)
Loop - Actions
If(All conditions are True)then do(Then Actions)else do (Else Actions)
If - Conditions
(Player 0001 <gen> is in (Units within 650.00 of ((Position of (Picked unit))offset by 650.00 towards (Facing of (Picked unit)) degrees))) Equal to TRUE;
(Player 0001 <gen> is visible to Player 2 (Blue)) Equal to TRUE;
Then - Actions
Pick every unit in AI and do (Actions)
Loop - Actions
If(All conditions are True)then do(Then Actions)else do (Else Actions)
If - Conditions
(Level of (Picked unit)) Equal to 1;
Then - Actions
Unit - Change ownership of (Picked unit) to Player 3 and keep the color;
Else - Actions
Unit - Set (Picked unit) acquisition range to (Default acquisition range of (Picked unit));
Unit - Order (Picked unit) to Attack Player 0001 <gen>;
Else - Actions




The AI unit group is player 2 units
 
Level 12
Joined
May 20, 2009
Messages
822
I used the other condition "Is unit visible to player" but if there is some unit of the same player over the wall, they manage to see the player 1 unit. I tried to make a non-shared vision to units of the same player, but it didn't work.

This is suppose to happen. If they have vision up on the cliff then they can attack something up the cliff from at the bottom of the cliff. This is normal WC3 behavior.
 
Level 6
Joined
Jun 4, 2017
Messages
172
This is suppose to happen. If they have vision up on the cliff then they can attack something up the cliff from at the bottom of the cliff. This is normal WC3 behavior.
It's ok that the unit over the wall will attack the player but what I want is the unit from the other side of the wall doesn't see and attack the hero just because his ally can see him. What I'm trying to make is units don't share vision even if they are in the same player
 
Level 6
Joined
Jun 4, 2017
Messages
172
That just cannot be done without a massive system to rework how vision works and that's really difficult to do because it can cause a lot of lag.
I see. Maybe make a player own only one unit could solve this problem but there aren't a lot of players, so can we create new player groups? Like, for example, creating player 13, 14 and so on.
Does acquisition range be of any help?
No, because units share vision, not acquisition range.
 
Level 12
Joined
May 20, 2009
Messages
822
I don't think so, acquisition range in most of the case is lower than vision, acquisition range is the range where unit will automatically attack enemy, vision is...the vision XD

Acquisition Range actually fucntions as a soft cap for normal range, too. If Acquisition Range is less than the weapon's actual range it will use the Acquisition range for the range instead. Even if you directly manually target a unit. (I'm pretty sure, anyway. I remember having problems with Acquisition Range a while ago causing this but I may be remembering it wrong). Acquisition Range can also be modified via triggers per unit.
 
Status
Not open for further replies.
Top