• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to show a unit to ONLY one player?

Status
Not open for further replies.
Level 13
Joined
Mar 29, 2012
Messages
542
@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: 37

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
1,994
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