Author Topic: getOneFree --> getAllFree ..?  (Read 5077 times)

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
getOneFree --> getAllFree ..?
« on: May 19, 2014, 05:57:52 pm »
Would it be possible* to add a “getAllFree:” entry for the researches?
Like “getOneFree”, but you get all the things listed, instead of just one (and you get them with 100% chance).

* I mean “easily, reasonably quickly and effortlessly, possible”.

Thanks.

(Maybe there's already a way to do it, and I just haven't noticed).

Offline kkmic

  • Commander
  • *****
  • Posts: 582
  • Undefined
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #1 on: May 19, 2014, 06:00:07 pm »

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #2 on: May 19, 2014, 06:25:01 pm »
I may be misunderstanding your suggestion, but I don't need it for testing purposes.

I want to make researches that make the player access multiple things at once. Things that could be also normally researched one by one, separately.
Example:

  - name: STR_ALIEN_WEAPON1
    cost: 200
    need item: true
    bla bla

  - name: STR_ALIEN_WEAPON2
    cost: 150
    need item: true
    bla bla

  - name: STR_ALIEN_CRAFT_THING1
    cost: 300
    need item: true
    bla bla

  - name: STR_ALIEN_SCIENTIST_INTERROGATION
    cost: 500
    getAllFree:
      - STR_ALIEN_WEAPON1
      - STR_ALIEN_WEAPON2
      - STR_ALIEN_CRAFT_THING1

I could detail why I'd like to have this feature, but it's a bit long.
« Last Edit: May 19, 2014, 06:26:39 pm by robin »

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #3 on: May 19, 2014, 06:51:59 pm »
workaround: cheap "enabler" tech
  - name: STR_ALIEN_WEAPON1
    cost: 200
    need item: true
    bla bla

  - name: STR_ALIEN_WEAPON2
    cost: 150
    need item: true
    bla bla

  - name: STR_ALIEN_CRAFT_THING1
    cost: 300
    need item: true
    bla bla

  - name: STR_ALIEN_SCIENTIST_INTERROGATION
    cost: 500
    unlocks:
      - STR_ALIEN_WEAPON1_ENABLER
      - STR_ALIEN_WEAPON2_ENABLER
      - STR_ALIEN_CRAFT_THING1_ENABLER

  - name: STR_ALIEN_WEAPON1_ENABLER
    lookup: STR_ALIEN_WEAPON1
    cost: 1
    depends: [STR_ALIEN_ONLY]
  - name: STR_ALIEN_WEAPON2_ENABLER
    lookup: STR_ALIEN_WEAPON2
    cost: 1
    depends: [STR_ALIEN_ONLY]
  - name: STR_ALIEN_CRAFT_THING1_ENABLER
    lookup: STR_ALIEN_CRAFT_THING1
    cost: 1
    depends: [STR_ALIEN_ONLY]


Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #4 on: May 19, 2014, 07:04:59 pm »
workaround: cheap "enabler" tech
I knew I could do something like this, the "getAllFree" was to make the thing elegant (no extra researches).
But yeah, ONLY if it is super-quick-easy to implement; otherwise this kind of workaround would be ok.

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #5 on: May 19, 2014, 07:13:18 pm »
I confirm this would be useful

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #6 on: May 19, 2014, 07:26:27 pm »
i would prefer a solution that repeats the unlock/getonefree/lookup not once per research but as often as needed until there is no change anymore
that way you can get
Code: [Select]
  - name: STR_ALIEN_SCIENTIST_INTERROGATION_STEP1
    cost: 0
    dependencies:[STR_ALIEN_SCIENTIST_INTERROGATION]
    getonefree:
      - STR_ALIEN_WEAPON1
  - name: STR_ALIEN_SCIENTIST_INTERROGATION_STEP2
    cost: 0
    dependencies:[STR_ALIEN_SCIENTIST_INTERROGATION]
    getonefree:
      - STR_ALIEN_WEAPON2
  - name: STR_ALIEN_SCIENTIST_INTERROGATION_STEP3
    cost: 0
    dependencies:[STR_ALIEN_SCIENTIST_INTERROGATION]
    getonefree:
      - STR_ALIEN_CRAFT_THING1

but it is more flexible than just a "getallfree" option

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #7 on: May 19, 2014, 07:44:14 pm »
i would prefer a solution that repeats the unlock/getonefree/lookup not once per research but as often as needed until there is no change anymore
that way you can get
Code: [Select]
  - name: STR_ALIEN_SCIENTIST_INTERROGATION_STEP1
    cost: 0
    dependencies:[STR_ALIEN_SCIENTIST_INTERROGATION]
    getonefree:
      - STR_ALIEN_WEAPON1
  - name: STR_ALIEN_SCIENTIST_INTERROGATION_STEP2
    cost: 0
    dependencies:[STR_ALIEN_SCIENTIST_INTERROGATION]
    getonefree:
      - STR_ALIEN_WEAPON2
  - name: STR_ALIEN_SCIENTIST_INTERROGATION_STEP3
    cost: 0
    dependencies:[STR_ALIEN_SCIENTIST_INTERROGATION]
    getonefree:
      - STR_ALIEN_CRAFT_THING1

but it is more flexible than just a "getallfree" option

The workarounds and this method (provided I understood it correctly) multiply the number of research entries, making more difficult to keep track of things (so: harder to apply changes, harder to debug, more prone to bugs).
For large mods/total conversions, where you have wholly new/modified research trees, a "getAllFree" is simpler to use: you just list the stuff you want under it and you're done for that one research.
« Last Edit: May 19, 2014, 07:51:10 pm by robin »

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #8 on: May 19, 2014, 07:53:30 pm »
this method would not increase the amount of (in game) visible entries but would allow for an easy
2 out of 4 alien rooms needed for X
one scout+one "large" ufo needed for Y
research firestorm with while having researched A,B,C is faster than researching it without (it but possible without it) ...
if one discusses internal changes to the research stuff i prefer flexibility against the-one-thing-i-need-just-now

Offline robin

  • Commander
  • *****
  • Posts: 1203
  • ULTIMATE ROOKIE
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #9 on: May 19, 2014, 09:24:51 pm »
this method would not increase the amount of (in game) visible entries but would allow for an easy
2 out of 4 alien rooms needed for X
one scout+one "large" ufo needed for Y
research firestorm with while having researched A,B,C is faster than researching it without (it but possible without it) ...
if one discusses internal changes to the research stuff i prefer flexibility against the-one-thing-i-need-just-now
I came up with "getAllFree" idea because it "sounded" (to me code-noob) a very easy thing to do:

"Hey, since there's already a 'getOneFree' option, would it be possible to super-quickly add a 'getAllFree' one?"

"Yes." --> "Cool!"
"No." --> "No problem, there's also a workaround, I'll be fine with that."

I agree about flexibility and extra options being better than this quick "what-I-need" bit (and I now understand fully what you method enables, which would be indeed cool), but I personally never intended the extent of my request to grow further than this.

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: getOneFree --> getAllFree ..?
« Reply #10 on: May 20, 2014, 02:10:23 pm »