1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Is unit visible to unit

Discussion in 'World Editor Help Zone' started by RG00, Jun 15, 2017.

  1. RG00

    RG00

    Joined:
    Jun 4, 2017
    Messages:
    172
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I need help with an AI trigger. I know there is a condition "Is unit visible to player", but I need if it is visible to the single unit, not the player.
     
  2. UreDe4D

    UreDe4D

    Joined:
    Nov 4, 2006
    Messages:
    1,167
    Resources:
    2
    Maps:
    2
    Resources:
    2
    units are always only visible to the player, not only a sinlge unit, if your unit has detection and you want to check if it's your unit detecting the invisible unit you can add a condition if unit is within range
     
  3. TheLordOfChaos201

    TheLordOfChaos201

    Joined:
    Jul 2, 2011
    Messages:
    1,723
    Resources:
    0
    Resources:
    0
    how close is this invisible unit to your unit

    if you're unit can attack it then you could run an if, 'unit is target of attack' to see if your unit can see it
     
  4. RG00

    RG00

    Joined:
    Jun 4, 2017
    Messages:
    172
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  5. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    807
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    This is more likely due to the wall not actually blocking sight, unless you mean a cliff? In which case I'm not sure. But make sure they actually don't have vision, something could still be providing it.
     
  6. RG00

    RG00

    Joined:
    Jun 4, 2017
    Messages:
    172
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  7. RG00

    RG00

    Joined:
    Jun 4, 2017
    Messages:
    172
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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
     
  8. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    807
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    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.
     
  9. RG00

    RG00

    Joined:
    Jun 4, 2017
    Messages:
    172
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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
     
  10. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    807
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    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.
     
  11. map designer

    map designer

    Joined:
    May 2, 2011
    Messages:
    914
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Does acquisition range be of any help?
     
  12. RG00

    RG00

    Joined:
    Jun 4, 2017
    Messages:
    172
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
    No, because units share vision, not acquisition range.
     
  13. map designer

    map designer

    Joined:
    May 2, 2011
    Messages:
    914
    Resources:
    1
    Maps:
    1
    Resources:
    1
    @RG00 but isnt aquistion range have same value as vision?

    EDIT nvm it actually might only be like that during the night
     
  14. RG00

    RG00

    Joined:
    Jun 4, 2017
    Messages:
    172
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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
     
  15. aple

    aple

    Joined:
    May 20, 2009
    Messages:
    807
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    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.