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 28 2008, 3:35 pm NudeRaider Post #21

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

What are you trying to explain with this statement?
Quote from DT_Battlekruser
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.
And, yes Kenoli, if we assume that after the first time a ling got teleported the switch had been reset.




Apr 28 2008, 8:50 pm CeR Post #22



I only created this topic because i had found a new trigger and CP use/configuration/operation..
But if you anybody know this fact, for me a strange fact, there is no problem.

I do the trigger secuence without thinking so much about this at all. The trigger have been working for weeks.. and when i have checked all the map looking for bugs, i stop watching the trigger.. And I dot understand how works its fine.

I give more details:

The random sys isn't a randomization system propely. I change fast a unit in a location like this: [Unit 1, Unit 2, Unit 3, Unit 4....Unit 8, repeat] in a chain of triggers and switches. One unit dont stay more tan 0'5s in the location, so it's impossble to predict nothing.. (so it is OK like randomization system for me)

I have this triggers: (comments)
[Teleport IN 1]
[Teleport IN 2]
[Teleport IN 3]
....
[Teleport IN 7]

All these trigger ar the same, and only change the bring location in the condition. They set the same swith, called "teleport".

And them, this others: (comments)
[Teleport RANDOM OUT 1]
[Teleport RANDOM OUT 2]
[Teleport RANDOM OUT 3]
...
[Teleport RANDOM OUT 8]

This trigger is what i've told in other posts. Detailed:

Quote
Players:
Force 1 (humans players)
Conditions:
"Teleport" is set
P8 bring at least one unit 1 to... (Random option 1)
Actions:
Clear "Telepor"
Center view 4 current player at "Teleport out 1"
Move zergling for current player from everywhere to "Teleport out 1"
Show minimap ping at "Teleport out 1"
Display 4 current player "You have been teleported randomly!"
Preserve trigger
Coment




None.

Apr 28 2008, 9:41 pm rockz Post #23

ᴄʜᴇᴇsᴇ ɪᴛ!

From what I gather from that trigger, When teleport is set, all of force 1 teleports to a random out location. They all teleport to that same location, and they all get the message "You have been teleported randomly!"

Honestly, I don't see what is so groundbreaking. Did you not know that you could use Force 1 as an owner? If you set the owner to each individual player under force 1, it would work the same.



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

Apr 28 2008, 10:15 pm CeR Post #24



More simple:

Who's Current Player in this trigger? How know starcraft who is current player here?
Quote
Players:
Force 1 (humans players)
Conditions:
"Teleport" is set
P8 bring at least one unit 1 to... (Random option 1)
Actions:
Clear "Telepor"
Center view 4 current player at "Teleport out 1"
Move zergling for current player from everywhere to "Teleport out 1"
Show minimap ping at "Teleport out 1"
Display 4 current player "You have been teleported randomly!"
Preserve trigger
Coment

And i sai. If one player use this trigger, other players in the same force don't get the msg, and dont get minimap ping.., etc...



None.

Apr 29 2008, 1:16 am rockz Post #25

ᴄʜᴇᴇsᴇ ɪᴛ!

oh, I thought it was working...

Current player is the player who executes the trigger (someone on force 1). In this case, the first player in force 1 will always get it. Since you clear teleport, it will only work for 1 player. make a trigger that says
Players:
Player 8
Conditions:
"Teleport" is set
Actions:
Clear "Teleport"

and delete the "clear teleport" action in your trigger.



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

Apr 29 2008, 6:46 am NudeRaider Post #26

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

If you had carefully read what we wrote, you could explain yourself.

First thing sc does is splitting up the triggers: (Lets say Force 1 is P1-3)

Players:
Player 1
Conditions:
"Teleport" is set
P8 bring at least one unit 1 to... (Random option 1)
Actions:
Clear "Teleport"
Center view 4 current player (=P1 !!) at "Teleport out 1"
Move zergling for current player (=P1 !!) from everywhere to "Teleport out 1"
Show minimap ping at "Teleport out 1"
Display 4 current player (=P1 !!) "You have been teleported randomly!"
Preserve trigger
Comment

Players:
Player 2
Conditions:
"Teleport" is set
P8 bring at least one unit 1 to... (Random option 1)
Actions:
Clear "Teleport"
Center view 4 current player (=P2 !!) at "Teleport out 1"
Move zergling for current player (=P2 !!) from everywhere to "Teleport out 1"
Show minimap ping at "Teleport out 1"
Display 4 current player (=P2 !!) "You have been teleported randomly!"
Preserve trigger
Comment

