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

[Solved] Trigger not functioning

Status
Not open for further replies.
Level 12
Joined
Feb 11, 2008
Messages
809
Okay guys i was testing some new triggers and for some reason im getting a error message when i save my map ill post a picture here and also these 2 lines work but are only for player(0) and i need it to work for every player;

  • call SetCameraUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())], Player(0))
  • call SetMovementUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())],Player(0),5)
Can someone please help me figure out how to fix this?

EDIT*

Also if it helps the event is a player entered chat string event
 

Attachments

  • error.png
    error.png
    737.2 KB · Views: 118
  • error1.png
    error1.png
    737.4 KB · Views: 98
What's this: Player(GetTriggerPlayer())? There's no such thing as this, either it will be GetTriggerPlayer() or a conversion of Player(PlayerIndex here) (this is the reason why only player(0) works, because you are passing the parameters correctly). You are attempting to convert a player (GetTriggerPlayer()) in an integer: Player(x), where x is an integer; this is why you get that error message in the first place.
 
Level 12
Joined
Feb 11, 2008
Messages
809
What's this: Player(GetTriggerPlayer())? There's no such thing as this, either it will be GetTriggerPlayer() or a conversion of Player(PlayerIndex here) (this is the reason why only player(0) works, because you are passing the parameters correctly). You are attempting to convert a player (GetTriggerPlayer()) in an integer: Player(x), where x is an integer; this is why you get that error message in the first place.

Okay that makes sense but what would i do to get that to be like player(all players)?

EDIT*

heres whole trigger;


  • Test Trigger
    • Events
      • Player - Player 1 (Red) types a chat message containing -test as An exact match
      • Player - Player 2 (Blue) types a chat message containing -test as An exact match
      • Player - Player 3 (Teal) types a chat message containing -test as An exact match
      • Player - Player 4 (Purple) types a chat message containing -test as An exact match
    • Conditions
    • Actions
      • Unit - Create 1 Goblin Hero for (Triggering player) at (Center of (Playable map area)) facing Default building facing (270.0) degrees
      • Set PlayersHero[(Player number of (Triggering player))] = (Last created unit)
      • Unit - Add Jump to PlayersHero[(Player number of (Triggering player))]
      • Custom script: call SetCameraUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())], Player(0))
      • Custom script: call SetMovementUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())],Player(0),5)
      • Custom script: call HideLifeBar(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())])
      • Selection - Select PlayersHero[(Player number of (Triggering player))] for (Triggering player)
 
Level 9
Joined
Jul 10, 2011
Messages
562
to make it more obvious...

change the following lines:
  • Custom script: call SetCameraUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())], Player(0))
  • Custom script: call SetMovementUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())],Player(0),5)
to:

  • Custom script: call SetCameraUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())], GetTriggerPlayer())
  • Custom script: call SetMovementUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())],GetTriggerPlayer(),5)

its the same Pharaoh_ said but its easier when you can see what to do ;D


oh btw....you know that the last number in SetMovementUnit stand for the animation index of the walk animation and you have to set it depending on the unittype?
 
Level 12
Joined
Feb 11, 2008
Messages
809
to make it more obvious...

change the following lines:
  • Custom script: call SetCameraUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())], Player(0))
  • Custom script: call SetMovementUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())],Player(0),5)
to:

  • Custom script: call SetCameraUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())], GetTriggerPlayer())
  • Custom script: call SetMovementUnit(udg_PlayersHero[GetConvertedPlayerId(GetTriggerPlayer())],GetTriggerPlayer(),5)

its the same Pharaoh_ said but its easier when you can see what to do ;D


oh btw....you know that the last number in SetMovementUnit stand for the animation index of the walk animation and you have to set it depending on the unittype?

Yep everything working great now guys thank you im in the process of switching from GUI to vjass and just doing this to get better at it and understand more.
 
Status
Not open for further replies.
Top