aliens

Author Topic: TFTD 2-in-1 UFOpedia Issue *SOLVED*  (Read 2470 times)

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
TFTD 2-in-1 UFOpedia Issue *SOLVED*
« on: March 11, 2016, 12:48:05 am »
So one of the last things I wanted to do for TFTD was integrate weapons/clips for Gauss & Alien tech into one UFOpedia page, like so (just one example, same for all the rest):



Alas, I encountered a problem. See, TFTD pedia entries require distinct images_id, whereas UFO/EU does not. I guess that's the problem? In UFO/EU, I simply make research of Laser Pistol unlock both weapon and clip for pedia and it displays just fine: the weapon with its statistics (fire mode, TU, accuracy) and the clip with its power value and damage type all on the same page. This is basically the same as vanilla, of course, except what I do is remove the secondary "clip page" so that everything is confined to just the main/weapon page itself (no need for two pages or two separate researches, I say, when you can do everything in one).

In TFTD, however, although I can have Gauss Pistol unlock both weapon and clip, I can either have it pull up the weapon statistics page (with the above image) or the clip type/power page (with the same image above, if I want). The problem is either one will be lacking the other's info. I mean, the whole purpose behind this was to simplify everything into one page!

I still don't understand how vanilla TFTD manages to add the "GAUSS BEAM X DAMAGE" piece of text from the clip into the main weapon page after the clip is researched. That's exactly what I'm missing, and it seems I can only get it from researching the clip properly.

I even tried having Gauss Pistol unlock the clip with cost:0 (to override it appearing in the research screen and make it count as being researched as opposed to simply removing clip research altogether and unlocking everything through the weapon itself), but that's still not doing it.

I hope that's been clear enough!

How can I solve this?

I need a lifesaver :)

--- posts merged ---

Unless there is another way around it, I guess I must resolve to putting the DAMAGE TYPE X on the image_id itself:



Problem is, of course, that if you want to change the damage type or power later you'd have to create a new image_id with the new values. At least it's a makeshift solution for the time being.

Modding UFO/EU is so much easier.
« Last Edit: March 12, 2016, 04:10:23 am by Solarius Scorch »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2337
  • Developer
    • View Profile
    • Email
Re: TFTD 2-in-1 UFOpedia Issue
« Reply #1 on: March 11, 2016, 04:39:48 pm »
TFTD's ufopaedia is significantly different, i'm not sure off the top of my head if what you're trying is possible

Offline chaosshade

  • Colonel
  • ****
  • Posts: 175
  • The Harpy
    • View Profile
Re: TFTD 2-in-1 UFOpedia Issue
« Reply #2 on: March 11, 2016, 07:36:27 pm »
It is possible, XOps has it set up that way in his weapon addition mods for TFTD, take a look at his code.

Link here:  https://openxcom.org/forum/index.php/topic,4205.0.html

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: TFTD 2-in-1 UFOpedia Issue
« Reply #3 on: March 11, 2016, 09:01:56 pm »
It is possible, XOps has it set up that way in his weapon addition mods for TFTD, take a look at his code.

Thanks, that did it! The trick was adding section: STR_NOT_AVAILABLE to all clips/ammo. This makes them invisibly "unlocked" from the start without showing up anywhere, so when you research the weapon itself and the UFOpedia entry comes up, it'll include the corresponding clip damage/power.

The wonderful capabilities OpenXcom don't cease to surprise me <3