Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Who is Current Player in this trigger?
Who is Current Player in this trigger?
Apr 27 2008, 12:25 pm
By: CeR  

Apr 27 2008, 12:25 pm CeR Post #1



I have this trigger:

Quote
Player:
Force 1 (humans players)
Conditions:
Current player Bring at least 1 Zergling to "Teleport 1"
Actions:
Set "Teleport activated"
Preserve
Quote
Players:
Force 1 (humans)
Conditions:
"Teleport Activated" is Set
Random option is A
Actions
Move Zergling from current player from everywhere to "Out 1"
Message, Center view, minimap ping, etc..
Preserve
Quote
Players:
Force 1 (humans)
Conditions:
"Teleport Activated" is Set
Random option is B
Actions
Move Zergling from current player from everywhere to "Out 2"
Message, Center view, minimap ping, etc..
Preserve
etc...

I have 5 differents teleports "in" and 8 teleports "out". Doesn't matter what IN you take, the out will be random.
This trigger is already working in my map, and i've tested it, with more humans players, and it's all cool.

My question is:
How know the 2º Trigger who is "Current Player"?



None.

Apr 27 2008, 12:33 pm CeR Post #2



How know Starcraft who is Current Player?

The trigger is for all the force 1, where are all human players. The condition is only a switch, so i think is impossible to know who is the player in the teleport.
By this point, the trigger should move all zerglings to the teleport out, but...

The trigger only move the zerling of the player is in the Teleport IN!!!! Works fine!!

I want to know why this is happening!



None.

Apr 27 2008, 12:36 pm Kenoli Post #3



Why not do it this way
Quote
Players:
Force 1 (humans)
Conditions:
Current player Bring at least 1 Zergling to "Teleport 1"
Random option is A
Actions:
Move Zergling from current player from everywhere to "Out 1"
Message, Center view, minimap ping, etc..
Preserve
Quote
Players:
Force 1 (humans)
Conditions:
Current player Bring at least 1 Zergling to "Teleport 1"
Random option is B
Actions:
Move Zergling from current player from everywhere to "Out 2"
Message, Center view, minimap ping, etc..
Preserve


"Current Player" refers to the player who owns the trigger.
When you assign a trigger to multiple players, or a force with multiple players on it, you actually get multiple copies of that trigger - one owned by each of the players.

So, in your triggers, when "Player 1's" Zergling enters the location "Player 1's" Zergling gets moved. Etc.



None.

Apr 27 2008, 12:40 pm CeR Post #4



No Kenoli. Doing your way, I have to make 8x5=40 triggers..

My trigger works fine, i've already told.

But i want to know how it works.

For identify current player use the switch? I think the trigger can look for who set the switch... or something else..



None.

Apr 27 2008, 12:48 pm Kenoli Post #5



Oh. I forgot you were talking about having multiple entry and exit locations.

The reason it picks the right player is because of the way the triggers are arranged. After one of the players sets the switch, the same player immediately uses it.



None.

Apr 27 2008, 1:12 pm Falkoner Post #6



Is there an actual problem with the map, or were you just wondering how current player works for future reference?



None.

Apr 27 2008, 1:24 pm Brontobyte Post #7



Quote from Falkoner
Is there an actual problem with the map, or were you just wondering how current player works for future reference?

Current Player = Who ever the trigger is set to be for.

EX:

Setting a trigger to Force 1 effects every player in force 1. Setting to All Players effects every Player.
(NOTE: The player will have to meet all of the conditions of the trigger for it to fire for that Player.)



None.

Apr 27 2008, 6:23 pm DT_Battlekruser Post #8



Quote from Kenoli
Oh. I forgot you were talking about having multiple entry and exit locations.

The reason it picks the right player is because of the way the triggers are arranged. After one of the players sets the switch, the same player immediately uses it.

Kenoli said it. In this case, "current player" is remembered within one execution run of the triggers.

To everyone else: This is not a problem with his map. He has a set a triggers that work, but he thought that they shouldn't.




None.

Apr 27 2008, 7:15 pm Wormer Post #9



CeR, please have a look at the post, where I describe exactly how triggers work: http://www.staredit.net/50794/
Then try to replay in mind the triggers behaviour with that exacly algorithm and you understand what is happening.

EDIT:
Quote
For identify current player use the switch? I think the trigger can look for who set the switch... or something else..
Trigger can't look for who set the switch and anything like that. No magic, just an exact algorithm I've described. That is all. Switches (btw as far as locations) are kind of global variables in oppose to death counters, score, kills and etc. which are local to players.



Some.

Apr 27 2008, 9:49 pm CeR Post #10



DT_Battlekruser, you understand it good.

My question is about this trigger:
Quote
Conditions:
"Teleport Activated" is Set
Random option is B
Actions
Move Zergling from current player from everywhere to "Out 2"
Message, Center view, minimap ping, etc..
Preserve
Is the same trigger for all the players on force 1 (7 humans players). The conditions are only switches, and Wormer said this:
Quote
Trigger can't look for who set the switch and anything like that

