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

How to show a unit to ONLY one player?

Status
Not open for further replies.
Level 13
Joined
Mar 29, 2012
Messages
530
@Maker
How?
This is what i did when testing :
  • Init
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Unit - Create 1 Locust for Player 1 (Red) at (Point(100.00, 0.00)) facing Default building facing degrees
      • Set Unit[1] = (Last created unit)
      • Unit - Create 1 Locust for Player 2 (Blue) at (Point(-100.00, 0.00)) facing Default building facing degrees
      • Set Unit[2] = (Last created unit)
  • Order
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
    • Actions
      • Custom script: call IssueImmediateOrder(udg_Unit[2], "channel")
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • Game - Display to (All players) the text: casted
      • Set Player = (Triggering player)
      • Set Alpha = 100.00
      • Custom script: if udg_Player == Player(1) then
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set Alpha = 0.00
      • Custom script: endif
      • Custom script: endif
      • Animation - Change Unit[2]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Alpha% transparency
Download the map for more clear...
 

Attachments

  • Single Unit Visibility.w3x
    16.7 KB · Views: 36

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
It should be like this:
  • Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • Game - Display to (All players) the text: casted
      • Set Player = (Triggering player)
      • Set Alpha = 100.00
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Set Alpha = 0.00
      • Custom script: endif
      • Animation - Change Unit[2]'s vertex coloring to (100.00%, 100.00%, 100.00%) with Alpha% transparency
And coordinates don't leak... they are real numbers.
 
Status
Not open for further replies.
Top