Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Best way to detect killing specific units?
Best way to detect killing specific units?
This topic is locked. You can no longer write replies here.
Dec 24 2009, 8:09 am
By: Kimaru  

Dec 24 2009, 8:09 am Kimaru Post #1



I'm trying to make a carrier and bengalaas be bonus units, and if killed, give far more points than the others units. The easiest way would be to have the trigger like:
Conditions:
Current Player kills at least 1 bengalaas
--------
Actions:
Set resources for current player: add 60 gas
comment: ---

Then repeat this trigger many times with "at least 2" "at least 3" "at least 4" "at least 5" "at least 6"........but there is no way I'm going to write each number, there could be hundreds. Anyone know of an easier way?



None.

Dec 24 2009, 8:23 am Neki Post #2



Detect the exact kill score of the unit, and then apply the bonuses, or you can detect the exact kill score along with the death of the enemy computer.
http://www.staredit.net/topic/9040/



None.

Dec 24 2009, 9:16 am Kimaru Post #3



I'm trying it now, but I'm having trouble intertwining it with the current method I'm using, which involves adding 1 gas for every non-bengalaas/carrier kill.. What I'm using right now is "Kills score at least 1, set to 0, add 1 gas". I'm currently adding extra conditions to detect when it's not a carrier/bengalaas, but I'm going to have to work at it.



None.

Dec 24 2009, 9:22 am Neki Post #4



Put the kill score triggers for the carrier and bengalas before (on top) of the list, so the list should be Carrier trigger -> Bengalas Trigger -> Your Kill Scores at least 1 trigger, it should work a little better that way. Just make sure the highest kill score detecting trigger is always on top. Use the same premise that you have there, but change the kill score from 1 to whatever the kill values are for a carrier, and for a bengalas.



None.

Dec 24 2009, 10:41 am Kimaru Post #5



Ok, I've come up with these sets of conditions. I tried it 3 times without changing anything. The first 2 tries the system stopped working after a short while. No gas was gained for any kill. The third try it worked. odd. Can you take a look at the 4 conditions I've made? I'm using more than 1 critter and only the bengalaas is the prized one.




None.

Dec 24 2009, 11:33 am NudeRaider Post #6

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

The problem is that triggers are usually only checked every 2s. So when within these 2 seconds you have killed a bengalaas and another unit then you won't have exactly 10 kills score.
Adding hyper triggers will make the problem less severe as this makes sc check the triggers 8 times per second. It can still glitch because of splash or multiple attackers, so I recommend adding triggers that cover the case of 2 units killed within one trigger cycle.

Add these 2 triggers after your 2nd trigger:
C: Current Player kills score is at least 1901
C: P7 has suffered at least 1 death of carrier
A: add gas
A: subtract 1 P7 carrier death
A: subtract 1900 kills score

and:
C: Current Player kills score is at least 11
C: P7 has suffered at least 1 death of bengalaas
A: add gas
A: subtract 1 P7 Bengalaas death
A: subtract 10 kills score

Post has been edited 2 time(s), last time on Dec 24 2009, 3:40 pm by NudeRaider. Reason: fixed numbers




Dec 24 2009, 12:13 pm Kimaru Post #7



Quote from NudeRaider
A: add gas
A: subtract 1 P7 Bengalaas death
A: subtract 1900 kills score

Did you mean 1900 for the bengalaas part? or 10?



None.

Dec 24 2009, 2:59 pm Sacrieur Post #8

Still Napping

Quote from Kimaru
Quote from NudeRaider
A: add gas
A: subtract 1 P7 Bengalaas death
A: subtract 1900 kills score

Did you mean 1900 for the bengalaas part? or 10?

He meant 10 for the bengalaas part.



None.

Dec 24 2009, 3:38 pm NudeRaider Post #9

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 name:Apollo
He meant 10 for the bengalaas part.
Yes. Sorry.
Fixed it.




Dec 24 2009, 6:36 pm ImagoDeo Post #10



Quote from NudeRaider
Adding hyper triggers will make the problem less severe as this makes sc check the triggers 8 times per second.

