Staredit Network > Forums > SC1 UMS Theory and Ideas > Topic: Nuke Detection
Nuke Detection
Sep 28 2009, 3:44 am
By: DavidJCobb  

Sep 28 2009, 3:44 am DavidJCobb Post #1



Not sure where this should go... I can't imagine it's anything new or terribly original, but...

I was working on a map where the player would be given a single Command Center and Nuclear Silo, along with a Ghost in a remote area. The player was tasked with ordering the Ghost to launch the nuke, but there were multiple targets within the Ghost's range. So I rigged up some triggers to the nuke would be built, and then the player would obtain the buildings and get to launch it. I needed to figure out, however, when the nuke actually landed.

Here's the basic system I came up with it. This system really only works with one Nuclear Silo belonging to the player. I have attached a map as an example, also.
  • Implement Hyper Triggers.
  • Position a location over the Nuclear Silo.
  • If the player brings at least 1 Nuclear Missile to the location containing the Silo, then they just finished building a nuke.
  • If a player brings at least 1 Nuclear Missile to anywhere, but brings exactly 0 Nuclear Missiles to the location containing the Silo, then they just launched the nuke.
  • If a player brings exactly 0 Nuclear Missile to anywhere, then the nuke has vanished off the screen.
  • If a player brings at least 1 Nuclear Missile to anywhere, but brings exactly 0 Nuclear Missiles to the location containing the Silo, then the nuke has re-appeared on-screen, at the target area. It's about to land.
  • If a player brings exactly 0 Nuclear Missile to anywhere, then the nuke has detonated.
You'll notice that from a trigger condition standpoint, a nuke being launched cannot be distinguished from a nuke that's about to land; similarly, a nuke that has vanished off the screen cannot be distinguished from a nuke that has detonated. The simple solution to this problem is to use a death counter to keep track of each stage. The revised sequence:
  • Implement Hyper Triggers.
  • Position a location over the Nuclear Silo.
  • If the player brings at least 1 Nuclear Missile to the location containing the Silo, then they just finished building a nuke.
  • If the death counter is 0, and the player brings at least 1 Nuclear Missile to anywhere, but brings exactly 0 Nuclear Missiles to the location containing the Silo, then they just launched the nuke.
  • If the death counter is 0, and the player brings exactly 0 Nuclear Missile to anywhere, then the nuke has vanished off the screen. Set the death counter to 1.
  • If the death counter is 1, and the player brings at least 1 Nuclear Missile to anywhere, but brings exactly 0 Nuclear Missiles to the location containing the Silo, then the nuke has re-appeared on-screen, at the target area. It's about to land.
  • If the death counter is 1, and the player brings exactly 0 Nuclear Missile to anywhere, then the nuke has detonated.

There are a few caveats to the system, however.
  • It can only track one nuke from one silo at a time.
  • If the nuclear missile is canceled or if the Ghost is killed, the system will think the nuke is still in transit. (This could possibly be alleviated with a timer.)
  • You need to check the creator of the nuke. Let's say I have P2 build a nuke, and then I give the containing Silo to P1. I still need to check if P2 brought the nuke to the appropriate locations. Strangely, using Give Units to transfer ownership of the nuke to P1 does not work (before or during launch) -- even with a Give Units command, I would still need to run the Bring conditions for P2.

This could have its uses. You can detect when a nuclear silo is full (has a player brought at least one Nuclear Missile there?), and you can even detect where a nuke has landed (requires different death counter usage, shown in the attached map).

So the attached map:
  • Displays a message when you train a nuke.
  • Displays a message when you launch a nuke.
  • When the nuke hits, it spawns a Ghost for you at the strike location.

Hope someone finds this useful.

Attachments:
Nuke Tracking Demonstration.scm
Hits: 2 Size: 40.12kb

Post has been edited 1 time(s), last time on Sep 28 2009, 5:17 am by DavidJCobb.



None.

Sep 28 2009, 4:23 am poison_us Post #2

Back* from the grave

Quote from DavidJCobb
  • Displays a message when you train a nuke.
  • Displays a message when you launch a nuke.
  • When the nuke hits, it spawns a Ghost for you at the strike location.

Nice job, but wouldn't the attached map be more helpful if it was attached? And if you have all flags for the silo location checked, wouldn't it detect launch a little late? Conversely, if you only have the ground flags checked, would it detect a nuke at the silo, prior to launch?




Sep 28 2009, 5:19 am DavidJCobb Post #3



Gah! Edited the post, file's attached now.

I think a nuke counts as an air unit in all cases (when preplacing them, you can stack them over ground units and buildings), but I'm not sure. I s'pose a test could be run, but it's after 1AM right now, so I unfortunately don't have the time.



None.

Sep 28 2009, 6:42 am KooKsTeR Post #4



ok you can do this with as many silos as you want and only using one super huge location and one little location. All you have to do is make the large location detect low air elevation only. That is the elevation the nuke comes out and stays at once out of the silo. When its in the silo its a ground level. With this map I made you can detect when one nuke blows up and where (Minimap ping). There cannot be any other nukes in the air at the same time or this system will not work.

I figured out a way to detect if there is one or more nukes that have left the map, but i haven't figured out a way to detect when they come back in, as in which specific nuke has come back if there are others being launched, but I think I can find a way. (This isnt in the posted map)

Attachments:
(1)nuke test.scm
Hits: 3 Size: 52.41kb

Post has been edited 6 time(s), last time on Sep 28 2009, 9:31 am by KooKsTeR.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
[2024-4-17. : 1:08 am]
O)FaRTy1billion[MM] -- i'll trade you mineral counts
[2024-4-16. : 5:05 pm]
Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
Please log in to shout.


Members Online: Ultraviolet, Roy, NudeRaider