SO, I dont know why this system works fine!! I have tried a lot! With 2 players joining a teleport IN position at the same time. Both get different EXT position..



None.

Apr 27 2008, 9:52 pm Wormer Post #11



Two questions:
1. Does these actions "Message, Center view, minimap ping, etc.." include the clear Teleport Activated switch action?
2. Have you looked at the post?



Some.

Apr 27 2008, 10:08 pm CeR Post #12



1.Yes
2.Yes, but is in english and it very hard for me reading tecnic things in english (i'm spanish) so i dont understand a shit.. >_<



None.

Apr 27 2008, 11:39 pm Brontobyte Post #13



Quote from CeR
1.Yes
2.Yes, but is in english and it very hard for me reading tecnic things in english (i'm spanish) so i dont understand a shit.. >_<

Spanish


English


Post has been edited 1 time(s), last time on Apr 27 2008, 11:40 pm by Brontobyte. Reason: Added :bleh: :D



None.

Apr 27 2008, 11:51 pm Falkoner Post #14



Translators are usually quite off the actual translation, especially when talking about technical things like this, but maybe it will help..



None.

Apr 28 2008, 12:32 am rockz Post #15

ᴄʜᴇᴇsᴇ ɪᴛ!

It helps me. It's not always perfect, but I can understand the gist of what a sentence says just by translating it.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Apr 28 2008, 12:35 am NudeRaider Post #16

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

You should understand this explanation better. It's basically what Kenoli, DTBK and Wormer already said, but maybe it helps to use other (simple) words. ;)




Apr 28 2008, 1:50 am DT_Battlekruser Post #17



Quote from Falkoner
Translators are usually quite off the actual translation, especially when talking about technical things like this, but maybe it will help..

Especially when the original English text uses "your" when it should use "you're". COUGH.



The reason the triggers work is because of the odd way in which Current Player functions. In a sense, it does "remember" the previous condition. Your triggers will be executed from first to last for each player, and the floating reference to Current Player will begin as null and only be changed if a condition involving Current Player evaluates to true. Current Player will remain pointing to the executing player unless another condition evaluates to false.

Therefore, your map will be reading your triggers like this (Assume player 1 has a Zergling at teleport, and player 2 does not):
---Execute Triggers for Player 1---
-Condition evaluates to TRUE, Current Player now refers to Player 1
-Action in the next trigger moves all Zergling for Current Player (Player 1)

---Execute Triggers for Player 2---
-Condition evaluates to FALSE, Current Player is now null
-Action in the next trigger does nothing, since it refers to no player.


Remember, a trigger given to a force acts identically to a trigger given to each player of a force, with the small side effect that force triggers are always compiled to the bottom of the trigger list.




None.

Apr 28 2008, 7:45 am NudeRaider Post #18

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from DT_Battlekruser
---Execute Triggers for Player 2---
-Condition evaluates to FALSE, Current Player is now null
-Action in the next trigger does nothing, since it refers to no player.


Remember, a trigger given to a force acts identically to a trigger given to each player of a force, with the small side effect that force triggers are always compiled to the bottom of the trigger list.[/color]
No, the trigger does nothing because its conditions are not met. If the condition were met you would automatically have a current player.
The 'null-theory' may only apply when there's no trigger running at all.

And no, Force triggers are split up, but they are inserted in sorted position - the position you see them when you mark every player/force/all players in scmdraft trigger overview.




Apr 28 2008, 9:27 am DT_Battlekruser Post #19



This trigger has its conditions met whether there was a Zergling on the beacon or not:

Force 1 (humans)
Conditions:
"Teleport Activated" is Set
Random option is A
Actions
Move Zergling from current player from everywhere to "Out 1"
Message, Center view, minimap ping, etc..
Preserve

Unless of course the switch is being set between individual trigger runs per player, which isn't specified in the original problem.




None.

Apr 28 2008, 1:08 pm Kenoli Post #20



Quote
This trigger has its conditions met whether there was a Zergling on the beacon or not
The only way that switch can be set is if a Zergling is in one of the locations.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:30 am]
ClansAreForGays -- When you join a pub lobby because you see 7/8 players, but then realize host is bating you with computers. :flamer: :flamer:
[11:48 pm]
O)FaRTy1billion[MM] -- :wob:
[2024-10-30. : 6:24 pm]
Ultraviolet -- :wob:
[2024-10-29. : 4:33 pm]
Vrael -- :wob:
[2024-10-29. : 1:32 pm]
Zoan -- :wob:
[2024-10-28. : 5:21 pm]
Ultraviolet -- :wob:
[2024-10-27. : 4:34 pm]
jjf28 -- :wob:
[2024-10-27. : 9:01 am]
Zycorax -- :wob:
[2024-10-27. : 3:31 am]
RIVE -- :wob:
[2024-10-26. : 7:12 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Roy