Staredit Network

Staredit Network -> Website Feedback, Bugs & Discussion -> Tutorials
Report, edit, etc...Posted by DT_Battlekruser on 2004-06-12 at 01:21:08
QUOTE(TUTORIAL)
Taken From: Campaign Creations
RESOURCES FOR KILLS
The question: Is it possible to have a player receive a specific amount of minerals/gas for each specific kill he or she gets? The answer: Yes, of course. Frankly, the reason why so many people don't seem to know this simple method yet eclipses me. The very fact is: everyone knows that you have a specific calculation of the "points" you get from each kill with the Kills Score. Yet, everyone seems to forget about that, and goes through all these strange methods involving hundreds of redundant unit-to-unit triggers that don't even work in all cases. Why? I dunno. But here is the easy way to do it:

The idea is to utilize the Kills Score (what we all know and love =) and transfer it directly to the minerals/gas "score." Here is the base trigger:

Owner:
- Player 1
Conditions:
- Current playerKills score is at least 1.
Actions:
- Modify score for Current player: Subtract1Kills.
- Modify resources for Current player: Add1Ore.
- Preserve trigger.

That little trigger will do the trick. It's rather elementary: for every 1 Kill point, the player will get 1 mineral. Because it is continuous (preserved), it will keep doing this until all the Kill points are turned into minerals. Simple as that. However, while this single trigger will function correctly and without exception, it will work very, very slowly since Starcraft only checks triggers every 2 seconds. That means it will transfer 1000 Kill points into 1000 minerals, but at the rate of 1 mineral every 2 seconds. Probably not what you desired.

But, expanding this simple trigger idea just a little and we can make the transfer occur in no time. First, instead of the trigger above, make the following:

Owner:
- Player 1
Conditions:
- Current playerKills score is exactly 1.
Actions:
- Modify score for Current player: Subtract1Kills.
- Modify resources for Current player: Add1Ore.
- Preserve trigger.

Then make:

Owner:
- Player 1
Conditions:
- Current playerKills score is at least 2.
- Current playerKills score is at most 3.
Actions:
- Modify score for Current player: Subtract2Kills.
- Modify resources for Current player: Add2Ore.
- Preserve trigger.

Now, follow this pattern…

Owner:
- Player 1
Conditions:
- Current playerKills score is at least X.
- Current playerKills score is at most Y.
Actions:
- Modify score for Current player: SubtractXKills.
- Modify resources for Current player: AddXOre.
- Preserve trigger.

… for X-Y combinations of 4-7, 8-15, 16-31, 32-63, 64-127, 128-255, 256-511, and 512-1023. And lastly make this trigger:

Owner:
- Player 1
Conditions:
- Current playerKills score is at least 1024.
Actions:
- Modify score for Current player: Subtract1024Kills.
- Modify resources for Current player: Add1024Ore.
- Preserve trigger.



This is a grand total of 11 triggers -- and that's all you'll need. If you don't already see where these triggers are going, let me explain. They are all essentially the same as the base trigger at the top, but split up the job of transferring the Kill points to minerals. For example, let's say a player has 1987 Kill points at one instant. Then:
First, the 1024 trigger initiates, subtracting 1024 Kills and leaving 963.
Now, the 512-1023 trigger initiates, subtracting 512 and leaving 451.
Next, the 256-551 trigger initiates, subtracting 256 and leaving 195.
Then, the 128-255 trigger initiates, subtracting 128 and leaving 67.
Now, the 64-127 trigger initiates, subtracting 64 and leaving 3.
Next, the 2-3 trigger initiates, subtracting 2 and leaving 1.
Finally, the 1 trigger initiates and transfers the last 1.
Because they are all separate triggers, they can all initiate at the same time, and thus our 1987 Kill points are turned into 1987 minerals instantly. (It may be proper to make the triggers backwards -- starting with 1024 and working your way to 1 -- since Starcraft likes to check triggers in order and you want the "larger" ones to initiate first) This system is elegantly simple, and yet, very effective.

Now that you understand what is going on, you may be asking, "But what if the player has more than 1024 Kill points -- like 50,000? Won't the 1024 trigger have to initiate more than once?" Well, yes, it does. However, there are two major reasons why you don't need to make triggers for scores above 1024. First of all, it is very unlikely that a player will accumulate something like 50,000 points in two seconds (the time between trigger checks and activation). Second, the mineral count takes about 2 seconds to go up 1000 points any ways, so the flow of incoming minerals would appear smooth even if it had to initiate the 1024 trigger multiple times.

If you wish to include Razing points, just use the Kills and Razings Score instead. And of course you realize that the owners of these triggers can be altered to suit your needs. =) Hope that helps.


Kind'a out of date. This and hypertriggers outdate it completely. Perhaps it can be chucked.

-----------------------------------------------------------------------------------------------

If you put a '9999+ unit tutorial', add this:
"Undead Units"

In Starforge set a unit's max HP to 0. When that unit is made, it's HP says "0/1" and it can never be destroyed. (except by triggers). It's a fun zombie effect.
Report, edit, etc...Posted by MindArchon on 2004-06-12 at 13:55:45
Whats the tutorial called?
Report, edit, etc...Posted by Yoshi da Sniper on 2004-06-12 at 14:27:53
We're going to do a major overhaul in tutorials for later, checking through them all.

Additionally, in our new tutorials script, we'll have the ability to have tutorials link to other sites, so we can have the database not only effect here, but strech to other sites like trickznstuff.
Report, edit, etc...Posted by DT_Battlekruser on 2004-06-12 at 15:10:05
Well, it's best you hurry with the overhaul. Some of these tutorials are really old.
Report, edit, etc...Posted by Yoshi da Sniper on 2004-06-12 at 15:42:59
Chill. Invision 2.0 still has to come out.
Report, edit, etc...Posted by Hampster on 2004-06-12 at 17:32:38
I thought it was out.
EDIT-
http://forums.invisionpower.com/index.php?...ST&f=1&t=126366
It says it was released here.
Report, edit, etc...Posted by Yoshi da Sniper on 2004-06-12 at 17:36:59
PDR = Public Development release.

We're waiting for RC1, which is the first supported release where we can start skinning.
Report, edit, etc...Posted by @:@ on 2004-06-12 at 20:48:10
Yeah! what now , he schooled you, you gonna take that ?
Next Page (1)