Players:
Player 3
Conditions:
"Teleport" is set
P8 bring at least one unit 1 to... (Random option 1)
Actions:
Clear "Teleport"
Center view 4 current player (=P3 !!) at "Teleport out 1"
Move zergling for current player (=P3 !!) from everywhere to "Teleport out 1"
Show minimap ping at "Teleport out 1"
Display 4 current player (=P3 !!) "You have been teleported randomly!"
Preserve trigger
Comment

As you can see SC copies the trigger and every copy has only ONE owner, thus current player MUST refer to this same player.
The only thing you have to keep in mind is, if Player 1 has other triggers those will run BEFORE the copies for P2 and P3 will run, because triggers are checked player-by-player.




Apr 29 2008, 11:09 am CeR Post #27



Anybody understand me?

THE SYSTEMS IS WORKING FINE, THE SYSTEMS IS GOOD.

OK NudeRider. BUT If current player is P1, because the triggers of p1 is checked first, P1 will be the only capable of "feel" the actions of the triggers. Because when the check arrives P2's triggers, the swith "teleport" will be already cleared.

If player 4 SET the Switch, the conditions for the trigger of P1 are OK, for P2, are OK, for all Players are OK, SO ¿Why only this trigger run for the player who activated the Switch in another trigger?

I understand what means Current Players, I understand what means put a trigger owned by a force or each player of the force

So i only dont understand why this system works fine.



None.

Apr 29 2008, 11:53 am Ahli Post #28

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

The system works because one player after another executes all his Force1-triggers.
The player who activates the switch will deactivate the switch before another player's trigger will be checked.

I'm not totally sure about that because I already had some problems with that when I randomized switches.
But it works perfectly in other cases like hero locations. You can check the area around a hero for each player with only 1 location.
e.g.:
Trigger owner:
-Force 1
______________________________________________________
C: -always
A: -center location on hero unit owned by current player ; preserve trigger
______________________________________________________
C: -neutral brings at least 1 academy to location
A: -set hitpoints of hero unit in location to 100% ; preserve trigger
______________________________________________________

Each player will heal his hero, if he moves his hero to neutral's academy.




Apr 29 2008, 4:14 pm NudeRaider Post #29

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 CeR
Anybody understand me?

THE SYSTEMS IS WORKING FINE, THE SYSTEMS IS GOOD.
*sigh* We PERFECTLY understand that part. No need to repeat this EVERY post.

Quote from CeR
OK NudeRider. BUT If current player is P1, because the triggers of p1 is checked first, P1 will be the only capable of "feel" the actions of the triggers. Because when the check arrives P2's triggers, the swith "teleport" will be already cleared.

If player 4 SET the Switch, the conditions for the trigger of P1 are OK, for P2, are OK, for all Players are OK, SO ¿Why only this trigger run for the player who activated the Switch in another trigger?
Ahli said it, even YOU said it: The switch is cleared before another player has the chance to run his copy of the trigger (remember, SC CREATES COPIES OF THE TRIGGERS WHEN THE GAME STARTS WHEN A TRIGGER IS OWNED BY A FORCE).

Quote from CeR
I understand what means Current Players, I understand what means put a trigger owned by a force or each player of the force
Maybe you don't understand the ingame mechanics: The triggers are checked player-by-player. That means, P4 can run a trigger owned by the whole force, but in this same trigger he makes the condition(s) untrue (e.g. by clearing a switch). So the other players, whose triggers are executed later, maybe in another trigger loop, DON'T have the condition true anymore and won't run (EVEN WHEN YOU LET IT BE OWNED BY THE WHOLE FORCE!).

Quote from CeR
So i only dont understand why this system works fine.
We already explained quite detailed why it works, but you don't seem to accept any explanation. (makes me wonder if you understand what you are told)
You should tell us what you would expect to happen exactly. When we know which part you didn't understand we can explain that specifically.

Maybe you learn better through examples. Fictional events and the chain of reactions forced by triggers:
L# = number of trigger Loops that have passed since the event,
P# = number of the current Player,
T# = the active Trigger (1 = check for Zergling and set switch, 2 = check for switch and random A, 2 = check for switch and random B),
C# = the #th Condition is running

