Author Topic: [general mechanic] allowing "manufacturing-like" operations on "unique" objects  (Read 4292 times)

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
okay, I admit the title of this is a bit obscure.

what I mean is this:

- currently, "manufacture" operations can use all kinds of "raw materials" and even produce any number of items, to the point that you can add manufacturing jobs that use (for example) a rifle and a scope to manufacture a sniper rifle, as well as using a sniper rifle and "manufacture" a rifle and a scope. this is really cool, because it allows very modular items for mods.

- this does not work for any "object" with a unique ID: craft, for example, or possibly soldiers...? I'd like to see that implemented. possibly via a separate "modify" screen that lets you pick a "unique" item (one with a discreet ID), and shows you the available options for upgrading, like a manufacturing project, listing requirements and costs.

what would this give us?

- the ability to allow craft upgrades: interceptors with alloy plating, with alien-navigation-augmented controls, with UFO-power-source engines...

- the ability to implement stuff like cybernetically-enhanced soldiers. or genetically modified. "Enemy Within", anyone?

- even specialized medical stations, that "use" a wounded soldier as "raw material" (along with some other stuff) and "construct" a healed soldier (in less time than it would take for them to heal normally, preferably).

- special training centers? a "shooting range" facility, in which you can assign "jobs" that take a soldier as "raw material" and use some time to "manufacture" a soldier with better aim? (although the last two might be better for a re-utilization of the psi-lab code).

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
Crafts hasnt unique ID. Crafts has unique pair Name-ID.
Therefore upgrades of crafts is problem now.

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
from a save
Code: [Select]
  STR_SOLDIER: 22
  STR_THUNDERSTORM: 2
  STR_ALIEN_BASE: 2
  STR_CRASH_SITE: 8
  STR_LANDING_SITE: 16
  ALIEN_MISSIONS: 12
  STR_INTERCEPTOR: 3
  STR_SKYRANGER: 2

soldier and craft both have a unique counter so i dont see a difference between them in regard to id creation but i dont know the code that well

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
I admit that I don't understand the precise mechanics behind this... do soldiers actually have a unique ID? if not, what happens if you give two soldiers the same name?

as for craft, how is that name-ID pair made up? is the "ID"-part unique? is it a number?


unless I'm completely mistaken, it shouldn't even be a problem, because the list in the "modify"-screen would simply list the name-ID-pair... the only problem could arise if you change the name of the craft while it is being modified, so that needs to be prevented (by "locking" the craft while it is being modified).

Offline redv

  • Colonel
  • ****
  • Posts: 335
    • View Profile
It's not a mistake. Crafts has unique pair Name-ID bot not unique ID.
https://github.com/SupSuper/OpenXcom/pull/943
https://github.com/SupSuper/OpenXcom/pull/946

But each soldier has unique ID. Therefore soldiers can be upgraded:) No, cannot:( Need rewrite many code.
« Last Edit: September 15, 2014, 11:06:13 pm by redv »

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
i still dont see a problem
There is an Update screen
First Part
Select Type >
 - Soldier
 - Skyranger
 - Interceptor
 - other researched Crafts..

Second Part
Select Unit
soldiernames or craftnames

Third Part
space for additions left = 1
Addition 1 Add
Addition 2 Add
Addition 3 Remove
Addition 4 Add
Addition 5 Add

the three parts could be 3 separate screens or can be combined this problem of the UI design not the logic itself

and i already see we would need more then "space for additions left = 1"

each craft has some form of this in ruleset
each craftrul gets
crafts:
additionspace:
- hullspace: 1
- enginespace: 2
- internalspace: 0
- weaponspace: 0
- armorspace: 0
- mindspace: 0
- bodyspace: 0
- xyzspace: 0

soldiers:
additionspace:
- hullspace: 0
- enginespace: 0
- internalspace: 0
- weaponspace: 0
- armorspace: 2
- mindspace: 1
- bodyspace: 2
- xyzspace: 2


you build new items that have a additioncategory + additionspace assigned
so you can add specific items to the categories some items are bigger some smaller so you can do early bravery+accuracy implement and later replace it with the new 2space psidefense when etherals appear

what addition categories can go where depends on the modder decision you can have 8 slots for craft modifying but no additions for soldier is vis versa or something between


Offline Dioxine

  • Commander
  • *****
  • Posts: 5420
  • punk not dead
    • View Profile
    • Nocturnal Productions
Good summary, Falko (and actually a perfect solution). However as far as crafts are concerned, modular upgrades can be implemented through "4-weapon mechanics" (I know, this is still only available in Extended, but it does exist).

If it's ever implemented, though, I'd happily draw a GUI for it (daaamn. Syndicate and XCom merged. My old dreams coming true)
« Last Edit: September 15, 2014, 11:38:04 pm by Dioxine »

Offline Random Commander

  • Captain
  • ***
  • Posts: 89
  • Making no sense since 1997
    • View Profile
Syndicate and XCOM you say?

Next thing you know your XCOM units will be hijacking nearby civilian vehicles and you will give out weapons to mass amounts of mind-controlled civilians.


....Hey, not a bad idea! Lets just hope the 4-man limit in Syndicate is not implemented.