Author Topic: [STAT TRACKING] Soldier Diaries 1.0  (Read 268076 times)

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2409
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1155 on: July 28, 2016, 12:21:54 am »
Some Commendations Programming requests and thoughts:

I'd like to request the ability to externalize some of the criteria code.

One example in particular is the "totalImportantMissions" criteria.  It would be great to be able to assign these mission within the ruleset.

Code: [Select]
  - type: STR_MEDAL_IMPORTANT_MISSIONS_NAME
    description: STR_MEDAL_IMPORTANT_MISSIONS_DESCRIPTION
    sprite: 20
    criteria:
      totalImportantMissions: [3, 5, 10, 15, 20, 25, 30, 35, 40, 50]
      ImportantMissions: [STR_SOME_MISSION, STR_ANOTHER_MISSION, STR_ETC_MISSION]

It would be nice to do the same for totalValientCrux too.

Would it also be possible to normalize the criteria names a bit more?  i.e. Changing totalValientCrux to totalAllCivsSaved or something similar.

I would be willing to take on the effort to normalize the Commendations ruleset like this if you are interested, Shoes.

One other thing, I don't remember if you are tracking this or not, but the Original8 crashes the game with recent nightlies (recent as in 2016).  SupSuper just changed, nerfed it to get the mod compatible with the nightlies version of Soldier Diaries.

Offline Yankes

  • Commander
  • *****
  • Posts: 2374
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1156 on: July 28, 2016, 06:40:52 pm »
I'd like to request the ability to externalize some of the criteria code.

In far future it will be possible in Extended. With my scripts you will able to apply any logic you want.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 6519
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1157 on: July 29, 2016, 11:03:41 am »
In far future it will be possible in Extended. With my scripts you will able to apply any logic you want.

I would be careful with the word "any" :)

Offline Yankes

  • Commander
  • *****
  • Posts: 2374
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1158 on: July 29, 2016, 07:46:37 pm »
I would be careful with the word "any" :)
Of corse it will be limited by things that are exposed to scripts but after that rest will be up to modder.

Offline Shoes

  • Commander
  • *****
  • Posts: 503
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1159 on: July 29, 2016, 11:31:28 pm »
Some Commendations Programming requests and thoughts:

You seem to have gone good work with simplifying things! Regarding renaming variables from the source code: it was something I wanted to do, as I didn't like the source code and the rule set having different names, however if we make that change now, it will break saves for commendations. For example, there is one typo in the source code, I think it's with falling unconcious.... well, it should be unconscious. That was never fixed because of the saves. I think having generic medal names that reflect how they're awarded would be great, and maybe SupSuper can be convinced, but it will break saves. Unless we add more code for "legacy" saves... I would greatly appreciate if you took on the effort to normalize the commendations :) It would take magnitudes longer if I did it!

Regarding the important missions, it would require new code for it to work. The logic would be similar to the custom kill medals, but kill information and mission information are different. I agree that it should be externalized for mods to better take advantage of them. The hardest part will be diving into the layers of logic again ;p haven't been there in a while! But the actual work has been done before. Edit: I forget how the logic currently works, but I think it will be possible to code quite a few varieties of mission medals. Let's say you need "3" missions of A, B, C, you could do (1) A+B+C >= 3, (2) A or B or C  >= 3, (3) A and B and C >= 3.

How would an externalized Valient Crux work? It seems to be awarded when no civilians have died (and a non zero amount has been rescued) in a successful mission. Would you want it to be awarded if all STR_UNIT_RACE survived a mission? Valient Crux is checked in the debriefing state, as not much global mission information like that is saved.

Regarding the Original8, I have only been following development loosely so I don't know about the crashes. Looking at github, it seems like the code is still there? Does it not work? I'll have to take a look when I have time, maybe next week.
« Last Edit: July 29, 2016, 11:35:10 pm by Shoes »

Offline Countdown

  • Colonel
  • ****
  • Posts: 251
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1160 on: August 02, 2016, 06:20:52 am »
One other thing, I don't remember if you are tracking this or not, but the Original8 crashes the game with recent nightlies (recent as in 2016).  SupSuper just changed, nerfed it to get the mod compatible with the nightlies version of Soldier Diaries.
Regarding the Original8, I have only been following development loosely so I don't know about the crashes. Looking at github, it seems like the code is still there? Does it not work? I'll have to take a look when I have time, maybe next week.

