Staredit Network

Staredit Network -> UMS Assistance -> Death Counters
Report, edit, etc...Posted by LordVodka on 2005-04-21 at 20:05:22
I've seen MANY upon MANY times when people around here say to use Death Counters instead of wait triggers. Well, people said it was better, so, I tried learning it through the tutorial... disgust.gif Didn't work out ermm.gif

Well, this is what this is here for. I need an In-Depth explanation of how to create, run, and use Death Counters {with Hyper Triggers in the Map}, if it isn't too much to ask. Unless, you want more kittys to die because I'm using waits wink.gif

EDIT: Sorry, I meant to put it 'wait'. I need to learn how to make it so I don't have to use waits because the stack-up of wait triggers is annoying.
Report, edit, etc...Posted by KiLLeR2001 on 2005-04-21 at 20:30:39
QUOTE(LordVodka @ Apr 21 2005, 08:05 PM)
I've seen MANY upon MANY times when people around here say to use Death Counters instead of triggers.

Don't you mean instead of SWITCHES not TRIGGERS smile.gif

QUOTE(LordVodka @ Apr 21 2005, 08:05 PM)
Well, this is what this is here for.  I need an In-Depth explanation of Death Counters, if it isn't too much to ask.  Unless, you want more kittys to die because I'm using waits  wink.gif

Well, Death Counters are quite simple to understand once you get it...

Basically, you use death counters to store numbers, with which you can do anything you want. Think of switches as ONLY two numbers... 0 meaning cleared, and 1 meaning set. But with death counters you can have it from 0 to 65535 or some insanely high number. And also, switches are GLOBAL which means they affect EVERYONE whereas you can choose whether or not death counters will be GLOBAL or LOCAL.

Example:

Lets say I want to make a LOCAL variable with Death counters...

(p1)
Current Player suffers X amount of deaths from UnitX
--
Blah blah blah do whatever

See, being that I can do Cur player, i have the ability to use the same UnitX for each player separately whereas I would need a completely different switch for each player, which is a waste since switches also take up strings once you rename them...

Hope that helps


ADDITION:
Well to do waits with death counters is also quite easy...

With this, you need to have hyper triggers.

Lets say every 3 seconds you want to do create a unit WITHOUT using a 3000 wait block.

Always
--
Modify death count for Player 1 Add 1 to UnitX
Preserve Trigger

Now, since hyper triggers are present, it will add about 12 death counts for every 1 second in real life. So 36 death counts = 3 seconds

So now we just do

Player 1 suffers at least 36 death count of UnitX
--
Modify death count for Player 1 to 0 for UnitX
Create 1 Unit for player at Location
Preserve Trigger

Thats about as basic as it gets smile.gif
Report, edit, etc...Posted by DT_Battlekruser on 2005-04-22 at 00:56:59
I think he means using death counter as waits. You have a death counter constantly running up (and resetting every long while), and each death count is 84 mS, so you sort of timeline it out.
Report, edit, etc...Posted by Rantent on 2005-04-22 at 01:49:05
QUOTE
each death count is 84 mS
But I thought the number changed while the speed changed. confused.gif That is how one detects gamespeed.
Report, edit, etc...Posted by LordVodka on 2005-04-22 at 01:58:04
I guess I should ask this too, just to clarify it. Increased Map Speed (Like 2x/4x Map speed) only affect the animation of the units and such correct? Not the actual count time of the triggers?
Report, edit, etc...Posted by Rantent on 2005-04-22 at 02:23:48
Player 13 increases animation speed. Player 14 increases game speed.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-04-22 at 04:18:53
Game speed does not effect the speed inwitch waits fire. Hyper triggers in a map with slow game speed will fire as much as hyper triggers in a game with fast speed.

Because of this many bounds would be impossalbe in slower game speeds.

PS. Generally people are too afraid of waits to understand them. There is nothing wrong with using waits if you know how to avoid bad wait blocks.
Report, edit, etc...Posted by LordVodka on 2005-04-22 at 15:55:44
Yea, I know, but it's starting to get annoying having to find that one wait that's screwing you over when you're testing it through.

Player 14 actually increases game speed?!?!
So, P13 and P14 do completly different things?
Report, edit, etc...Posted by chuiu on 2005-04-22 at 16:16:21
P13 increases unit animation by x2 normal speed. P14 increases unit animation by x4 nrmal speed. NOT GAME SPEED. I can't emphasize that enough.
Report, edit, etc...Posted by l)ark_13 on 2005-04-22 at 18:04:46
I Don't think anyones answered LordVodka's question yet so...:

Death count waits are extremely simple. Because with hyper triggers, 12 triggers can fire every second (approx.). So, lets say you want to wait 10 seconds. First you set a death count for a unit to 1 telling the death count timer to start ticking, then you make a trigger like this:

Trigger
Description:
Death Count Timer Start
Players:
¤ Any Player
Conditions:
¤ Death of 'Unit 1' is at least 1. (The 'At Least' is very important!)
Actions:
¤ Add 1 death to 'Unit 1'.
¤ Preserve Trigger.

This trigger starts the timer. It is adding 12 deaths to 'Unit 1' every second so with some basic knowledge of mathematics, 10 seconds x 12 deaths/second = 120 deaths. So then you make a trigger like this:

Trigger
Description:
Death Count Timer End
Players:
¤ Any Player
Conditions:
¤ Death of 'Unit 1' is at least 120.
Actions:
¤ Set death of 'Unit 1' to 0.
¤ Whatever else you want.
¤ Preserve Trigger.

There you go. If this doesn't work I'm not thinking right, your Starcraft doesn't work, or the universe has inversed... I don't think thats a word... W/e, hope that works.

Edit: Someone did, I just didn't read it. But this I'm still gonna keep this up.
Report, edit, etc...Posted by LordVodka on 2005-04-22 at 19:49:27
Yes, my intitial question of Death Counters has been remedied. But, instead of wasting board space, I'm just asking the rest of my questions along in here.

And Chuiu, that's what I thought it was ~glares at Rantent~

Okay, Next Question if I will.
How can you make and use a Physical Timer?

That and, on a side note (not sure if I'll implement this or not, depends on if people will explain it for me), the Stacking Zerg Buildings In-Game thing. How does that work? Or, has it been proven wrong and the TDB left it in there.
Report, edit, etc...Posted by chuiu on 2005-04-22 at 19:56:43
A physical timer is just a unit moving back and forth between two locations. You just make 2 locations and continually order the unit from 1 to 2, then 2 to 1. You can control how often triggers fire based off where the unit hits. Like you can have a trigger fire everytime a unit hits the 1 location, or you can have it fire for both. It's up to you.

I saw a map that used physical timers for training units in a map. It was pretty cool because you could see how long it took for each unit, even if you had like 10 training.
Next Page (1)