aliens

Author Topic: Manufacturing a Craft from a Craft.  (Read 2159 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Manufacturing a Craft from a Craft.
« on: December 04, 2017, 07:17:23 pm »
I was not sure if this is how OpenXcom is intended to work or if it is a bug but I thought it may be of interest to others who are trying to construct a mod so I'm posting the information here.


If you try to create a manufacturing project that uses a craft as required source material and the end product is also a craft, there is no problem if you write the code like this:

Code: [Select]
manufacture:
  - name: STR_INTERCEPTOR_TO_SKYRANGER
    category: STR_CRAFT
    space: 28
    time: 1200
    cost: 220000
    requiredItems:
      STR_INTERCEPTOR: 1
    producedItems:
      STR_SKYRANGER: 1

However, you MUST have the manufacturing category be STR_CRAFT. If instead you attempt the following code:
Code: [Select]
manufacture:
  - name: STR_INTERCEPTOR_TO_SKYRANGER
    category: STR_CUSTOM_CATEGORY
    space: 28
    time: 1200
    cost: 220000
    requiredItems:
      STR_INTERCEPTOR: 1
    producedItems:
      STR_SKYRANGER: 1

The custom category will produce the following error:
Code: [Select]
[04-12-2017_11-54-59] [FATAL] A fatal error has occurred: Item STR_SKYRANGER not found
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom13CrossPlatform10stackTraceEPv+0x1e) [0x824301e]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom13CrossPlatform9crashDumpEPvRKSs+0x444) [0x8243834]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_Z15exceptionLoggerv+0x5f) [0x80f1f1f]
[04-12-2017_11-54-59] [FATAL] /usr/lib/i386-linux-gnu/libstdc++.so.6(+0x70833) [0xb7393833]
[04-12-2017_11-54-59] [FATAL] /usr/lib/i386-linux-gnu/libstdc++.so.6(+0x708ad) [0xb73938ad]
[04-12-2017_11-54-59] [FATAL] /usr/lib/i386-linux-gnu/libstdc++.so.6(__cxa_rethrow+0) [0xb7393b70]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZNK8OpenXcom3Mod7getRuleINS_8RuleItemEEEPT_RKSsS6_RKSt3mapISsS4_St4lessISsESaISt4pairIS5_S4_EEEb+0x16b) [0x84397cb]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZNK8OpenXcom3Mod7getItemERKSsb+0x62) [0x8411232]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom20ManufactureInfoState14initProfitInfoEv+0xcc) [0x812766c]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom20ManufactureInfoState7buildUiEv+0x1668) [0x8129d48]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom20ManufactureInfoStateC2EPNS_4BaseEPNS_15RuleManufactureE+0x3d) [0x812b0ad]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom21ManufactureStartState13btnStartClickEPNS_6ActionE+0x41a) [0x812d50a]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom18InteractiveSurface6handleEPNS_6ActionEPNS_5StateE+0x1a2) [0x8261892]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom5State6handleEPNS_6ActionE+0x7b) [0x83028eb]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(_ZN8OpenXcom4Game3runEv+0x2e8) [0x825c848]
[04-12-2017_11-54-59] [FATAL] /tmp/.mount_OpenXc8hpJ9e/usr/bin/openxcom(main+0x165) [0x80dc215]
[04-12-2017_11-55-05] [FATAL] OpenXcom has crashed: Item STR_SKYRANGER not found
Extra information has been saved to openxcom.log.


What I believe this means is that when the manufacturing project Category is not set to STR_CRAFT the producedItems: needs to be an entry listed under items: not one list under the crafts: entries.
« Last Edit: December 04, 2017, 07:19:16 pm by The Martian »