Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Refund drone trigger?
Refund drone trigger?
Dec 27 2009, 5:01 pm
By: Aristocrat  

Dec 27 2009, 5:01 pm Aristocrat Post #1



I'm wondering if it is possible to create a trigger which detects the construction of a building and then creates a drone adjacent to the building just constructed. For example, say I control a drone and I order it to build a building (hatchery, spawning pool, whatever). When it finishes building, the game should either create a drone next to the building that was just made, or be refunded 50 minerals. It's a simple concept, but sadly a search turned up nothing on how I can go about accomplishing this.

The biggest problem I have with this trigger is the condition: How on earth can I detect if a player made a new building with a drone? If anyone knows the answer, please do respond! I really want to know how it'll work. Thanks!

Post has been edited 1 time(s), last time on Dec 27 2009, 5:14 pm by doomedrusher.



None.

Dec 27 2009, 5:29 pm NudeRaider Post #2

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

You cannot detect buildings in progress in conditions.
You can, however center on them and then check if the location is in the middle of the main location (no building in progress) or not (there must be a building where you just centered on.
This screws up when there's a building of that type already finished, so you'd have to give all buildings of that type away (you can't give buildings in progress afaik) and then perform the check. Upgrades and selections will be canceled.

There's no way to detect when a player has just finished a building except keeping track of the number of buildings he has at all times.
It would be something like
Current Player has exactly 1 building -> set dc to 1
Current Player has exactly 2 buildings -> set dc to 2
Current Player has exactly 3 buildings -> set dc to 3
etc. and comparing the dc to its value the last trigger loop by having a 2nd dc that always hold the last value.
Pretty complicated so it's recommended that you change your map concept to better fit the starcraft engine.




Dec 27 2009, 5:39 pm Aristocrat Post #3



Quote from NudeRaider
There's no way to detect when a player has just finished a building except keeping track of the number of buildings he has at all times.
It would be something like
Current Player has exactly 1 building -> set dc to 1
Current Player has exactly 2 buildings -> set dc to 2
Current Player has exactly 3 buildings -> set dc to 3
etc. and comparing the dc to its value the last trigger loop by having a 2nd dc that always hold the last value.
Pretty complicated so it's recommended that you change your map concept to better fit the starcraft engine.

I had thought of something like that, but then I have to consider when buildings are destroyed and take into account the dcs of every single zerg building. Plus, the number of buildings can get pretty high, so...

An alternative way to do this would be to compare the number of drones a player has created over the course of the game to the number of drones currently controlled by the player (and drone dc), but I have no idea how to do that either.



None.

Dec 27 2009, 5:51 pm Sacrieur Post #4

Still Napping

Quote from NudeRaider
You cannot detect buildings in progress in conditions.
You can, however center on them and then check if the location is in the middle of the main location (no building in progress) or not (there must be a building where you just centered on.
This screws up when there's a building of that type already finished, so you'd have to give all buildings of that type away (you can't give buildings in progress afaik) and then perform the check. Upgrades and selections will be canceled.

There's no way to detect when a player has just finished a building except keeping track of the number of buildings he has at all times.
It would be something like
Current Player has exactly 1 building -> set dc to 1
Current Player has exactly 2 buildings -> set dc to 2
Current Player has exactly 3 buildings -> set dc to 3
etc. and comparing the dc to its value the last trigger loop by having a 2nd dc that always hold the last value.
Pretty complicated so it's recommended that you change your map concept to better fit the starcraft engine.

I agree, I was trying to think up a method to do this and got something, but it would be pretty tedious and I don't think it would be worth it. What you could do is eliminate locations and detect when a player commands one less drone than he did before. This is a very difficult process. And even if you kept tabs on how many drones the player has up to 200 (which to do perfectly would require 200 triggers itself), you would then have to have to detect when he loses one.

You could find out when he loses one by keeping five virtual databases (death counts). The first fluctuates based on how many the player commands. Whenever the first changes the second will take on the previous number of drones and the third will take on the new number of drones. The triggers would then subtract the first from the second to find how many drones have been removed from play by some means. The answer will be the fourth database and all drone deaths that have occurred during the trigger cycle will be subtracted from this number and the result will be placed in the fifth database. If the total in the fifth database is equal to 0, then nothing will happen. If the total is equal to or greater than 1 then another trigger will subtract 1 from this death count and reimburse 50 minerals continually until it is equal to zero.

That's an un-streamlined way of doing it. I honestly think you should take NudeRaider's advice and just find something that fits into StarCraft's engine better.



None.

Dec 27 2009, 6:10 pm PearS Post #5



Quote from NudeRaider
(you can't give buildings in progress afaik) .


im not entirely sure this is accurate. I'm pretty sure halfway completed buildings cannot be the target of a condition....but they CAN be the target of an action.

I had a farm setup in an Age of Empires map i made where when a player would make a supply depot, it would be removed and a mineral patch would be spawned in its place. I had to limit the players to making one farm at a time because once one was completed it would select non-completed farms as well as completed farms (of course starting from the bottom left and going up/right)

Another system you could so is this.
-Have a computer player allied to the human player
-When the player makes a building, center location, create a drone and give the building to a computer player.
-Have an offscreen area where the computer player has all the buildings that the player can make
-When the player makes a building, after the trigger gives the building to the comp....one of that building in the 'offscreen' location is given to the player. So when they make a hydra den or whatever they would get the ability to make hydras/upgrade technologies from the offscreen building.
-When the comp loses that building in the 'gameplay area' give the building in the 'offscreen area' back to the computer.

With this you can make things even cooler....with creep colonies giving overlords offscreen or building a spawning pool also gives a hydra den offscreen. whatevs.



None.

Dec 27 2009, 11:34 pm rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

Temple siege gives away assimilators and other buildings as soon as you build one, before they've finished.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 28 2009, 12:37 am PearS Post #7



i'll test it out again but i'm fairly certain. The thing in temple siege would be easy because it could have an assimilator offscreen to fire the trigger that recognizes the assim that they have in the playing field to give it to the comp.



None.

Dec 28 2009, 4:43 am rockz Post #8

ᴄʜᴇᴇsᴇ ɪᴛ!

I agree with you. If you build a cybernetics core, reavers don't spawn until you have completed the first one. If you then build 5 more, they can produce reavers even if they aren't completed yet. The trigger just checks for one cybernetics core, then makes a reaver at each one. Assimilators do they same, but the rate of minerals doesn't increase until you complete the assimilator.

Also, it doesn't have an assimilator off screen.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 29 2009, 4:42 pm SierraKomodo Post #9



Eh.. This is probably something you already considered, but.. Could the drone itself simply cost 0 minerals?



None.

Dec 29 2009, 9:07 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

You could also detect the drone - or lack thereof. That means you need to have 1 1x1 pixel location following every drone. If drones are limited this should be easier than detecting finished buildings.
But keep in mind that stacking or putting them in transports will screw up the location follow.




Dec 30 2009, 12:25 am O)FaRTy1billion[MM] Post #11

👻 👾 👽 💪

Quote from NudeRaider
...(you can't give buildings in progress afaik)...
You can. I remember giving away supply depots to enemy players while an SCV was building it. It continued to build an enemy building unless you halted. :P



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Dec 30 2009, 2:04 am rockz Post #12

ᴄʜᴇᴇsᴇ ɪᴛ!

If units are anything like buildings, you should be able to detect the drone which is being built by detecting if it is in a location, then kill it if it's not there before it is made. However, there's no good way to detect that you have too many drones, since it won't show up in any conditions.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Dec 31 2009, 1:17 pm Wormer Post #13



doomedrusher,
Why don't simply refund 50 extra minerals when the building got killed?
Also, you can detect buildings score (this is not reliable though if 2 buildings finished at one time).



Some.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[03:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[01:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
[2024-4-26. : 6:47 pm]
Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
Please log in to shout.


Members Online: Oh_Man, Roy