Author Topic: [OXCE] Crewed Weapons Testing  (Read 7848 times)

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
[OXCE] Crewed Weapons Testing
« on: January 28, 2019, 06:36:38 pm »
Updated 190207 - new download in this post.

As previewed in the latest episode of my WH40k Let's Play, I've been designing a set of OXCE scripts that would turn a HWP unit into a crew-served weapon emplacement. The essence of the idea is that the emplacement unit can't do anything until a soldier interacts with it in melee range, then it inherits the firing accuracy and reactions of the soldier that uses it. With proper time unit costs set, the emplacement could require two soldiers to operate at full capacity for setting it up and reloading.

I'm attaching a standalone version of these scripts for testing. It provides a HWP unit purchasable at the start of UFO that is essentially a better heavy cannon with HE ammo. There is an ufopaedia article that explains the basic use, but here's the more in-depth explanation:

Usage:
  • Kneeling melee attack on the turret: "uses" the turret, setting your soldier's TUs to 0, and setting the turret's firing accuracy and reactions to be equal to that of your soldier's stats. If the soldier would've had >50% TUs after the melee attack, the turret gets 100% TUs. If less than, the turret gets 50% TUs. The turret's energy is zeroed to prevent movement. The firing accuracy and reactions stats revert to 1 at the beginning of your next turn.
  • Standing melee attack on the turret: "pushes" the turret, granting it a small number of TUs and energy in order to move. The amount is proportional to a soldier's strength. This can't be done again until the turret is under 7 TUs.
  • Melee attack with the special item "Turret Wrench": "disassembles" the turret, stunning it and allowing it to be easily picked up and moved. It won't recover from stun automatically. Cannot use/push the turret.
  • Ranged attack with the special item "Turret Wrench": "assembles" the turret, reviving it from the stunned state created by disassembly, setting the stun to 0.

If you're bringing the turret on the craft, make sure you bring a stun rod and equip it on a soldier, otherwise the turret will sit on top of your equipment pile and prevent using it! Also, you'll need OXCE later than 19 Jan 2019 for the script to work, and later than 26 Jan 2019 for the firing and reactions to save properly if you save/reload the game.

You can also get some experience from using the weapon emplacement - during each turn, the script keeps track whether or not you hit at least once with the turret. At the end of battle, the script counts how many turns a soldier had a hit with the weapon emplacement and gives firing experience according to that number - +0 or +1 firing for 1 hit, +0 to +2 for 2 hits, and +1 to +3 for 3 hits and up. Reactions training is also planned, but requires some more script hooks in order to function.

If you try the mod out, please let me know what you think!
« Last Edit: February 07, 2019, 07:53:54 pm by ohartenstein23 »

Offline efrenespartano

  • Commander
  • *****
  • Posts: 765
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #1 on: January 28, 2019, 06:42:14 pm »
I just read the post and I'm in love with the idea. Thank you for making such amazing codes, Otto!

As quick as I get a PC, I'll check it out.


Enviado desde mi iPhone utilizando Tapatalk

Offline Valken

  • Sergeant
  • **
  • Posts: 13
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #2 on: January 29, 2019, 03:30:26 pm »
I love this idea so much... I hope it gets added to X-Com Files as that is my current game...

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #3 on: January 29, 2019, 05:34:15 pm »
Great idea. But i must admit, that there is too much "lets pretend that" in this concepton. By other words, game engine is very unfriendly to that realisation.
I wonder if "UFO: Aftermath" conception will fit better: one can carry a turret, but cannot shoot. To open fire, one need to "prime" it. And then he loss all movement availability, except turning around, but can acquire additional front armor.
And after "unpriming", movement regained, but firing ability lost.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #4 on: January 29, 2019, 07:09:40 pm »
I tried that before, but we have the issue that there is an overload on the hotkeys to use aimed and snap shots with prime and unprime actions, leading to crashes. Also, this can be easily subverted by using medikits to restore energy, as removing all energy is the only way to keep a soldier from moving currently.

Offline efrenespartano

  • Commander
  • *****
  • Posts: 765
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #5 on: January 29, 2019, 07:14:14 pm »
I really liked this new code. A single soldier with the cannon annihilated 3 Sectoids in a house. (The other died trying to outflank hahaha)  ;D

At the beginning it is a little complicated to use, but after a moment you understand the way to use it and it is quite fun.

Question: is it normal that if you re-use a melee weapon in the turret after using it, the TUs of the turret are emptied and the soldier retrieves his TU, but the soldier can not use the turret again for that turn?

Is not a problem, no, but I don't know if this is planned to work like that.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #6 on: January 29, 2019, 07:27:32 pm »
No, it should work by making any melee attacks after "using" the turret do nothing, I'll check that.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #7 on: January 30, 2019, 05:41:56 am »
removing all energy is the only way to keep a soldier from moving currently.
Meridian have added a flag to armor description, which prevent unit movement. How about it?

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #8 on: January 30, 2019, 06:19:18 am »
I use that for turrets already, but I want crewed weapons to be mobile in some form. I may or may not use the "push" part of the script when I implement these for the 40k mod. Some emplacements could be wheel-mounted, which means they should readily move but not be disassembled, while others like a simple tripod it'd make more sense to tear down, pick up, and place elsewhere.

Offline efrenespartano

  • Commander
  • *****
  • Posts: 765
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #9 on: January 30, 2019, 09:12:48 am »
I use that for turrets already, but I want crewed weapons to be mobile in some form. I may or may not use the "push" part of the script when I implement these for the 40k mod. Some emplacements could be wheel-mounted, which means they should readily move but not be disassembled, while others like a simple tripod it'd make more sense to tear down, pick up, and place elsewhere.

I'm very interested in both types of crewed weapons, for my Great War of the Worlds mod. I would use the wheel-mounted gun for mobile howitzers and the tripod-mounted for static MGs. I guess that wheeled turrets just don't need Wrenches.

Since "punching" is a good option for move the turrets a little, I think I need to add a punch specialWeapon to all of my soldiers now hahaha.

Anyway, it's a great code, Otto. Keep up with your awesome work!


Enviado desde mi iPhone utilizando Tapatalk

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #10 on: January 30, 2019, 08:28:05 pm »
One solution could be allowing to change movement type of unit by scripts (and new one "NO_MOVE"). This could have other uses too (like net to catch flying ethereals). Only tricky part is to apply gravity after change.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #11 on: February 01, 2019, 12:51:40 pm »
It seems really silly to melee attack the turret, but I like the way it works in the end.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [OXCE] Crewed Weapons Testing
« Reply #12 on: February 07, 2019, 07:52:44 pm »
Some small updates to the testing mod and scripts - I added tags on the crewed weapons' armor that allows you to choose whether the turret can be pushed/disassembled or not, and made it so the turret doesn't disappear for a few frames when moving after being pushed.