Fixing Points

Level 17
Joined
Jun 17, 2010
Messages
2,275
I remember being told the answer to this once a long time ago, but i forgot it, whats the name in custom script to fix a point with an array ((Player number of (owner of (triggering unit))
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
Well ill be using the gui so it can look like this

  • Custom script: call RemoveLocation(udg_Point[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])
like that? or does it not work with that function?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Pharaoh_ was directing you to shorten your code from GetOwningPlayer(GetTriggerUnit()) -> GetTriggerPlayer(), it calls 1 function instead of 2.

In your post #5, you used (Triggering unit) there, that's why Pharaoh_ was directing you to just use GetTriggerPlayer(), it is basically the same.
But if that trigger is meant for (Attacking unit) or something, it cannot use GetTriggerPlayer() as the reference is misleading.

And why did you showed that event ?

Is there something you wanted to say, in a sarcastic way or something @[email protected]"

Be clear.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
InfinateAnswers said:
well get trigger player.... there is no triggering player.. its a triggering unit...

Look at it this way: if the triggering unit is owned by a player and you want to know which player that is, then shouldn't triggering player referr to the player owning the triggering unit?
In other words: it should work...
And not to mention it speeds up your trigger since less function calls are being used to get the player.
 
  • Test
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (Name of (Triggering player))
      • Game - Display to (All players) the text: (Name of (Triggering unit))
This will display both player name and unit name correctly.
  • Test
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (Name of (Triggering player))
      • Game - Display to (All players) the text: (Name of (Triggering unit))
This won't.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Its never worked for me before so i assumed it wouldnt work for me now. Only time triggering player has worked for me is with a Player event.

You should try it, now and yes, I'm insist.
A good example is to test out Kobas trigger example.

In the first trigger, 2 message will appear on your screen (your name)

In the second trigger, only one message will appear because (Triggering player) does not work for Unit - Enters Region event.
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
Well thats an interesting statement because now that i think about it, i have only used Unit - Enters region when i came to the false conclusion that triggering player doesn't work. And then once i became more accustomed to more advanced triggers i had that mind set planted.
 
Top