Initial state: "Teleport 1" not occupied, Switch "Teleport Activated" is cleared, Random Option is A
Event: P3 brings a Zergling to the beacon at "Teleport 1"

L1, P1, T1, C1: ? P1 brings at least 1 Zergling to "Teleport 1" --> NO, next trigger
L1, P1, T2, C1: ? "Teleport Activated" is set --> NO, next trigger
L1, P1, T3, C1: ? "Teleport Activated" is set --> NO, all triggers for P1 checked --> next Player
L1, P2, T1, C1: ? P2 brings at least 1 Zergling to "Teleport 1" --> NO, next trigger
L1, P2, T2, C1: ? "Teleport Activated" is set --> NO, next trigger
L1, P2, T3, C1: ? "Teleport Activated" is set --> NO, all triggers for P1 checked --> next Player
L1, P3, T1, C1: ? P3 brings at least 1 Zergling to "Teleport 1" --> YES, no other condition --> execute actions:
Change condition state: SET "Teleport Activated"
--> no actions left, next trigger
L1, P3, T2, C1: ? "Teleport Activated" is set --> YES, next condition:
L1, P3, T2, C2: ? Random option is A --> YES, no other condition --> execute actions:
Change condition state: CLEAR "Teleport Activated"
Change condition state: Move Zergling of P3 to Out1

other actions: Message, Center view, minimap ping, etc..
--> no actions left, no triggers left, no players left --> wait for next trigger loop
L2, P1, T1, C1: ? P1 brings at least 1 Zergling to "Teleport 1" --> NO, next trigger
... etc.
Nothing will happen anymore (until the next event).
The 2 orange actions made the conditions untrue until the next player would step upon the beacon at "Teleport 1".

But here's another example (changes to the upper case in green):
Initial state: "Teleport 1" not occupied, Switch "Teleport Activated" is cleared, Random Option is B
Event: P1 brings a Zergling to the beacon at "Teleport 1"

L1, P1, T1, C1: ? P1 brings at least 1 Zergling to "Teleport 1" --> YES, no other condition --> execute actions:
Change condition state: SET "Teleport Activated"
--> no actions left, next trigger
L1, P1, T2, C1: ? "Teleport Activated" is set --> YES, next condition:
L1, P1, T2, C2: ? Random option is A --> NO, next trigger:
L1, P1, T3, C1: ? "Teleport Activated" is set --> YES, next condition:
L1, P1, T3, C2: ? Random option is B --> YES, no other condition --> execute actions:
Change condition state: CLEAR "Teleport Activated"
Change condition state: Move Zergling of P3 to Out1

other actions: Message, Center view, minimap ping, etc..
--> no actions left, no triggers left, next player
L1, P2, T1, C1: ? P1 brings at least 1 Zergling to "Teleport 1" --> NO, next trigger
... etc.
Nothing will happen anymore (until the next event).
You should see that by clearing the switch AND moving the zergling the other players never get any chance to run their triggers because the conditions are made untrue.

I REALLY hope that helps you.......

Post has been edited 1 time(s), last time on Apr 29 2008, 5:08 pm by NudeRaider.




Apr 29 2008, 8:53 pm CeR Post #30



Ok, nothing more.

Thanks all guys for the explanatio, and specially you, NudeRaider..



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:27 pm]
lil-Inferno -- ya
[02:00 pm]
helaf75082 -- Cricket Bats Manufacturer https://www.riogrand.in
[02:00 pm]
helaf75082 -- Cricket Bats Manufacturer https://www.riogrand.in
[01:59 pm]
helaf75082 -- Cricket Bats Manufacturer https://www.riogrand.in
[01:59 pm]
helaf75082 -- Cricket Bats Manufacturer https://www.riogrand.in
[01:59 pm]
helaf75082 -- Cricket Bats Manufacturer https://www.riogrand.in
[01:59 pm]
helaf75082 -- Cricket Bats Manufacturer https://www.riogrand.in
[01:59 pm]
helaf75082 -- Cricket Bats Manufacturer https://www.riogrand.in
[01:58 pm]
helaf75082 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
[01:58 pm]
helaf75082 -- Outdoor gym and fitness equipment manufacturer and suppliers https://mountwoodco.com/outdoorgym-equipment-manufacturer-in-uttar-pradesh.php
Please log in to shout.


Members Online: Excalibur