Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Syntax for hypertriggers/deathcounters
Syntax for hypertriggers/deathcounters
Dec 29 2008, 4:06 pm
By: MrWallet  

Dec 29 2008, 4:06 pm MrWallet Post #1



Hi,

So I know how to use hyper triggers and death counts. I've already made a test run map and it works fine.

The problem is, in my bound... it seems very un-efficient.
Ex:
Code
Condition:
If Level 1 switch is set
If Death count of X is #

Actions:
Create 1 archon at location
Kill All units for all players at location


And of course, I have the hyper triggers and the death count with
Code
If < 1 deaths, set to #

Code
If >= 1 deaths, subtract 1



====================
Problem
====================

My problem is, people usually make one long ass list like:
- Actions at square 1
- wait #
- Actions at square 2
- wait #
preserve

Now because I use death counters, I avoided it by making tons of triggers, example:
-If level 1 is switched on
-If death count is at X
Then:
- Create 1 archon, and blow the shit out of everything in that square

I proceed to make a new trigger, totally independant:
-If level 1 is switched on
-If death count is at Y (Y is less than X for clarification)
Then:
- Create 1 archon, and blow the shit out of everything in that square


My problem is I'm going to end up with a ton of various trigger commands.
If you remember the one with waits, it was all compact and nice, but with mine... there will be at least 10+ triggers per round. If I'm going to have a hypothetical 15-20 rounds, thats 150-200 triggers, and probably even more (since I like complicated things). My question is, does anyone know a way to compact my code more effectively? I can't put waits in between, but I don't know how to utilize death counters to make my code more compact and/or use less triggers.
If that is not clear, I'm sorry and I will try to make it more clear. Thanks.



None.

Dec 29 2008, 4:12 pm Biophysicist Post #2



What exactly is the problem? Death count waits are almost as easy to do as normal waits... There's nothing you can really do to make it more compact, though.

Oh, one trick I've found to make them somewhat easier is to have a trigger that adds 1 to a DC if the DC is at least 1. Then you can start your countdown simply by setting the DC to 1.

You might be able to use the countdown timer, depending on the specifics of your map.

(If you want me to look over your code, PM me the map, and I might be able to offer some more advice.)



None.

Dec 29 2008, 4:22 pm MrWallet Post #3



Quote from name:TassadarZeratul
What exactly is the problem? Death count waits are almost as easy to do as normal waits... There's nothing you can really do to make it more compact, though.

Oh, one trick I've found to make them somewhat easier is to have a trigger that adds 1 to a DC if the DC is at least 1. Then you can start your countdown simply by setting the DC to 1.

You might be able to use the countdown timer, depending on the specifics of your map.

(If you want me to look over your code, PM me the map, and I might be able to offer some more advice.)

What my goal was to do, is to try and compress the 'current round' triggers into one long trigger.

I want to turn this:
Code
If round 1 set, at X kills
Then create/kill at square 1
Code
If round 1 set, at Y kills
Then create/kill at square 2
Code
If round 1 set, at Z kills
Then create/kill at square 3
Code
If round 1 set, at A kills
Then create/kill at square 4
Code
If round 1 set, at B kills
Then create/kill at square 5


Into maybe something like this?
Code
If round 1 set, at X kills
Then:
create/kill at square 1
(whatever would replace a wait here, or when lets say 5 death counts pass)
create/kill at square 2
(more death counts pass)
create/kill at square 3
(more death counts pass)
create/kill at square 4
(more death counts pass)
create/kill at square 5

^^ Is all in one specific trigger


See how its all compacted into one trigger instead of a huge pile of triggers? Is there any way to compact death count triggers like that, or am I stuck doing tons of them?



None.

Dec 29 2008, 4:26 pm badcop Post #4



Couldn't you add death counts for waits?



None.

Dec 29 2008, 4:29 pm MrWallet Post #5



Quote from badcop
Couldn't you add death counts for waits?

But, how would one do that?
Could you post some example code if you know how :)



None.

Dec 29 2008, 4:55 pm badcop Post #6



It would take up trigger space, but just have one action for each DC add.



None.

Dec 29 2008, 5:02 pm NudeRaider Post #7

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

