aliens

Author Topic: Add new research available messages  (Read 9594 times)

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Add new research available messages
« on: July 24, 2013, 03:44:30 am »
Is there any way to generate messages that say when new research is available?  For instance, after you research Laser Cannon, you get a window that says "You can now research Laser Defense".  I don't see anywhere in the ruleset where that is generated.  I've successfully set up a research option to Tank/Laser Cannon so that you have to research the topic before you can build the HWP. And the topic appears at the bottom of the research selection screen.  However, I can't get the game to say "You can now research Laser Defense and Tank/Laser Cannon." 

I've tried setting up the following in the research section:

  - name: STR_TANK_LASER_REQ
    cost: 0
    points: 0
    dependencies:
      - STR_ALIEN_ALLOYS
      - STR_LASER_CANNON
    unlocks:
      - STR_TANK_LASER_CANNON

and it works, but no messages.

I've added the necessity to research the item because at the same time I've changed the armor of the Tank/Laser to be similar to the Hovercraft, so there's a benefit to actually building them.  Not a big deal, but it would be nice to have messages pop up given changes to the research tree.  Maybe it's hard-coded thing. 

BTW, I know you can just put the dependencies in the entry for Tank/Laser but hoped the above code would help with the message issue.  Still haven't quite figured out why sometimes the ruleset uses code as above, and other times it just lists the dependencies.

Thanks for any help.

Offline xracer

  • Commander
  • *****
  • Posts: 565
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: Add new research available messages
« Reply #1 on: July 24, 2013, 07:49:35 am »
I believe this is what comes up on the pop-up

    unlocks:
      - STR_TANK_LASER_CANNON

if you have multiple items then it shoudl be

    unlocks:
      - STR_TANK_LASER_CANNON
      - STR_LASER_DEFENSE

maybe that is not what you mean, but i think that will case the game to display
"You can now research Tank/Laser Cannon and Laser Defense."

I haven't tested myself i am doing a few changes myself to the whole research tree but i am in testing phase just yet.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Add new research available messages
« Reply #2 on: July 24, 2013, 12:21:28 pm »
cost needs to be over 0 in order for it to pop up.

Offline wsmithjr

  • Colonel
  • ****
  • Posts: 149
    • View Profile
Re: Add new research available messages
« Reply #3 on: July 25, 2013, 02:54:11 am »
if you have multiple items then it shoudl be

    unlocks:
      - STR_TANK_LASER_CANNON
      - STR_LASER_DEFENSE

maybe that is not what you mean, but i think that will case the game to display
"You can now research Tank/Laser Cannon and Laser Defense."

Yep, tried exactly that but it ignored it.

cost needs to be over 0 in order for it to pop up.

And now I know why.  That answers the question.  Now to see if I can reconfigure it and make it work the way I want.

Thanks for the help.

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Add new research available messages
« Reply #4 on: August 03, 2013, 06:14:03 pm »
I'm having the same issue after making alien containment depend on performing an autopsy:
Code: [Select]
  - name: STR_SECTOID_AUTOPSY
    cost: 1
    points: 50
    needItem: true
    unlocks:
      - STR_ALIEN_CONTAINMENT
  - name: STR_SNAKEMAN_AUTOPSY
    cost: 1
    points: 50
    needItem: true
    unlocks:
      - STR_ALIEN_CONTAINMENT
...and so on
Got everything else to work, but it's not showing up in the "we can now research" message.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Add new research available messages
« Reply #5 on: August 03, 2013, 06:44:44 pm »
I guess you have to set the "cost" for your alien containment to >0, right? because if you don't, it will just be available for building after you researched a body (instead of being available for research).

Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Add new research available messages
« Reply #6 on: August 03, 2013, 08:28:03 pm »
Yeah I've got a research entry and etc too:
Code: [Select]
facilities:
  - type: STR_ALIEN_CONTAINMENT
    requires:
      - STR_ALIEN_CONTAINMENT
    spriteShape: 1
    spriteFacility: 25
    buildCost: 400000
    buildTime: 18
    monthlyCost: 15000
    aliens: 10
    mapName: XBASE_08

