Author Topic: shape charge explosive  (Read 7796 times)

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
shape charge explosive
« on: November 10, 2013, 09:25:00 pm »
ok, this is kinda tricky, and I need some help - or possibly a code addition. I'm not sure.

I'm trying to create a shaped charge explosive that allows xcom operatives to breach UFO walls: something that can destroy walls, but is almost non-usable as a weapon.

I could simply make a "higher explosive", but the 360° blast is really inconvenient. something that would be capable of destroying a UFO wall would level a lot of terrain around the UFO, possibly including the soldier who used it.

I was then thinking about severely reducing the explosion radius, but that would make it an exceptionally powerful grenade - you could use it to kill a sectopod with hardly any collateral damage!

next I thought about making it a single-use melee weapon: your soldier would have to stand in front of the wall and "hit" the wall. unfortunately, melee only works against live targets - you cannot "hit" items or terrain.

I now arrived at a single-shot "weapon" type device. it uses the graphics of the High Explosive, but has "battleType: 1" with "maxRange: 1" and "power: 150", meaning that it can be fired into an adjacent tile with enough power to have a high chance of breaching a UFO outer wall (it can fail, though - my first field test left the wall standing and me wondering what I did wrong).
I set "clipSize: 1" to simulate an explosive device. it performs nicely in that it can be used to breach a UFO at a high TU cost (80%), and disappears after use... unfortunately, it reappears after combat, due to the programmed properties of single-use items.

is there anything else I might try? some other way of implementing it? another item type I can use?

Offline Sharp

  • Colonel
  • ****
  • Posts: 181
    • View Profile
Re: shape charge explosive
« Reply #1 on: November 10, 2013, 11:43:55 pm »
Having it as a grenade probably works best. Give it a high enough weight and no-one will use it against sectopods, plus a grenade allows it to be primed to explode on a certain turn which is certainly useful in wall removing explosives.

Offline harry

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: shape charge explosive
« Reply #2 on: November 11, 2013, 01:05:41 am »
I didn't see the blastradius reference in your item ruleset, you might want to test it.

blastRadius    Size of the projectile explosions. 0 for no explosion. -1 to automatically calculate based on weapon power and damage type.    default -1 

Offline Sharp

  • Colonel
  • ****
  • Posts: 181
    • View Profile
Re: shape charge explosive
« Reply #3 on: November 11, 2013, 01:15:36 am »
I didn't see the blastradius reference in your item ruleset, you might want to test it.

blastRadius    Size of the projectile explosions. 0 for no explosion. -1 to automatically calculate based on weapon power and damage type.    default -1

It's not an explosive in his ruleset, it's a one-shot bullet designed for destroying something directly next to it.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: shape charge explosive
« Reply #4 on: November 11, 2013, 10:08:53 am »
precisely. as I said before, I don't really want it to be a blastradius-limited explosive device, because that can be too easily exploited.

it would be nice, though, if I could tell the game to not re-fill the weapon after combat. especially because it completely disappears after use (which makes sense for an explosive device), but then magically reappears later at the base (which would only make sense for a weapon with limited charges, like the xcom2012 stun gun).

I guess those types of weapons (clip size other than "-1", but no ammunition defined) need another parameter like "disappearWhenEmpty: true/false". for those with "disappearWhenEmpty: false",  the weapon could be marked as "depleted", but stay in the game as an object; for those with "disappearWhenEmpty: true", the whole weapon would cease to exist.

Offline Sharp

  • Colonel
  • ****
  • Posts: 181
    • View Profile
Re: shape charge explosive
« Reply #5 on: November 11, 2013, 12:40:12 pm »
precisely. as I said before, I don't really want it to be a blastradius-limited explosive device, because that can be too easily exploited.

I don't think it can though. HE are the biggest throwable explosive you have access to and people don't use that for killing sectopods, it can't be thrown more then a few tiles. Give the shape charge a high enough weight and you can't use it as an easy killing device. Given the low blast radius it becomes even harder to use offensively as you will need a direct hit which is going to be hard to do from range and if your close up to throw accurately your also close enough to eat a lot of shots from sectopod.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: shape charge explosive
« Reply #6 on: November 11, 2013, 01:25:56 pm »
hmmm... I've seen people use HE as a thrown explosive. in the vanilla game, before we added 3D explosions, it was also quite common to either drop HE charges onto enemies from above (with soldiers in flying suits) or, exploiting a bug, to throw them through the ceiling into the level above, killing enemies without danger to yourself.

if the shape charge is a grenade type item, it also uses a hardcoded TU percentage for priming, right? I wanted to make it so that it takes almost a full turn to set up.

also, the shape charge is supposed to be a precision device, so I kinda like the way it works right now, as a purely directional weapon. I think it is even possible to use it against the ceiling or floor, adding a new tactical element (how's that for a dramatic entrance, blowing the floor out from under yourself and dropping into the middle of the enemy forces...)

one thing I might change about it is to make it a researchable item, after you have researched Alien Alloys and Alien Grenade :) so it would still be possible as an early-game device, but not from the start.

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: shape charge explosive
« Reply #7 on: November 11, 2013, 06:56:47 pm »
Can confirm, I use HE packs as big grenades once I have some high strength soldiers, and would abuse a low-radius hi-power explosive.

Offline Arpia

  • Colonel
  • ****
  • Posts: 116
    • View Profile
Re: shape charge explosive
« Reply #8 on: November 16, 2013, 09:26:25 pm »
Think I have a solution... try this?
I added a 'trigger' to the mechanism. Now the trigger counts as the firearm, while the charge itself counts as the ammo. since ammo is consumable, each shot uses up the charge. You still recover the trigger, but without the charge it's rendered useless.
« Last Edit: November 16, 2013, 09:30:45 pm by Arpia »

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: shape charge explosive
« Reply #9 on: November 18, 2013, 08:32:14 pm »
of course, that's a possibility. I remember recommending that as a workaround for the "single-shot missile launcher" :)

I'd still prefer another way of handling this ;)