OpenXcom Forum

Modding => Work In Progress => Topic started by: ohartenstein23 on January 28, 2019, 06:36:38 pm

Title: [OXCE] Crewed Weapons Testing
Post by: ohartenstein23 on January 28, 2019, 06:36:38 pm
Updated 190207 - new download in this post (https://openxcom.org/forum/index.php/topic,6874.msg109862.html#msg109862).

As previewed in the latest episode of my WH40k Let's Play (https://www.youtube.com/watch?v=gFwVs9vApow), 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:

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!
Title: Re: [OXCE] Crewed Weapons Testing
Post by: efrenespartano 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
Title: Re: [OXCE] Crewed Weapons Testing
Post by: Valken 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...
Title: Re: [OXCE] Crewed Weapons Testing
Post by: Nord 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.
Title: Re: [OXCE] Crewed Weapons Testing
Post by: ohartenstein23 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.
Title: Re: [OXCE] Crewed Weapons Testing
Post by: efrenespartano 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.
Title: Re: [OXCE] Crewed Weapons Testing
Post by: ohartenstein23 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.
Title: Re: [OXCE] Crewed Weapons Testing
Post by: Nord 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?
Title: Re: [OXCE] Crewed Weapons Testing
Post by: ohartenstein23 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.
Title: Re: [OXCE] Crewed Weapons Testing
Post by: efrenespartano 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
Title: Re: [OXCE] Crewed Weapons Testing
Post by: Yankes 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.
Title: Re: [OXCE] Crewed Weapons Testing
Post by: The Reaver of Darkness 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.
Title: Re: [OXCE] Crewed Weapons Testing
Post by: ohartenstein23 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.