research:
  - name: STR_ALIEN_CONTAINMENT
    cost: 50
    points: 15
    dependencies:
      - STR_SECTOID_AUTOPSY
      - STR_SNAKEMAN_AUTOPSY
      - STR_FLOATER_AUTOPSY
      - STR_MUTON_AUTOPSY
      - STR_ETHEREAL_AUTOPSY
      - STR_CHRYSSALID_AUTOPSY
      - STR_REAPER_AUTOPSY
      - STR_CELATID_AUTOPSY

ufopaedia:
  - id: STR_ALIEN_CONTAINMENT
    type_id: 6
    section: STR_BASE_FACILITIES
    requires:
      - STR_ALIEN_CONTAINMENT
    text: STR_ALIEN_CONTAINMENT_UFOPEDIA


Offline Align

  • Colonel
  • ****
  • Posts: 196
    • View Profile
Re: Add new research available messages
« Reply #7 on: December 01, 2013, 01:29:20 pm »
Still have this problem. Decided to rename string to be less ambiguous, works fine, but still don't get the research prompt after performing any autopsy; it just silently becomes available.
Code: [Select]
facilities:
  - type: STR_ALIEN_CONTAINMENT
    requires:
      - STR_ALIEN_CONTAINMENT_RESEARCH

research:
  - name: STR_ALIEN_CONTAINMENT_RESEARCH
    cost: 150
    points: 15
    dependencies:
      - STR_SECTOID_AUTOPSY
      - STR_SNAKEMAN_AUTOPSY
      - STR_FLOATER_AUTOPSY
      - STR_MUTON_AUTOPSY
      - STR_ETHEREAL_AUTOPSY
      - STR_CHRYSSALID_AUTOPSY
      - STR_REAPER_AUTOPSY
      - STR_CELATID_AUTOPSY
  - name: STR_SECTOID_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH
  - name: STR_SNAKEMAN_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH
  - name: STR_FLOATER_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH
  - name: STR_MUTON_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH
  - name: STR_ETHEREAL_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH
  - name: STR_CHRYSSALID_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH
  - name: STR_REAPER_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH
  - name: STR_CELATID_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH
  - name: STR_SILACOID_AUTOPSY
    unlocks:
      - STR_ALIEN_CONTAINMENT_RESEARCH

ufopaedia:
  - id: STR_ALIEN_CONTAINMENT
    type_id: 6
    section: STR_BASE_FACILITIES
    requires:
      - STR_ALIEN_CONTAINMENT_RESEARCH
    text: STR_ALIEN_CONTAINMENT_UFOPEDIA

extraStrings:
  - type: English
    strings:
      STR_ALIEN_CONTAINMENT_RESEARCH: Alien Containment

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Add new research available messages
« Reply #8 on: May 19, 2014, 07:59:58 pm »
Hi,

I am not sure my solution will be suitable to you, but this way I do not meet anymore issue you are describing, so perhaps will you find why it does not display from your side after have a look at this

Some screen shots


1) No Alien Detention available at start
2) Researching Sectoid Corpse will announce "Alien Detention" as available.

« Last Edit: May 19, 2014, 08:17:12 pm by Aldorn »

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Add new research available messages
« Reply #9 on: May 19, 2014, 08:13:32 pm »
"Alien Detention" is different from "Alien Containment", as it is only describing the way to "Alien Containment".

This is about like your "Alien Biology", except it will point out needed alien researches to reach "Alien Containment"

For testing purposes, I only activated "Alien Food"

Once you successfully researched "Alien Detention", suppose you bring back an "Alien Food" from a mission : you know you have to search for it, what you do

You can observe it announces "Alien Containment"

EDIT : I just tested it with "Alien Food" and "Alien Entertainment", it works too
« Last Edit: May 19, 2014, 08:20:15 pm by Aldorn »

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Add new research available messages
« Reply #10 on: May 19, 2014, 08:16:19 pm »
Then you are allowed to research "Alien Containment"

I attached the version with two depedencies "Alien Food" and "Alien Entertainment"
« Last Edit: May 19, 2014, 08:22:02 pm by Aldorn »