Author Topic: Adding a research requirement to Items that you can purchase?  (Read 3203 times)

Offline KyronStarkiller

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Adding a research requirement to Items that you can purchase?
« on: December 13, 2016, 01:30:38 am »
Is it possible to add a research requirement to Items that you can purchase?
For example can I create an research project "Advanced Training" which would then allow me to hire a special forces soldier.
Or another thought would be research "Titanium/Kevlar Alloy" then be able to buy Body Armor.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11490
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Adding a research requirement to Items that you can purchase?
« Reply #1 on: December 13, 2016, 01:46:13 am »
Not in the vanilla game, but you can do it in OXCE and OXCE+ versions.

Offline KyronStarkiller

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Adding a research requirement to Items that you can purchase?
« Reply #2 on: December 13, 2016, 01:47:24 am »
Ok that's cool thanks for the rapid answer.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2161
    • View Profile
Re: Adding a research requirement to Items that you can purchase?
« Reply #3 on: December 13, 2016, 02:57:04 am »
Not in the vanilla game, but you can do it in OXCE and OXCE+ versions.
This is definitely in vanilla: https://github.com/SupSuper/OpenXcom/blob/master/src/Basescape/PurchaseState.cpp#L200

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11490
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Adding a research requirement to Items that you can purchase?
« Reply #4 on: December 13, 2016, 03:03:19 am »
Oh, sorry for the mislead! From what I understand now, OXCE only allows you to set a different research for buying than for using.

Offline KyronStarkiller

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: Adding a research requirement to Items that you can purchase?
« Reply #5 on: December 13, 2016, 09:16:34 am »
Well I will give this a try and see how it goes.

--- posts merged - Solarius Scorch ---

This is definitely in vanilla: https://github.com/SupSuper/OpenXcom/blob/master/src/Basescape/PurchaseState.cpp#L200

Thank you SupSuper and Solarius Scorch!

I was able to successfully test this modification. By adding a starting research project (Improved Avionics),  which leads to (Avalanche System).
The Avalanche Ufopedia, and the buyable launcher and missile disappeared from the list. Until the (Avalanche System) research was complete.

That was exactly what I wanted.
« Last Edit: December 13, 2016, 11:40:48 am by Solarius Scorch »