Just a note, the triggering player stops working at the point where I try to implant movement to players.
I changed some of the stuff from triggering player to Owner of UnitTriggering player as shown aswell and that did nothing. What im trying to do is to get all those globals into arrays, Setting player units is as far as im concerned working correctly as testing online is applying cam/unit settings to those individual units. Cam also works as im using default camera set to an array from each player.
well here is a couple things i noticed, events cant have things like "triggering player" because think about it, a player has to trigger it first for the game to know who did it, replace that with the preset "Any Player"
and you see how you used triggering player in a periodic event? you cant do that either, since, well nobody is triggering it, same goes for triggering unit
There's a fundamental misunderstanding of what Triggering Player is. Let's see if we can get rid of that.
Triggering Player (and everything else starting with "Triggering") is a so-called event response. It always refers to the event that started the trigger.
For example when I use "A unit dies" as an event, then Triggering Unit would be the dying unit. If I used "A player enters a chat message" then Triggering Player would be the one entering a chat message. So Triggering Player is always the player who caused the trigger to run.
What you are trying to do is to use Triggering Player in the event itself:
Dialog-AnyDialogitemisusedbyTriggeringPlayer
For a human that event might sound reasonable, but a computer can't understand it. You're telling the computer to run the trigger only when Triggering Player uses a dialog item. But there is no Triggering Player until the trigger is triggered. So the event can never happen, because there never is a Triggering Player before the trigger triggers. And the trigger can't trigger without a Triggering Player. See the problem? :)
The solution would be to use Any Player:
Dialog-AnyDialogitemisusedbyAnyPlayer
This way the computer won't care who pressed the dialog item, the trigger will always trigger. Once the trigger triggers you have a valid Triggering Player. So everything that comes after the event (that means every condition, local variable or action) is allowed to use Triggering Player just fine.
Another important fact is that not every event allows the use of things like Triggering Player:
Timer-Every0.6secondsofgametime
This, for example. You're using this event, and then trying to use Triggering Player in the actions. But who would be the triggering player? It would be the player who triggered the event. But in this case no player has anything to do with this event. Instead it's a Timer that made the event run (so you could use Triggering Timer, but that won't help at all right now).
So I see in this trigger you want actions to happen for all of your four players, right? So you have to use a loop like that:
This way we're first doing all the stuff for player 1, then for player 2 and so on.
The last thing to keep in mind is that Triggering Player (and all other Triggering xxx) is local. That means it can only be used by the trigger that got triggered. Each trigger's Triggering Player can be someone completely different, and you cannot simply access the Triggering Player of trigger A in trigger B.
Hope that helps understanding the problem and finding your errors. If there are problems left after that, ask away.
Hey hey I got it working thanks man, this is exactly what I needed but now I have a few questions. When im setting a global Array for angle, which is a real for 4 players, is using the loop feature and player number the best way to go about handling setting that to the player?
And another question, which i think your touched up on but still leaves me kind of confused. Im setting my players chosen unit to an array, so when I goto issue an order for any player choosing to do an action via array, will the loop number 1 always be player 1s chosen unit from where I picked the class and set them to my (Players_Chosen_Unit 4(unit) array)?
Oh and, Unit - Order Players_Chosen_Unit[(Player Number)] to ( Move targeting ((Position of Players_Chosen_Unit[(Player Number)]) offset by 0.5 towards (Run_Angle[(Player Number)] + 0.1) degrees)) (Replace Existing Orders)
Would be correct? I mean its working for me.. Actually lol nvm, I had an overflow error, which ended up being a Playnumber + 1 i had somewhere, I fixed it.
Thanks again, I think I finally grasp whats going on with this atleast, and how to interact with multiple people.
Hey hey I got it working thanks man, this is exactly what I needed but now I have a few questions. When im setting a global Array for angle, which is a real for 4 players, is using the loop feature and player number the best way to go about handling setting that to the player?
Yea. Or you could set them one by one, but that's unnecessary work, in my opinion.
And another question, which i think your touched up on but still leaves me kind of confused. Im setting my players chosen unit to an array, so when I goto issue an order for any player choosing to do an action via array, will the loop number 1 always be player 1s chosen unit from where I picked the class and set them to my (Players_Chosen_Unit 4(unit) array)?
Yes, Triggering Player is actually an integer. Each player has a number. Player 1 is 1, player 2 is 2 and so on. So when player 4 presses the dialog item, then Triggering Player is 4. And loop number 4 will always access all the values written in index 4 of your array, which is everything related to player 4.
Oh and, Unit - Order Players_Chosen_Unit[(Player Number)] to ( Move targeting ((Position of Players_Chosen_Unit[(Player Number)]) offset by 0.5 towards (Run_Angle[(Player Number)] + 0.1) degrees)) (Replace Existing Orders)
Would be correct? I mean its working for me..
Yea that looks pretty much correct. And the fact that it's working for you indicates that, too ;)
Well heres a weird thing for me... thats going on I just now noticed with debuging on.
The only way this works is through a loop
W_Start
Events
UI - Player Any Player presses Any key Down with shift Allow, control Allow, alt Allow
Local Variables
Player Number = 0 <Integer>
Conditions
Actions
General - For each integer Player Number from 1 to 4 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Key Pressed) == W
Then
Variable - Set W_On[Player Number] = true
Trigger - Turn ThirdPersonCam On
Trigger - Turn Unit_Movement On
Else
But the weird thing for turning things off is working without a loop.
W_End
Events
UI - Player Any Player presses Any key Up with shift Allow, control Allow, alt Allow
Local Variables
Player Number = 0 <Integer>
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Then
Variable - Set W_On[Player Number] = false
Trigger - Turn ThirdPersonCam Off
Trigger - Turn Unit_Movement Off
Else
Dunno what to make up this, considering the fact the first one I posted only works with a loop even if I define W as the key. I guess it might be detecting if the key is pressed, and if its not its automatically marking it false? With this line (Key Pressed) == W
Same goes for the lower trigger (btw, did you forget the Condition in the If-part of the second trigger?).
You only need the loops for the one trigger with the timer event. All other triggers are supposed to do something for a specific player, not for all players at once.
Alright no I dident add that keypressed to the off trigger because like the variable says Key pressed lol.. I dont see Key Unpressed option.@s3rius:
Getting a weird side effect online now too, everything is working but.. If i hit w when the other person is hiting it he stops moving and i start moving and when i release w he can move again.
Hmm not sure what is causing that new issue where i can move as player 1 with W, but it stops player 2 from using w when i use w.. this is unreall... lol@s3rius:
Maybe that's because you turn ThirdPersonCam and Unit_Movement off when a player releases the W key?
If you turn of a trigger it won't work for any player until you activate it again.
If Player 1 and Player 2 both move forward, then player 1 stops - this would probably cause problems to player 2?
Trying to set this up to work for multiplayer and somewhere along the lines im lost. Someone help please =/
Class
Cam
W-on
W-end
Movement
Hopefully someone can lend me a hand
Just a note, the triggering player stops working at the point where I try to implant movement to players.
I changed some of the stuff from triggering player to Owner of UnitTriggering player as shown aswell and that did nothing. What im trying to do is to get all those globals into arrays, Setting player units is as far as im concerned working correctly as testing online is applying cam/unit settings to those individual units. Cam also works as im using default camera set to an array from each player.
Anyone?
So been trying this entire time with multi things, and still no go.. anyone please? lol im banging my head againts the wall.
Hmm still nothing working for me... oh snap
sigh... bump
aww come on.. someone anyone..... uhg i cant sleep untill i get this!@!
@Sumsin: Go
well here is a couple things i noticed, events cant have things like "triggering player" because think about it, a player has to trigger it first for the game to know who did it, replace that with the preset "Any Player"
and you see how you used triggering player in a periodic event? you cant do that either, since, well nobody is triggering it, same goes for triggering unit
if your trying to do WASD movement i recommend just using the library rrowland made, http://forums.sc2mapster.com/development/galaxy-scripting-and-trigger-lib/2626-wasd-library-8-directions/
Id rather just try and get what I have working so I can see what it is im doing wrong, and learn from it.
There's a fundamental misunderstanding of what Triggering Player is. Let's see if we can get rid of that.
Triggering Player (and everything else starting with "Triggering") is a so-called event response. It always refers to the event that started the trigger.
For example when I use "A unit dies" as an event, then Triggering Unit would be the dying unit. If I used "A player enters a chat message" then Triggering Player would be the one entering a chat message. So Triggering Player is always the player who caused the trigger to run.
What you are trying to do is to use Triggering Player in the event itself:
For a human that event might sound reasonable, but a computer can't understand it. You're telling the computer to run the trigger only when Triggering Player uses a dialog item. But there is no Triggering Player until the trigger is triggered. So the event can never happen, because there never is a Triggering Player before the trigger triggers. And the trigger can't trigger without a Triggering Player. See the problem? :)
The solution would be to use Any Player:
This way the computer won't care who pressed the dialog item, the trigger will always trigger. Once the trigger triggers you have a valid Triggering Player. So everything that comes after the event (that means every condition, local variable or action) is allowed to use Triggering Player just fine.
Another important fact is that not every event allows the use of things like Triggering Player:
This, for example. You're using this event, and then trying to use Triggering Player in the actions. But who would be the triggering player? It would be the player who triggered the event. But in this case no player has anything to do with this event. Instead it's a Timer that made the event run (so you could use Triggering Timer, but that won't help at all right now).
So I see in this trigger you want actions to happen for all of your four players, right? So you have to use a loop like that:
This way we're first doing all the stuff for player 1, then for player 2 and so on.
The last thing to keep in mind is that Triggering Player (and all other Triggering xxx) is local. That means it can only be used by the trigger that got triggered. Each trigger's Triggering Player can be someone completely different, and you cannot simply access the Triggering Player of trigger A in trigger B.
Hope that helps understanding the problem and finding your errors. If there are problems left after that, ask away.
Hey hey I got it working thanks man, this is exactly what I needed but now I have a few questions. When im setting a global Array for angle, which is a real for 4 players, is using the loop feature and player number the best way to go about handling setting that to the player?
And another question, which i think your touched up on but still leaves me kind of confused. Im setting my players chosen unit to an array, so when I goto issue an order for any player choosing to do an action via array, will the loop number 1 always be player 1s chosen unit from where I picked the class and set them to my (Players_Chosen_Unit 4(unit) array)?
Oh and, Unit - Order Players_Chosen_Unit[(Player Number)] to ( Move targeting ((Position of Players_Chosen_Unit[(Player Number)]) offset by 0.5 towards (Run_Angle[(Player Number)] + 0.1) degrees)) (Replace Existing Orders)
Would be correct? I mean its working for me.. Actually lol nvm, I had an overflow error, which ended up being a Playnumber + 1 i had somewhere, I fixed it.
Thanks again, I think I finally grasp whats going on with this atleast, and how to interact with multiple people.
Yea. Or you could set them one by one, but that's unnecessary work, in my opinion.
Yes, Triggering Player is actually an integer. Each player has a number. Player 1 is 1, player 2 is 2 and so on. So when player 4 presses the dialog item, then Triggering Player is 4. And loop number 4 will always access all the values written in index 4 of your array, which is everything related to player 4.
Yea that looks pretty much correct. And the fact that it's working for you indicates that, too ;)
Well heres a weird thing for me... thats going on I just now noticed with debuging on.
The only way this works is through a loop
W_Start
Events
UI - Player Any Player presses Any key Down with shift Allow, control Allow, alt Allow
Local Variables
Player Number = 0 <Integer>
Conditions
Actions
General - For each integer Player Number from 1 to 4 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Key Pressed) == W
Then
Variable - Set W_On[Player Number] = true
Trigger - Turn ThirdPersonCam On
Trigger - Turn Unit_Movement On
Else
But the weird thing for turning things off is working without a loop.
W_End
Events
UI - Player Any Player presses Any key Up with shift Allow, control Allow, alt Allow
Local Variables
Player Number = 0 <Integer>
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Then
Variable - Set W_On[Player Number] = false
Trigger - Turn ThirdPersonCam Off
Trigger - Turn Unit_Movement Off
Else
Dunno what to make up this, considering the fact the first one I posted only works with a loop even if I define W as the key. I guess it might be detecting if the key is pressed, and if its not its automatically marking it false? With this line (Key Pressed) == W
Why would you use a loop for that anyway? You can use Triggering Player.
Same goes for the lower trigger (btw, did you forget the Condition in the If-part of the second trigger?).
You only need the loops for the one trigger with the timer event. All other triggers are supposed to do something for a specific player, not for all players at once.
Alright no I dident add that keypressed to the off trigger because like the variable says Key pressed lol.. I dont see Key Unpressed option.@s3rius:
Getting a weird side effect online now too, everything is working but.. If i hit w when the other person is hiting it he stops moving and i start moving and when i release w he can move again.
You can use Key Pressed for both. Sounds a little strange but you basically "press down" and "press up" (release) the keys.
Hmm not sure what is causing that new issue where i can move as player 1 with W, but it stops player 2 from using w when i use w.. this is unreall... lol@s3rius:
Maybe that's because you turn ThirdPersonCam and Unit_Movement off when a player releases the W key?
If you turn of a trigger it won't work for any player until you activate it again.
If Player 1 and Player 2 both move forward, then player 1 stops - this would probably cause problems to player 2?
I tried removing that code from both triggers and its still going on.@s3rius:
Its only letting 1 player use w at a time.. apparently