aliens

Author Topic: Don't bring a knife to a gunfight  (Read 11483 times)

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Don't bring a knife to a gunfight
« Reply #15 on: January 22, 2016, 10:50:30 am »
What about adding ruleset commands allowing to set defaults on all those? It'd be just not worth it to change every weapon and armor entries if all you want is eg. 100 reaction chance from target, 0 from others. Same goes for deafult var values on overkill, btw.

Offline Yankes

  • Commander
  • *****
  • Posts: 3163
    • View Profile
Re: Don't bring a knife to a gunfight
« Reply #16 on: January 22, 2016, 06:13:35 pm »
I thinking about sharing values between nodes in ruleset file. Overall some implementation of yaml support mechanisms of merging nodes:
Code: [Select]
nodeA: &ref
  a: 1
  b: 2
nodeB:
  <<: *ref
  a: 2
#nodeB is equal
#  a:2
#  b:2
but yaml-cpp don't support this yet. But we can recreate this behavior manually.
Something like that:
Code: [Select]
nodeA: &ref1
  a: 2
  b: 1
nodeB: &ref2
  parent: *ref1
  c: 3
  #now its load values `a: 2`, `b: 1` and `c: 3`
nodeC:
  parent: *ref2
  #now its have too `a: 2`, `b: 1` and `c: 3`
Only thing I dislike in this solution is that break compatibility with basic OXC, because If you put standard required properties in that shared node then when downgrading to basic OXC game will crash because it will lack required nodes. Overall if I manage sneak in this to nightly then I will probably use this too in my extended version.

Solution with global values have one big drawback, it can be only one value. Two mods could conflict when both will try override one value.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Don't bring a knife to a gunfight
« Reply #17 on: January 22, 2016, 08:38:29 pm »
Solution with global values have one big drawback, it can be only one value. Two mods could conflict when both will try override one value.

So two mods can conflict. And the sky is blue. Any other news? :) Besides, won't the last one in order simply override the value & no problem? Also I was proposing to do it both ways, per-item and global, the first overriding the last.

Offline Yankes

  • Commander
  • *****
  • Posts: 3163
    • View Profile
Re: Don't bring a knife to a gunfight
« Reply #18 on: January 23, 2016, 02:40:42 am »
Adding globals isn't global enough solution for me :> It will work only in your case when you want all items behave same. And only for this two properties.
I prefer solution that will work for all properties and for all types.

After couple of hours of work I finished this for nearly all types in ruleset. Thanks to this now is possible to have limited inheritance of properties between objects.
Its "limited" because parent object need be defined in that same file.

Code: [Select]
items:
  - &refA
    type: TEST_A
    transferTime: 100
    clipSize: 5
  - nodeRef: *refA
    type: TEST_B
  - nodeRef: *refA
    type: TEST_C
  - &refD
    nodeRef: *refA
    type: TEST_D
    clipSize: 6
  - nodeRef: *refD
    type: TEST_E
now `TEST_E` will have `transferTime: 100` and `clipSize: 6`.