Author Topic: EMP Craft weapons  (Read 4776 times)

Offline endersblade

  • Captain
  • ***
  • Posts: 81
    • View Profile
EMP Craft weapons
« on: February 16, 2017, 05:06:35 am »
Is it possible to make something for craft that when you shoot down an alien ship it doesn't damage anything?  Kinda like the EMP weapon from the newer XCOM games, they deal much less damage to the internals but still bring the ship down.  Is such a thing even possible without making it happen for ALL weapons?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: EMP Craft weapons
« Reply #1 on: February 16, 2017, 05:45:13 am »
not as such, at least not without code modification of some sort.
UFOs only have 3 "states of being" and these are "airborne" "landed" and "crashed". there is also "destroyed" but that's not so much a state of being as it is a state of not being.

a UFO that is "crashed" will have a certain chance of any engines on board exploding.
in terms of game mechanics, this determination is made at the moment you start the battlescape mission at the crash site, independent of whatever happened in the geoscape (remember in the original game they were two seperate executables)

so, short of adding a flag to weapons for "is EMP", a flag to UFOs for "only damaged by EMP" that any other weapon kind sets to false, then checking that variable in the battlescape generator to decide whether or not to explode the engines on a crash site, no, this is completely impossible. (that is to say, it's completely possible, and those are the flags and checks you would need code-side)

Offline endersblade

  • Captain
  • ***
  • Posts: 81
    • View Profile
Re: EMP Craft weapons
« Reply #2 on: February 16, 2017, 05:57:36 am »
Hmm, would it be possible to make it so when a certain craft weapon 'shoots down' a UFO, it's marked as landed instead of crashed?  And force it to stay down for a decent amount of time?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8617
    • View Profile
Re: EMP Craft weapons
« Reply #3 on: February 16, 2017, 10:37:06 am »
There is a concept of tractor beams in OXCE+, more info here: https://openxcom.org/forum/index.php/topic,5266.0.html

It allows to slow down quicker ships and force landing for slower ones.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: EMP Craft weapons
« Reply #4 on: February 16, 2017, 06:46:20 pm »
The version of the game we had when I was a kid would always leave the UFO power sources intact when any ship was shot down using cannons. We thought this was a feature, but apparently it was a bug. Unfortunately I don't know what version we were playing, and all versions I've tried won't do it. But any crash gives a 75% chance (IIRC) for power sources to explode, meaning a small or large scout has a 25% chance of having an intact power source, and a battleship crash averages one intact power source since they're all separate from each other. Supply ships, harvesters, and terror ships have the lowest chance for recovering power sources because if even one explodes, it usually destroys the others.

I don't think there's any basic functionality in openxcom to prevent a weapon from detonating power sources, but you could alternatively alter the maps to separate the power sources from each other or put strong walls between them.

Offline endersblade

  • Captain
  • ***
  • Posts: 81
    • View Profile
Re: EMP Craft weapons
« Reply #5 on: February 17, 2017, 03:22:10 am »
In the new XCOM, the setting for whether or not a power supply blew up on being shot down was a percentage located in a config file.  Is there something like that for OXC, or is it just entirely map based?  I'm not going to go through and edit every single ship map...

I was actually more interested in maximum Alloy haul and live aliens more than power supplies.  I'm just a hoarder lol.  But I hate getting to a ship and finding half the damned crew died on impact.  (over-exaggeration, but you get the point.)

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: EMP Craft weapons
« Reply #6 on: February 17, 2017, 05:10:14 am »
No, it's not per-map, it's a hardcoded 75% chance to explode for map objects with the MCD data for power sources.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: EMP Craft weapons
« Reply #7 on: February 17, 2017, 06:12:32 am »
No, it's not per-map, it's a hardcoded 75% chance to explode for map objects with the MCD data for power sources.
...for maps flagged as crash sites. If you could make a crash site link to a landed map, it wouldn't detonate the power source. Unfortunately, I don't think openxcom currently has any flags to do that depending on the weapon that shot the craft down. First, it would have to be programmed to store that or other relevant information on the crash site.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8617
    • View Profile
Re: EMP Craft weapons
« Reply #8 on: February 17, 2017, 09:53:22 am »
As ohartestein said, there is no such thing as "crash site map" and "landing site map". It's the same maps, and explosion of power sources does not depend on the map at all. It depends on ufo status.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: EMP Craft weapons
« Reply #9 on: February 17, 2017, 02:59:29 pm »
Continuing on Meridian's thought, shooting down a craft gives it a status of "crashed" (or "destroyed" if you used really powerful weapons).  When the map generation runs, it checks the status of the UFO: if "crashed," then explode the power sources on a 75% RNG roll. That's the cool part - there is no separate map, it's always the same UFO, but when crashed the power sources go off like normal really big explosives before turn 1.  The code I wrote for tractor beams let's weapons forces a "landed" state instead, but they don't do damage per se. They have a power rating that reduces the max speed of the UFO for escape checks, and if that speed reaches 0, the UFO is forced to land for 30 minutes to 2 hours, long enough to assault if you have a dropship on the way.

Offline Scorrpio

  • Captain
  • ***
  • Posts: 88
    • View Profile
Re: EMP Craft weapons
« Reply #10 on: February 23, 2017, 01:32:58 am »
Speaking of Xcom'2012, I personally never saw a whole lot of diffeence between UFOs taken out by EMPs vs plasmas.   I would put EMP on my craft cause they tend to bring ships down faster, but amount of destruction on a ship looks about same....