Wav. problem

F

Fury-hawk

Guest
:( I'm having a problem with something that should be easy but doesn't seem to work.
All I wish to do is : when force 1 kills (X) of any unit, create (X) amount of units at a loc., then play a wav, and have the units attack another loc. But, I wish this to happen EVERYTIME force 1 kills (X) amount of units.

Condition :Force 1 kills (x) amount of units

Action: wait (X) millisec.
play wav.
create (X)amount of units for Force 2 at loc. (X)
All of any uint at loc (X) (attack) all of any unit at loc.(X2)
owned by force 1
Preserve Trig.


The thing is, it either, creates unlimited amounts of (say zerglings) till it can't fit no more in the loc. or, plays the wav over and over,or sometimes it only makes the units and they just stand there. All I want is when the player, kills 5 units, then play a wav, and a then 5 new units attack them, and for this to remain constant thoughout the scenario.
Please... what am I doing wrong, is it the preserve trig, or to many actions for one trig. to run. I be grateful for any help! :)
 

Ilendil

Most Respected Former Admin
Reaction score
1
Sigh.... this is the same problem kills to resources many, many people have... search the forums if you can't understand the explanation. (It's going to be pretty long)

Copied 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 player Kills score is at least 1.
Actions:
- Modify score for Current player: Subtract 1 Kills.
- Modify resources for Current player: Add 1 Ore.
- 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 player Kills score is exactly 1.
Actions:
- Modify score for Current player: Subtract 1 Kills.
- Modify resources for Current player: Add 1 Ore.
- Preserve trigger.

Then make:

Owner:
- Player 1
Conditions:
- Current player Kills score is at least 2.
- Current player Kills score is at most 3.
Actions:
- Modify score for Current player: Subtract 2 Kills.
- Modify resources for Current player: Add 2 Ore.
- Preserve trigger.

Now, follow this pattern…

Owner:
- Player 1
Conditions:
- Current player Kills score is at least X.
- Current player Kills score is at most Y.
Actions:
- Modify score for Current player: Subtract X Kills.
- Modify resources for Current player: Add X Ore.
- 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 player Kills score is at least 1024.
Actions:
- Modify score for Current player: Subtract 1024 Kills.
- Modify resources for Current player: Add 1024 Ore.
- 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.

DI
March 10, 1999
 
G

Guest

Guest
i did exactly as u said:

Owner:
- Player 1
Conditions:
- Current player Kills score is at least 1.
Actions:
- Modify score for Current player: Subtract 1 Kills.
- Modify resources for Current player: Add 1 Ore.
- Preserve trigger.

and even if i have only 1 kill, the resources keep on increasing.
 

Ilendil

Most Respected Former Admin
Reaction score
1
Thats because kills are the points a units give.

I.E. a Marine is 100 kills and Zerglings at 50 kills.
 
F

Fury-hawk

Guest
Thank-you

Thank you for the assistance, sorry didn't mean to bring up a problem that was similar to theother problem, I did read the other threads and saw that people were borthering you guys with the min. problem. I had know idea mine was the same thing, didn't mean to upset anyone ;). I will try to be more careful of my questions in the future. As for the problem, well I try to follow all you said, but I still had some problems. pretty much the same as the unregistered guys reply was, it keeps making more and more.
So it seem easy to one degree and complex to another. So I just decided to drop the idea.
But don't get me wrong I truely thank you for the help! I just found another way to go about it. Not quite the same but it works!
I simply set it to create (x) units at a loc.
Order them to attack another loc.
and wait like 100000 milli secs
then preserved it.

This make them, has them attack, and repeats it every so often :)
But once again thanks!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top