Whats teh most effiecent and fastest way to make levels in like defense games where all the units die and next level begins?
The creation of the units should be controlled by Death Counters.
Increment the Death Counter by one if no units controlled by the computer player are present in the playing field.
| Trigger |
| Description: |
| Game Start |
|
| Conditions: |
| ¤ BRING: Player brings ≥1 civ to loc(GameStart) |
| Actions: |
| ¤ SET DEATHS: Set Player deaths of Data Disc to 1 |
| Trigger |
| Description: |
| Level 1: Overlord |
|
| Conditions: |
| ¤ DEATHS: Player has suffered the deaths of exactly 1 Data Disc |
| Actions: |
| ¤ Create Overlords. |
| Trigger |
| Description: |
| Checking for Unitsd |
|
| Conditions: |
| ¤ BRING: Computer player brings 0 units to loc(Playfield) |
| Actions: |
¤ Display Level Finish text to user
|
¤ Add score or bonus resources accordingly
|
¤ Wait
|
| ¤ SET DEATHS: Add 1 to Player deaths of Data Disc) |
| Trigger |
| Description: |
| Level 2: Guardian |
|
| Conditions: |
| ¤ DEATHS: Player has suffered the deaths of exactly 2 Data Disc |
| Actions: |
| ¤ Create Guardians. |
And so on...
UED77
It's better to use the Gas counter so players can keep track of the level more easily.
Yeah the gas counter would be the best way to go.

I think anyways.
death counters... . okay. i was thinking about switches, w/e
thanks
Switches are slow and work funny when they overlap (from my experiences anyway).
Death counters are the way to go for damn near everything.
okay wielrd problem
Using gas switches these are my trigs (example)
Accumulate(All Players, Exactly, 1, Gas);
CreateUnit(5, Ultralisk, Enemy-spawn, P8);
Comment("lvl 1");
Bring(P8, Exactly, 0, Men, Anywhere);
SetResources(All Players, Add, 1, Gas);
DisplayText("Level Finsihed", 4);
Wait(10000);
Comment("detect");
Bring(Force1, AtLeast, 1, Hydralisk, Player-Spawn);
SetResources(All Players, Add, 1, Gas);
Comment("game start");
the untis arent spawning and the player gets teh gas! wth
You are using "All Players" for the gas counter. That is a very bad choice. When you add 1 gas to "All players", you are adding 1 gas to each player.
When the trigger checks for All Players having 1 gas, it fails to execute, because "All Players" actually has 8 gas, as each player from P1 to P8 has one.
Use a numbered player instead.
UED77
Death counts are much better, never use something that can be used for a leaderboard for a value that you don't want up there. You don't need a "Current Level" leaderboard so use death counts. UED's original method is the correct answer.
okay. in the trigger that detects if thers enemies left am i suppose to preserve it? its not repeating.
and also in lvl 1 u start with 1 gas. but in lvl 2 u get 3. wtf
and the display message isnt displying either
Bring(P8, Exactly, 0, Men, Anywhere);
Wait(1500);
SetResources(All Players, Add, 1, Gas);
DisplayText("Level Finsihed", 4);
KillUnitAt(All, Hydralisk, Anywhere, All Players);
Wait(5000);
Comment("detect");
WOW r[s]t stop posting noob questions. Before posting read THE TUTORIAL AREA!! goodness
Quasi-StarForge format, don't be confused by SCMDraft2-style separators.
//--------------------------------------------//
If {
Bring(P1,AtLeast,1,Civilian,L-StartGame);
}
Then {
SetDeaths(P8,SetTo,1,Data Disc);
}
//--------------------------------------------//
If {
Deaths(P8,Exactly,1,Data Disc);
}
Then {
CreateUnit(20,Overlord,L-Spawn,P8);
SetSwitch(Sw-RoundInProgress,Set);
}
//--------------------------------------------//
If {
Bring(P8,Exactly,0,AnyUnit,L-PlayField);
Switch(Sw-GameInProgress,Set);
}
Then {
SetSwitch(Sw-RoundInProgress,Clear);
DisplayText("Round completed", 4);
SetDeaths(P8,Add,1,Data Disc);
PreserveTrigger();
}
//--------------------------------------------//
If {
Deaths(P8,Exactly,2,Data Disc);
}
Then {
CreateUnit(20,Devourer,L-Spawn,P8);
SetSwitch(Sw-RoundInProgress,Set);
}
//--------------------------------------------//
These should work now. The switch was included to provide control flow, now that the third trigger is preserved. Sorry about missing that earlier.
As for text not displaying, make sure the trigger with the DisplayText(); in it is run for a human player.
UED77
QUOTE(r[s]t @ Jul 11 2005, 02:04 PM)
death counters... . okay. i was thinking about switches, w/e
thanks
[right][snapback]260238[/snapback][/right]
Just a design note here:
Use switches for things that can only have two possible values and don't necessarily depend on other values (things that might happen out of order). Use death counters for things that have several possible numeric values, like levels.
For example, if you're making an RPG and there's a key the players need to find before they can unlock the door, you should make "Found key" a switch. Set it to true when they've found it.
I for some reason never used deathcounters. I use either score or gas/minerals

For values that you want players to see, use gas, minerals, or score (and put it on the leaderboard). For things that the players shouldn't or don't need to see, use death counters. If you have Starforge or SCMDraft you can use unused units in your death counters so they don't conflict with anything else. You can also rename the unit you're using so you don't forget what you're using it for, which is something you can't do with score/gas/minerals.
Deathcounters are also usefull to create a "current player switch"