Meridian
Following your advice, I created an event system to trigger expected training tickets ("gym event")
1. An eventScript triggers a monthly event
2. This monthly event provides 5 training tickets
3. Training ticket is declared as an item that will be stored in the database (with no attributes, will see later if needed ; I made tests with some attributes but it does not change the error message)
4. Some extraStrings
Spoiler:
eventScripts:
- type: STR_TRAINING_TICKET_MONTHLY_EVENT_SCRIPT
facilityTriggers:
STR_TRAINING_ROOM
eventWeights:
0:
STR_TRAINING_TICKET_MONTHLY_EVENT: 100
firstMonth: 0
lastMonth: -1
executionOdds: 100
events:
- name: STR_TRAINING_TICKET_MONTHLY_EVENT
description: STR_TRAINING_TICKET_DESCRIPTION
everyItemList: [STR_TRAINING_TICKET,STR_TRAINING_TICKET,STR_TRAINING_TICKET,STR_TRAINING_TICKET,STR_TRAINING_TICKET]
items:
- type: STR_TRAINING_TICKET
extraStrings:
- type: en-US
strings:
STR_TRAINING_TICKET: "Lorem ipsum"
STR_TRAINING_TICKET_MONTHLY_EVENT: "Lorem ipsum dolor sit amet"
STR_TRAINING_TICKET_DESCRIPTION: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
- type: fr
strings:
STR_TRAINING_TICKET: "Lorem ipsum"
STR_TRAINING_TICKET_MONTHLY_EVENT: "Lorem ipsum dolor sit amet"
STR_TRAINING_TICKET_DESCRIPTION: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
Then I added this training ticket as required item in soldierTranformations
Unfortunately, it causes following error message
I tried to change the way to declare requiredItems (with or without brackets, the line after, the line after but with a minus... with same result)
F:/OXCE/OXCE V7.8 HellMod/user/mods/HellMod/Ruleset/050_Facilities_TagSoldierTransformation.rul: Error for 'STR_TRAINING_SURVIVAL1': wrong node type, expected a map at line 28
(Line
28 is always the line before the one containing
requiredItems; in this case, the line 28 is
soldierBonusType: STR_SB_TRAINING_SURVIVAL1; if I put requiredItems just after
name: STR_TRAINING_SURVIVAL1, the involved line will be the one containing
name)
Another question (in case I solve error above): would you have any idea how I could delete each month unused training tickets
Meaning: aim is to allow a "maximum" of 5 training per month but do not store unused training tickets
Example:
Month M: it generates 5 training tickets
Let's assume I train 2 soldiers, so I consume 2 training tickets (and so 3 remaining training tickets)
Month M+1: it generates 5 new training tickets
=> I would like to be able to use only 5 training tickets (and not : 8 training tickets = 5 new TT + 3 old TT)
Thanks in advance for your "science"