I haven't had any problems with the Original 8 ("First to Serve") medal in any nightly I've used. I just tested with the most recent and it worked fine in both UFO and TFTD.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2409
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1161 on: August 02, 2016, 06:28:53 am »
I haven't had any problems with the Original 8 ("First to Serve") medal in any nightly I've used. I just tested with the most recent and it worked fine in both UFO and TFTD.

So you are getting them correctly issued to your starting 8 soldiers?  I'm asking because I'm not sure if you are only saying that you haven't had any crashes.  SupSuper's ruleset gave it a very bogus value to make it not crash the game if I'm following things correctly.

This is his version of the criteria:
Code: [Select]
  - type: STR_MEDAL_ORIGINAL8_NAME
    description: STR_MEDAL_ORIGINAL8_DESCRIPTION
    sprite: 50
    criteria:
      totalLongDistanceHits: [999]
      # Dummy criteria so the game doesn't enter an infinite loop.

Offline Countdown

  • Colonel
  • ****
  • Posts: 251
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1162 on: August 02, 2016, 03:34:47 pm »
So you are getting them correctly issued to your starting 8 soldiers?  I'm asking because I'm not sure if you are only saying that you haven't had any crashes.  SupSuper's ruleset gave it a very bogus value to make it not crash the game if I'm following things correctly.
Yes it is correctly assigned to my first 8 soldiers, as well as not crashing the game.

Is it just not being properly assigned for you in Piratez or is this an issue people are having in UFO as well?
« Last Edit: August 02, 2016, 03:37:17 pm by Countdown »

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2409
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1163 on: August 02, 2016, 03:37:19 pm »
@Countdown: Can you post me a copy of the ruleset you are using for commendations?

Offline Countdown

  • Colonel
  • ****
  • Posts: 251
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1164 on: August 02, 2016, 05:08:17 pm »
Sure, it's attached.

I'm pretty sure I never touched the Original 8 medal. There were some buggy medals I commented out and a couple typos I fixed here and there, but no major changes.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2409
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1165 on: August 02, 2016, 05:19:30 pm »
Hmm... ok.  Looks like Original 8 must be hardcoded, and not generated by the Commendations ruleset.  This makes more sense.   Thanks Countdown!

Offline Shoes

  • Commander
  • *****
  • Posts: 503
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1166 on: August 02, 2016, 08:39:20 pm »
Hmm... ok.  Looks like Original 8 must be hardcoded, and not generated by the Commendations ruleset.  This makes more sense.   Thanks Countdown!

Oops, yeah, I could have told you that :3 I had to give the commendation something to look for, but it is actually hardcoded to be given out when the first base is made. You can change the criteria to anything else you want, naturally. Did you want me to un-hardcode it some way?

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2409
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1167 on: August 02, 2016, 08:50:08 pm »
Heh.  I thought the logic would be more along the lines of:

Initial save game file created: starting crew noted.   
Code: [Select]
commendationName: STR_MEDAL_ORIGINAL8_NAME is recorded.
Commendations code looks for this string and sets
Code: [Select]
"isOriginal8: Yes" (etc)
Commendation criteria in the ruleset uses:
Code: [Select]
    criteria:
      isOriginal8: [1]

The thing is, right now its an arbitrary
Code: [Select]
totalLongDistanceHits: [999]which though it may seem ludicrous, may not be impossible with long campaigns like Piratez, etc. 
So I was just looking for a way to have it specify its own criteria if you know what I mean. :)

Offline Shoes

  • Commander
  • *****
  • Posts: 503
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1168 on: August 03, 2016, 03:13:37 pm »
To be honest, I am not sure why I went the route I did ;p perhaps it seemed simpler at the time?? I'll add it to the list of things I should do the next time I work on this :) There will always be a next time!

edit: I am adding some items to by todo list, but I am still not sure what you want from the Valient Crux changes.
« Last Edit: August 03, 2016, 03:15:43 pm by Shoes »

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2409
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1169 on: August 03, 2016, 03:37:48 pm »
To be honest, I am not sure why I went the route I did ;p perhaps it seemed simpler at the time?? I'll add it to the list of things I should do the next time I work on this :) There will always be a next time!

edit: I am adding some items to by todo list, but I am still not sure what you want from the Valient Crux changes.
For ValientCrux:  basically, rename it to SavedAllCivs, or Protector, or something not as abstract as ValientCrux. etc
;)