Staredit Newtork
Community
StarCraft
Games
Site
Favourites
Won't switch who's turn it is., DON'T STEAL MY IDEA

Creator: JB4
Time: Aug 31 2008, 4:35 pm

Post #1     JB4 Aug 31 2008, 4:35 pm

[Avatar]
 offline contact
Ok so I'm working on a turn based map, but it's not quite working right. The way it works, you take your turn moving/building/attacking and then it gives your units to your ally, and gives the next player his ally's units and some gas to move. I was setting up the triggers, so that after the player runs out of moves (gas) it does all this, but instead it glitches out for some reason and doesn't give them their guys. Another thing to note, when I refer to a trigger as a player 4 trigger, player 4 is really player 7. I also can't figure out a way to detect if a player exists or not, except how I did it at the bottom, if there is a better way let me know. Also some of the triggers are a little weird, because I didn't realize that a switch could be set for player 1 but not player 4. etc.


+
My Triggers





EDIT:

WHy didn't any of my coding work? I've got BBCode checked...
This post was edited 2 times, last edit by JB4: Sep 2 2008, 9:36 pm.
Top

Post #2     [Echo]:] Aug 31 2008, 8:14 pm

[Avatar]
[=]:] Inc.
 offline contact
Trigger("All players"){
Conditions:
Always();

Actions:
Comment("Setting Triggers");
Set Switch("1moves horse", clear);
Set Switch("2moves horse", clear);
Set Switch("3moves horse", clear);
Set Switch("4moves horse", clear);
Set Switch("Player 1 turn", set);
Set Switch("Player 2 turn", clear);
Set Switch("Player 3 turn", clear);
Set Switch("Player 4 turn", clear);
Set Switch("1moves normal", set);
Set Switch("2moves normal", set);
Set Switch("3moves normal", set);
Set Switch("4moves normal", set);
Set Switch("player 1 stuff", set);
Set Switch("player 1 money", clear);
Set Switch("player 2 money", clear);
Set Switch("player 3 money", clear);
Set Switch("player 4 money", clear);

That condition isn't fit. Don't use always unless you're making a mass map. You have to use specific conditions to make your triggers work.

Also, I suggest you use death counters because they are better than switches.
(user posted image)
Giants vs Jets : Super Bowl XLIII, Let's Roll NY!

,___,
[=]:]
/)__)
-"--"-
Top

Post #3     JB4 Aug 31 2008, 8:31 pm

[Avatar]
 offline contact
Quote from
That condition isn't fit. Don't use always unless you're making a mass map. You have to use specific conditions to make your triggers work.

Would you rather I use, "elapsed time is atleast 0 seconds?

also i have no clue what you mean with death counters.
Top

Post #4     rockz Aug 31 2008, 8:52 pm

[Avatar]
We are not amused
 offline contact
