aliens

Author Topic: Battery-powered shotgun?  (Read 2593 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Battery-powered shotgun?
« on: June 14, 2024, 09:47:30 am »
Is it possible to make a weapon be a shotgun if ammo is not shotgun-type? I.e. ammo definition does not contain "shotgunPellets" etc.

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Battery-powered shotgun?
« Reply #1 on: June 14, 2024, 12:07:41 pm »
Yes. Both Piratez and X-Com Files have shotguns that fire slug and beanbag ammo, among others.

Online CrazedHarpooner

  • Colonel
  • ****
  • Posts: 101
    • View Profile
Re: Battery-powered shotgun?
« Reply #2 on: June 14, 2024, 01:07:40 pm »
I think, and I could be wrong, that he meant to ask if a weapon like the vanilla lasers that don't have clips can be configured to function as shotguns. By what I've tested with this little bit of code, yes. Took it to New Battle with no additional changes and a single snap shot from it blasted a bunch of holes in the barn.
Code: [Select]
items:
  - update: STR_LASER_RIFLE
    shotgunBehavior: 1
    shotgunSpread: 80
    shotgunPellets: 9
    shotgunChoke: 100

Edit:

After reareading the OP question... I'm second guessing myself and feel Juku's answer is closer to what he meant. I've confused myself now.
« Last Edit: June 14, 2024, 01:13:10 pm by CrazedHarpooner »

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Battery-powered shotgun?
« Reply #3 on: June 14, 2024, 01:17:40 pm »
Both Piratez and X-Com Files have this exact type of laser shotgun, too. And variations, like plasma, sonic or chemical rounds.

If you want actual battery-powered weapons, i.e. variable-charge shots, these also exist. Not sure to what extent they are incorporated into the big mods. Edit: Couldn't find anything, so it's probably a more niche thing. Maybe in 40K? /edit.

There is also the option to mount different types of ammo at the same time. An interesting example is the 'Human Sonic Shotgun' in XCF.


All in all, a read through of the big mods' weapon list (and possibly associated scripts, too) is a good way to broaden your knowledge of what's already possible and what kind of tricks people have come up with.
« Last Edit: June 14, 2024, 01:22:04 pm by Juku121 »

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Battery-powered shotgun?
« Reply #4 on: June 15, 2024, 02:46:17 am »
Ok, maybe i was not correct enough, when write my question.
I want not a slug-firing gun, but vice versa: make a gun shoot pellets NO MATTER what is loaded in it.
Now shotgun parameters must be written in ammo description, but i want one ammo type (battery) for normal guns and for shotgun.

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Battery-powered shotgun?
« Reply #5 on: June 15, 2024, 01:40:42 pm »
I don't know of a way to accomplish this, and I doubt it's possible without using y-scripts, if even that. Perhaps you can have a 'fake' ammo item that gets changed with a script when loaded into specific weapons.

You might check the 40K mod, because this looks like something they might have thought of. Lasgun power packs working in hot-shot lasguns or similar.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Battery-powered shotgun?
« Reply #6 on: June 15, 2024, 07:02:37 pm »
You might check the 40K mod, because this looks like something they might have thought of. Lasgun power packs working in hot-shot lasguns or similar.
Nah, it just use different type of ammo.
Dunno about scripts... no script hooks looks fitting.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: Battery-powered shotgun?
« Reply #7 on: June 15, 2024, 08:50:17 pm »
Shotgun behavior is only property of ammo, nether weapon or script can alter it.

Offline Juku121

  • Commander
  • *****
  • Posts: 1798
  • We're all mad here.
    • View Profile
Re: Battery-powered shotgun?
« Reply #8 on: June 15, 2024, 08:59:18 pm »
But can you change ammo, either as an item or its properties, upon e.g. reloading, somewat similar to dynamically changing weapon sprites depending on... was it ammo, even?

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: Battery-powered shotgun?
« Reply #9 on: June 15, 2024, 09:04:36 pm »
No, most cases script can alter how target react to hit, but not how weapon and ammo itself work.
Some thing like this would need dedicated script hook that will interact with rest of engine to alter how shoot need be handled.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: Battery-powered shotgun?
« Reply #10 on: June 16, 2024, 03:18:41 am »
Well, i did expect that. Will use "powerRangeReduction" instead of multiple pellets then.
Thank you.
By the way: how can we distinguish which parameters apply to the barrel, and which - to the bullets?
« Last Edit: June 16, 2024, 03:21:24 am by Nord »

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: Battery-powered shotgun?
« Reply #11 on: June 16, 2024, 01:37:56 pm »
Only by reading code and how its use them. As ammo and weapon is same structure in engine. Some times (like sounds) are used from both ammo and weapon.