Switches
Jan 12 2009, 10:51 pm
By: alexpnd  

Jan 12 2009, 10:51 pm alexpnd Post #1



Hey i need to know the program flow here and if I can use just a global switch for all players instead of 6 different ones for each 6 players. Lets say player1 goes to Location1 and i fire off a switch saying, PickupPowerUp, and this in turn sets off another trigger that gives the bonus to the current player. So this affects Player 1 lets say. Can I use that same PickupPowerUp switch for all players? ie. copy and paste player1's triggers without worrying about the switch doing funny things to the other players triggers.



None.

Jan 12 2009, 10:54 pm Vrael Post #2



Switch Link:
http://www.staredit.net/maplantis/index.php?sid=d9139b5027;wiki=27

If
"Switch 1 is Set"
is the only condition for the action which gives a bonus, then it will give the bonus to all players that are listed in the trigger

Example:
Players: Force 1
Conditions: Switch 1 is Set
Actions: Add 40 Minerals for Current Player

Will add 40 minerals to each player in force 1.



None.

Jan 12 2009, 10:54 pm badcop Post #3



You'd have to copy it for each person since switches are global, if I'm correct.



None.

Jan 12 2009, 10:59 pm Vrael Post #4



Quote from badcop
You'd have to copy it for each person since switches are global, if I'm correct.

Depends on the phrasing of the conditions and players. If the trigger is

Players: Player 1
Conditions: Switch X is set
Actions: GIve bonus to current player

Then you'd need to copy it for each player. But if you use a Force, or simply do

Players: Player 1, 2, 3, 4, ect
Conditions: Switch X is set
Actions: GIve bonus to current player

Then it will run once for each player listed for, and each player will recieve the bonus.



None.

Jan 12 2009, 11:00 pm Doodle77 Post #5



Use a death count instead of a switch if you want to be able to use "Current Player"



None.

Jan 12 2009, 11:02 pm alexpnd Post #6



Players: Player1
Conditions: Bring to Location
Actions: Switch X is set

Players: Player 1
Conditions: Switch X is set
Actions: GIve bonus to current player

Sequential like that. Can I use that and just copy and paste? I dont want to use more switches.



None.

Jan 12 2009, 11:08 pm Biophysicist Post #7



Why not just do Current Player brings <whateve> to <location>: Give bonus to current player?



None.

Jan 12 2009, 11:11 pm alexpnd Post #8



cause i like to break it up into bits so i can elaborate on the next trigger with other death count options etc. makes it neater imo.



None.

Jan 12 2009, 11:13 pm Biophysicist Post #9



But it increases the filesize and makes editing the triggers harder. Switches use strings, btw, so using pointless switches makes things harder.



None.

Jan 12 2009, 11:20 pm NudeRaider Post #10

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

Yeah, the best solution is just to use bring.

If you really want to be able to modify it in some way (e.g. player level is at most 1 => clear switch) then I recommend death counters. Each player has its own count and can have more values than just 0 and 1.

But if you insist on the switch then it causes no trouble as long as you use it in conjunction with the bring.
Just make sure that when 2 players are in the location that not one player clears the switch for the other player, thus preventing him from getting the reward.




Jan 12 2009, 11:25 pm alexpnd Post #11



Ok. I'll use bring. even though it clutters up the conditions when i have 2x4 other conditions. Location left and Location Right. as well as Item 1-4. Any suggestion with this type of idea? Its a powerup that appears randomly at the left or right location, as well as being a random powerup from 4 types.

EDIT:
Oh yeah and I thought the triggers fired in succession but I guess starcraft just reads them while the game is running solely by their conditions and not position within the trigger window.

Post has been edited 1 time(s), last time on Jan 13 2009, 12:48 am by NudeRaider. Reason: merged posts



None.

Jan 13 2009, 12:46 am Roy Post #12

An artist's depiction of an Extended Unit Death

There are too many things posted that are slightly off-center here so I'll just address the last post.

Starcraft reads triggers from players 1-8 (regardless of if you choose "Force" or "All Players," it runs starting with Player 1) top-to-bottom. If the conditions are not met, it skips it and reads the next trigger.




Jan 13 2009, 1:09 am Falkoner Post #13



Unless something is globally the same for all players, I would highly recommend using Death Counts instead, however, if there is something that is the same for all the players, in other words, global, then use Switches.

I would recommend the Single Switch Randomization method, as it is much easier to write triggers for, takes less switches, and if you ever plan on doing randomization for more than 4 things it's much easier to work with.



None.

Jan 13 2009, 6:26 am alexpnd Post #14



Thanks guys. I'll take a look at that single switch randomization. Thanks for the merge nuderaider i couldnt find the edit button. What i do for "randomization" is a kill counter that includes all the players kills. so for the left and right death counter i reset it after a new 2 kills etc.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
[10:01 pm]
Vrael -- Alright fucks its time for cake and violence
[2024-5-07. : 7:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
Please log in to shout.


Members Online: Roy, DiearAnother