• 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.

Player na

Status
Not open for further replies.

xplicitjohn

X

xplicitjohn

Ok so light blue builds a tower with spells that other plAyers Can use but when another player uses a spell I want a message appear and say

"__________ has casted a spell from light blues tower."

How do I make the trigger say the players name?
 

xplicitjohn

X

xplicitjohn

  • Actions
    • -------- Use Concactenate Strings --------
    • Game - Display to (All players) the text: (((Name of (Owner of (Triggering unit))) + ) + has casted a spell from light blues tower)



That shows light blue's name not the player who casted it
 
Level 5
Joined
Jan 4, 2007
Messages
103
You could however set up a variable whenever a player selects the unit and then when the unit casts the ability, the last one to select him, if it's not light blue, wiill show it's name in the text. It could bug a bit if another player selects the unit before the first player casts the ability but.:) Here:

  • Events
    • Player - Player 1 (Red) Selects a unit
    • Player - Player 3 (Teal) Selects a unit
    • Player - Player 4 (Purple) Selects a unit
    • Ect.
  • Conditions
    • (Triggering unit) Equal to (Your Unit)
  • Actions
    • Set PlayerName = (Name of (Triggering player))
and this one:

  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Your Spell
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • PlayerName Not equal to (Name of Player 10 (Light Blue))
      • Then - Actions
        • Game - Display to (All players) the text: (PlayerName + has casted a spell from light blue's Tower.)
      • Else - Actions
        • Do nothing
Hope it helps:)
 
You could however set up a variable whenever a player selects the unit and then when the unit casts the ability, the last one to select him, if it's not light blue, wiill show it's name in the text. It could bug a bit if another player selects the unit before the first player casts the ability but.:) Here:

  • Events
    • Player - Player 1 (Red) Selects a unit
    • Player - Player 3 (Teal) Selects a unit
    • Player - Player 4 (Purple) Selects a unit
    • Ect.
  • Conditions
    • (Triggering unit) Equal to (Your Unit)
  • Actions
    • Set PlayerName = (Name of (Triggering player))
and this one:

  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Your Spell
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • PlayerName Not equal to (Name of Player 10 (Light Blue))
      • Then - Actions
        • Game - Display to (All players) the text: (PlayerName + has casted a spell from light blue's Tower.)
      • Else - Actions
        • Do nothing
Hope it helps:)

Still, if Player 1 (Red) selects the building and after some seconds Player 4 (Yellow) also selects it, but Red doesn't have it deselected, and the ability is cast, then you still can't know which player fired the ability.
 
Status
Not open for further replies.
Top