aliens

Author Topic: [Suggestion]Model for supporting HWP weapon switching.  (Read 2932 times)

Offline darkestaxe

  • Colonel
  • ****
  • Posts: 254
  • Emissary of the Brain
    • View Profile
[Suggestion]Model for supporting HWP weapon switching.
« on: June 21, 2014, 08:09:20 am »
I know the suggestion that we allow tanks to switch their weapons has been coming up almost as often as the TFTD and combined requests but I'm thinking about how to do it from a coding/data perspective without breaking everything.

First off tanks and hover tanks already have their gun turret graphics separated right? (If not that could be a problem)

I would make the tank weapons into an item. The tank should only ever be a tank w/ nothing until you get to the battlescape. This way the only thing that the battlescape and geoscape need to communicate is how many STR_HWP_CANNONGUN, STR_HWP_CANNONSHELL and STR_HWP_TANK are either on the craft at the start of battle or recovered at the end of battle.

This also means that we're only adding some new items to the list of things you can purchase/research/manufacture/load on a craft/sell etc to the geoscape, thus we don't need to add a new screen. I haven't tried it but I'm currently under the impression that you can do that already by just adding a new entry to the ruleset.

The battlescape is somewhat less fortunate, although if I understand correctly HWPs are already treated as carrying a weapon in their right hand.

Obviously we don't want to just have tanks appear as Dolph Lundgren and trust players to only give HWP guns to blonde dudes named Tank or Hovertank. We already added alien dolls to the equip screen and we should be able to do the same with tank dolls, though I don't know if they're the same dimensions.

Next there's the possibility of separating tanks from soldiers, such that they would have a different inventory, or preventing tanks and humans from equipping each others equipment.

Finally there's the reality of coding all this. The result would be that modders could add new tanks or new tank weapons, rather then having to add tank/weapon combos, and you would be able to get hovertanks without plasma or plasmatanks without hover.

Personally I've thought long and hard about making a total rebalance mod with added weapons etc. I can't really do much about tanks as long as their weapons are welded to the frame.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Suggestion]Model for supporting HWP weapon switching.
« Reply #1 on: June 21, 2014, 01:53:46 pm »
+1!

I can see no problem with this solution, graphics-wise. It'd just have to be coded in.

...well, there is one problem: Alien Alloys hovertanks have different colouration than Earth tanks. This means that each turret would have to be drawn twice, with different paintjobs, since a standard turret looks awful on an Alien Alloy hull. But that's all.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: [Suggestion]Model for supporting HWP weapon switching.
« Reply #2 on: June 22, 2014, 12:18:29 am »
I like the idea. And yes, it should be implemented with a different inventory layout. Only one "arm",  no belt, no shoulder or leg slots, perhaps a different "backpack" as ammo storage. (4*2 comes to mind)

Offline darkestaxe

  • Colonel
  • ****
  • Posts: 254
  • Emissary of the Brain
    • View Profile
Re: [Suggestion]Model for supporting HWP weapon switching.
« Reply #3 on: June 22, 2014, 03:14:24 am »
My original thinking was that actually dealing with making different combinations look nice could be left to modders since it involves re-drawing art assets. I would just redraw guns that look ok on both OR have guns use a different graphic depending on which tank their going into. For instance plasma cannons can look like a laser cannon or cannon and vice versa.

If that's not too hard to code in an elegant way then great, but otherwise I think the functionallity should be added so that modders can make use of it whenever someone decides to do it. Lot's of people can pick up BBs toolkit and redraw a tank cannon, and they don't need a push request to do it.

Changing how the battlescape code treats tanks is a different matter and I'm wondering what difficulties lay ahead of actually doing something like this in the code.