Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] EUD with Cannon Progress?
[SOLVED] EUD with Cannon Progress?
This topic is locked. You can no longer write replies here.
Aug 20 2011, 3:43 am
By: IAGG  

Aug 20 2011, 3:43 am IAGG Post #1



Im trying to figure out a way to avoid crashing sc when i disable the doodad state of photon cannons. I was told that you can avoid the whole process of needed the cannon powered up by just enabling and then disabling the photon cannon and that seemed to work fine. My next issue is getting around the wait time while the photon cannon is being constructed because obviously when u try to disable a protoss building in construction, it crashes...

Is there a way to detect when a photon cannon is done being built? There would be a chance more than one photon cannon is being built at the same time with the same player as well. I want the photon cannon to be disabled when you move a certain unit next to it.

Any Ideas?



None.

Aug 20 2011, 4:00 am Sacrieur Post #2

Still Napping

Using EUDs, we can detect when a particular unit has a certain amount of HP, you can detect when it has 100% of its HP, and then do what you need.

Or emm, this is going to require index ID detection, I'm working on documentation for that.



None.

Aug 20 2011, 4:34 am Roy Post #3

An artist's depiction of an Extended Unit Death

Incomplete buildings cannot be detected in any conditions that use the "at least" or "exactly" modifiers, but they can be counted using the "at most" modifier; unfortunately this is generally not very useful. Incomplete buildings will be considered for actions.
I'm not sure how you're detecting a freshly placed photon cannon without cycling through all cannons with a give system, but this quirk may be useful depending on your current implementation. Just have a location move onto a Photon Cannon and check if there is at least 1 photon cannon at the location. If there is "At Least" 1 photon cannon there, you know the cannon finished building. Otherwise, the cannon is still in construction.




Aug 20 2011, 4:47 am IAGG Post #4



Quote from Roy
Incomplete buildings cannot be detected in any conditions that use the "at least" or "exactly" modifiers, but they can be counted using the "at most" modifier; unfortunately this is generally not very useful. Incomplete buildings will be considered for actions.
I'm not sure how you're detecting a freshly placed photon cannon without cycling through all cannons with a give system, but this quirk may be useful depending on your current implementation. Just have a location move onto a Photon Cannon and check if there is at least 1 photon cannon at the location. If there is "At Least" 1 photon cannon there, you know the cannon finished building. Otherwise, the cannon is still in construction.

Hmm, lets say I used the location to detect if there was at least 1 photon cannon at the location. What happens if there is also another photon cannon being constructed right next to it and the location has both of them in the range. (im assuming the location would be following the host unit that i would be moving around). Would it still crash? or would it just disable the one photon cannon?



None.

Aug 20 2011, 4:52 am Roy Post #5

An artist's depiction of an Extended Unit Death

It would crash. You should have the location be no larger than the size of one Photon Cannon, and center it on the Photon Cannon while performing the check. This way, you could not get two cannons in the location at a time to cause this issue.




Aug 20 2011, 5:11 am Sacrieur Post #6

Still Napping

Quote from Roy
Incomplete buildings cannot be detected in any conditions that use the "at least" or "exactly" modifiers, but they can be counted using the "at most" modifier; unfortunately this is generally not very useful. Incomplete buildings will be considered for actions.
I'm not sure how you're detecting a freshly placed photon cannon without cycling through all cannons with a give system, but this quirk may be useful depending on your current implementation. Just have a location move onto a Photon Cannon and check if there is at least 1 photon cannon at the location. If there is "At Least" 1 photon cannon there, you know the cannon finished building. Otherwise, the cannon is still in construction.

Bleh! How did I forget about that :><:.

Roy to the rescue :bleh:



None.

Aug 20 2011, 7:23 pm Gigins Post #7



Quote from Roy
It would crash. You should have the location be no larger than the size of one Photon Cannon, and center it on the Photon Cannon while performing the check. This way, you could not get two cannons in the location at a time to cause this issue.
Unless he stacks cannons.



None.

Aug 20 2011, 9:06 pm Apos Post #8

I order you to forgive yourself!

Perhaps, you can simplify your life and make the cannon be placed by triggers. Detect when the player builds a pylon for example, remove it and place a cannon at it's place.




Aug 20 2011, 10:36 pm Roy Post #9

An artist's depiction of an Extended Unit Death

Quote from Gigins
Quote from Roy
It would crash. You should have the location be no larger than the size of one Photon Cannon, and center it on the Photon Cannon while performing the check. This way, you could not get two cannons in the location at a time to cause this issue.
Unless he stacks cannons.
Not entirely. If you think about a static grid system, you'd know that a unit with the same X-Coordinate is selected by placement order (or more specifically, index ID), so the first cannon to finish would be the one affected by "Set Doodad State" at all times. Actually, you're right, because it selects by index ID in descending order.

If stacking is involved, using "Set Doodad State" would require cycling through a give system or something similar anyway, and a similar method to the one I described would work for those implementations as well.

Quote from Apos
Perhaps, you can simplify your life and make the cannon be placed by triggers. Detect when the player builds a pylon for example, remove it and place a cannon at it's place.
That was one of my first thoughts, as well, and it would be a cleaner implementation. I would go with this option if it's available.

Post has been edited 1 time(s), last time on Aug 21 2011, 6:35 pm by Roy.




Aug 21 2011, 9:03 am IAGG Post #10



Quote from Apos
Perhaps, you can simplify your life and make the cannon be placed by triggers. Detect when the player builds a pylon for example, remove it and place a cannon at it's place.
Quote from Roy
That was one of my first thoughts, as well, and it would be a cleaner implementation. I would go with this option if it's available.

I like this idea as well. This is what i tried and it worked perfectly. Thank you



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
Please log in to shout.


Members Online: RIVE, Roy, jun3hong