OK wallet, forget all the answers that were posted before.
What you want is not possible.
Bounds are the few exceptions where I'd recommend waits over death counters simply because timing it with dcs is overly complicated.
The way you showed with dcs would be the way to go, there is unfortunately no shorter way.
Besides, you can time delays in 42ms increments when you use waits, while death counters have only 84ms accuracy (on fastest). This might be important for bounds too, but especially for music loops.




Dec 29 2008, 5:07 pm badcop Post #8



:O I didn't know he was making a bound.



None.

Dec 29 2008, 5:10 pm MrWallet Post #9



Quote from NudeRaider
OK wallet, forget all the answers that were posted before.
What you want is not possible.
Bounds are the few exceptions where I'd recommend waits over death counters simply because timing it with dcs is overly complicated.
The way you showed with dcs would be the way to go, there is unfortunately no shorter way.
Besides, you can time delays in 42ms increments when you use waits, while death counters have only 84ms accuracy (on fastest). This might be important for bounds too, but especially for music loops.
Ah I see, thanks.

So waits would be the best? When you say 42ms increments, is there something about (less than 42 ms) that causes bugs?
I'm just worried about waits because I remember when I was making one game, the waits could vary depending on background action. With DC's, I know that everything feels much more solid and, well... more static than dynamic (variation). I went with DC because in one bound I made long ago, by the 5th around, there was some variation in time between waits. I don't know what caused it, but I thought that a death count would remove the error associated with waits.
Might have been a coding error though, but I'll try with waits now :)



None.

Dec 29 2008, 5:10 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

Quote from badcop
:O I didn't know he was making a bound.
Then you should probably read the starting post before replying.

EDIT:
Quote from MrWallet
Ah I see, thanks.

So waits would be the best? When you say 42ms increments, is there something about (less than 42 ms) that causes bugs?
I'm just worried about waits because I remember when I was making one game, the waits could vary depending on background action. With DC's, I know that everything feels much more solid and, well... more static than dynamic (variation). I went with DC because in one bound I made long ago, by the 5th around, there was some variation in time between waits. I don't know what caused it, but I thought that a death count would remove the error associated with waits.
Might have been a coding error though, but I'll try with waits now :)
Well either in that map you had no hyper triggers, or you ran into wait blocks.
Without hypers one trigger would run fine, but a possible follow up trigger or the rerun of this trigger will be delayed because normally triggers are only checked every 2 seconds

Wait values not exactly hitting a 42ms increment will be rounded. The smallest delay is not 0, but 42ms. Well except the rounding there's no bugs.

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




Dec 29 2008, 5:42 pm Falkoner Post #11



If you're planning on using waits in your bound, just don't use Hyper Triggers altogether, in fact, as Nude said, in a bound, the extra 42 milliseconds of precision are extremely necessary and it's just easier to make triggers with waits anyway.

So you can completely delete your hypertriggers, or just move them to the bottom of the trigger list, so that they turn off when any other waits run.

The only problem with using Waits in a bound, is that once a player beats the bound, it does not stop until the entire trigger has run, with death counts you can stop it as soon as the player beats it, so it's your choice there.



None.

Dec 29 2008, 10:05 pm MrWallet Post #12



Do you know of any way around the waits towards the end of the list?

By my "third" section of testing, there is always this long delay after the trigger completes. It literally adds on what is close to 1000 ms wait. Is there any way around that?
Could I possibly set a switch on a hypertrigger to by-pass everything fast?



None.

Dec 29 2008, 10:40 pm NudeRaider Post #13

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

Well, as I said. Triggers are checked every 2s. If your trigger ends 1s before the next loop then you will have 1s delay until it refires.
The only way around it is hyper triggers.
Btw. hyper triggers and waits are not mutually exclusive like Falk suggested. But you have know how to set the hyper triggers up.
In a bound you usually don't have that many players, so the easiest way would be to set 2 computer players. One owning the bound waits, the other owning the hyper triggers (they don't have to run under all player, but will speed up everyone's triggers).
Then you can still have waits for the players for transmissions or music.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:30 am]
NudeRaider -- I would like 3000 minerals, please
[07:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[2026-4-16. : 4:15 am]
DarkenedFantasies -- you eat lots of beans
[2026-4-16. : 3:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
Please log in to shout.


Members Online: Roy