Trigger("Player 8"){
Conditions:
Always();

Actions:
Comment("Setting Triggers");
Set Deaths("Player 8", "1moves horse", Set To, 0);
Set Deaths("Player 8", "2moves horse", Set To, 0);
Set Deaths("Player 8", "3moves horse", Set To, 0);
Set Deaths("Player 8", "4moves horse", Set To, 0);
Set Deaths("Player 8", "Player 1 turn", Set To, 1);
Set Deaths("Player 8", "Player 2 turn", Set To, 0);
Set Deaths("Player 8", "Player 3 turn", Set To, 0);
Set Deaths("Player 8", "Player 4 turn", Set To, 0);
Set Deaths("Player 8", "1moves normal", Set To, 1);
Set Deaths("Player 8", "2moves normal", Set To, 1);
Set Deaths("Player 8", "3moves normal", Set To, 1);
Set Deaths("Player 8", "4moves normal", Set To, 1);
Set Deaths("Player 8", "player 1 stuff", Set To, 1);
Set Deaths("Player 8", "player 1 money", Set To, 0);
Set Deaths("Player 8", "player 2 money", Set To, 0);
Set Deaths("Player 8", "player 3 money", Set To, 0);
Set Deaths("Player 8", "player 4 money", Set To, 0);

Those would be death counters. replace the name of the unit with just the regular name and you don't have to waste strings on renaming the unused unit. Check the wiki for more.
Of the sparkling wines, the most famous is Perth Pink. This is a bottle with a message in, and the message is 'beware'. This is not a wine for drinking, this is a wine for laying down and avoiding.

Another good fighting wine is Melbourne Old-and-Yellow, which is particularly heavy and should be used only for hand-to-hand combat.
Top

Post #5     NudeRaider Aug 31 2008, 9:25 pm

[Avatar]
Write your own destiny, or else someone will write it for you!
 online contact
Quote from JB4
Ok so I'm working on a turn based map, but it's not quite working right. The way it works, you take your turn moving/building/attacking and then it gives your units to your ally, and gives the next player his ally's units and some gas to move. I was setting up the triggers, so that after the player runs out of moves (gas) it does all this, but instead it glitches out for some reason and doesn't give them their guys. Another thing to note, when I refer to a trigger as a player 4 trigger, player 4 is really player 7. I also can't figure out a way to detect if a player exists or not, except how I did it at the bottom, if there is a better way let me know. Also some of the triggers are a little weird, because I didn't realize that a switch could be set for player 1 but not player 4. etc.


+
Collapse Box

For long quoted text pls use the collaps box (like I did) to make your topic easier to read

Also it's a bit much of triggers to go through without any explanation what the triggers are doing.
So I will just give you general answers instead of correcting your triggers.

First of all you should read the wiki and learn how to use Death Counters.
They are invaluable for turn based maps (and any other). Until you've read it, consider death counters to be variables that can be subtracted from, added to or be set. Their value cannot fall below 0 and the maximum exceeds everything you'll ever need.

The trigger that gives the gas and units should look like this: ('my turn' is a death counter variable)

Force 1
Conditions:

Force 1 has suffered at most 0 deaths of 'my turn'
Current Player has gathered at most 0 gas
Actions:
Set deaths of 'my turn' to 1 for Current Player
Set Gas for Current Player to x
Give All units of Force 1 at Anywhere to Current Player
<other actions>
Preserve Trigger


Then the trigger that ends the Current Player's turn: (order is important!)

Force 1
Conditions:

Current Player has suffered at least 1 deaths of 'my turn'
Current Player has gathered at most 0 gas
Actions:
Set deaths of 'my turn' to 0 for Current Player
Preserve Trigger

These 2 triggers simply pass on a "token" which is cleared by Current Player when the gas is depleted.
Triggers are checked player by player, so the next player of that force will now "grab the token" and give all units from the other force members to himself.

To detect if a player is there it's best you preplace a unit for him, create a unit for Current Player, or set a death counter for Current Player and check if it has been placed/set. But my triggers don't need a seperate check for present players, they adapt to the number of players automatically. But be aware that when the active player leaves his units are given to P12, thus screwing the whole system. This problem can be avoided, but I suggest you first set up the basics before we move on. Just tell us when you're ready for the next step. ;)

Also, switches are global. When any player sets a switch, then any other player will detect it as set too.
That's why you should use death counters instead, because every player has his own count.
(signature image)
http://sonsofwar.pyrom.net/index.html___0% (user posted image) 100%
Top

Post #6     Brontobyte Aug 31 2008, 11:15 pm

[Avatar]
 offline contact
Quote from [Echo]:]
Also, I suggest you use death counters because they are better than switches.

Switches are for Global events and obviously for on/off type settings. Death Counters are more for keeping track of values, and or more player specific data.
╔═══╦═══╦═══╦══╦═╦═══╦═══╦═══╦═╦═╦═══╦═══╗
╠═══╣....═╣............╠╗..╔╣....╠═══╬╗..╔╩╗..╔╬═══╣
╚═══╩═╩═╩═══╩═╩══╩╩═╩╩═══╩═══╩╩═╩═╩═╩╩═══╝
Top

Post #7     JB4 Sep 2 2008, 3:55 am

[Avatar]
 offline contact