It's actually 12 times per second (rounded up from 11.9, I believe).

Specifically detecting a bengalaas kill can be done by checking the kill score for a player. I know this has been gone over before, but let me repeat:

1. When you kill a unit, ANY UNIT, kill score is added.
2. This can be detected by the 'Score' condition.
3. A carrier's kill score is 1900 points; no other unit has that score.
4. All critters have a score of 10 points. If you have other critters besides bengalaas on your map, and if they can be killed, then you have a problem. Other repeats of that specific kill score include Zerg Larva and Zerg Cocoons, so if those can be killed on your map there will be difficulties.
5. If you want all other units to add 1 gas, you're going to have to detect when the kill score is NOT exactly 10 or 1900.

So here are the triggers that you need:

Quote
Conditions:

-Current Player kill score is at least 1.
-Current Player kill score is at most 9.

Actions:

-Modify kill score for Current Player: Set to 0.
-Set resources for Current Player: Add 1 gas.
-Preserve Trigger.

Quote
Conditions:

-Current Player kill score is exactly 10. (Bengalaas kill)

Actions:

-Modify kill score for Current Player: Set to 0.
-Set resources for Current Player: Add 60 gas.
-Preserve Trigger.

Quote
Conditions:

-Current Player kill score is at least 11.
-Current Player kill score is at most 1899.

Actions:

-Modify kill score for Current Player: Set to 0.
-Set resources for Current Player: Add 1 gas.
-Preserve Trigger.

Quote
Conditions:

-Current Player kill score is exactly 1900. (Carrier kill)

Actions:

-Modify kill score for Current Player: Set to 0.
-Set resources for Current Player: Add 60 gas.
-Preserve Trigger.

Quote
Conditions:

-Current Player kill score is at least 1901.

Actions:

-Modify kill score for Current Player: Set to 0.
-Set resources for Current Player: Add 1 gas.
-Preserve Trigger.

Of course, you can probably leave off the first trigger - nothing has a lower kill score than 10.



None.

Dec 24 2009, 6:59 pm Sacrieur Post #11

Still Napping

The problem with that is if he kills a carrier and bengalaas simultaneously then he'll have 1910 points. And instead of getting 61 gas like he should, he only gets 1.

It would be better to do it differently. If the kill score is equal to or greater then 1900 subtract 1900 and add 60 gas. This should repeat until the kill score is less than 1900. If the kill score is less than 1900 do the same only subtracting 10 score and adding 1 gas.

Quote
Conditions:

-Current player kill score is at least 1900.

Actions:

- Modify kill score for current player: subtract 1900.
- Modify resources for current player: add 60 gas.

Quote
Conditions:

- Current player kill score is at least 10.
- Current player kill score is at most 1890.

Actions:

-Modify kill score for current player: subtract 10.
-Modify resources for current player: add 1 gas.




None.

Dec 24 2009, 7:05 pm Jack Post #12

>be faceless void >mfw I have no face

Just put the carrier trigger in front of the bengalaas trigger. Unless you have 190 bengalaas's killed at exactly the same time.

Anyway, that's not the best way to do it. A better way, which can also prevent money for team killing, is simple. Just add in the conditions a Foes suffer at least 1 deaths of Carrier, and in the actions, subtract 1 deaths of Carrier for Foes. Probably better to use specific players instead of Foes.

EDIT
Woops, nude already posted this. Just do what nude said. If you're going to have problems with splash killing, there's a simple fix for that too.



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Dec 24 2009, 10:44 pm Kimaru Post #13



Thanks a lot guys, it works perfectly.



None.

Dec 25 2009, 4:52 pm NudeRaider Post #14

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 ImagoDeo
Quote from NudeRaider
Adding hyper triggers will make the problem less severe as this makes sc check the triggers 8 times per second.

It's actually 12 times per second (rounded up from 11.9, I believe).
I am always talking game seconds as that is independent from the game speed setting and always in synch with the gameplay.
It's exactly 8 times per game second and about 11.9 times per real-time second on fastest.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
Please log in to shout.


Members Online: Zycorax