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.
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
[2024-4-20. : 8:09 pm]
Vrael -- woo baby talk about a time crunch
[2024-4-20. : 8:08 pm]
Vrael -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
so that gives me approximately 27 more years to finish tenebrous before you get to it?
[2024-4-20. : 7:56 pm]
Oh_Man -- lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
Please log in to shout.


Members Online: Roy