What is Event?

How to create an event

<aside> đź’ˇ

We recommend 7-digit ID starting with 53. However, modders may use any unused 7-digit ID. As long as it doesn't conflict with existing ones.

</aside>

126dd5dc-e2c5-45d7-a77a-bb61a2db73af.png

Data structure for event

--------------Here is a complete event structure-----------------------
{
        "id": 5300002, //Unused 7-digit id starting with 53
        "text": "Seeking Temple Aid", //Comments for designer      
        "is_replay": 0, //whether it can trigger repeatedly (actions not executed don't count as triggers)
        "auto_start": false, 
        // During game initialization (new game), determines if activated by default. "false” means not activated
        // To activate by default in tutorial phase (when Sultan plays Sultan cards), change to "auto_start_init": [0],
        // To activate by default in main phase (when Protagonist plays Sultan cards), change to "auto_start_init": [1],        
        "start_trigger": true,
         // When this event activates, whether to skip timing and immediately check conditions to execute actions. "true" means yes
         Change to false to not skip timing.
        "on":{   //After event activation, checks conditions and executes actions when trigger timing is met
            "round_begin_ba": 1 
            //Select available trigger timing based on design needs
            //If multiple triggers are set, meeting any one of them will start condition checking
        },
        "condition": {  // When triggers are met, begins condition checking
            "table_have.2000021":1  
            //Select available condition based on design needs
            //Can set multiple conditions and flexibly use any, all etc.
            //If left empty, considered as conditions met
        },
        "settlement": [ //When conditions met, executes specific actions
            {
                "tips_resource":"", //Parameter must remain but unused (no need to set)
                "tips_text":"", //Parameter must remain but unused (no need to set)
                "action":{  //Executes specific actions
                    "rite":5000508
                    //Select available action based on design needs
                    //Can set multiple actions and flexibly use choose, delay etc.
                }
            }

        ]
    }

How to set initial events for the opening game (the Sultan playing Sultan cards phase) and main game (protagonist playing Sultan cards phase)

Example 1: Using event to generate a rite

Example: When the protagonist's Renown reaches 10, generate ritual 5000011 (triggers only once)
--------------Here is a complete event structure-----------------------
{
        "id": 5300001, //unused 7-digit id starting with 53
        "text": "Seeking Temple Aid", //Comments for designer      
        "is_replay": 0, //Whether it can trigger repeatedly
        "auto_start_init": [1], //Activated by default        
        "start_trigger": false, //No immediate condition check
        "on":{
            "round_begin_ba": 1 //Checks conditions at round start when activated
        },
        "condition":{
            "counter.7100001":10 //Check if Renown ≥10
        },
        "settlement": [ //When conditions met, executes specific actions
            {
                "tips_resource":"", 
                "tips_text":"", 
                "action":{
                    "rite":5000011 //generate a ritual
                }
            }
        ]
    }

Example 2: Using event to generate a prompt(popup)

Example: When the protagonist's Renown reaches 10, generate the popup(triggers repeatly every 3-5 rounds)
--------------Here is a complete event structure-----------------------
{
        "id": 5300002,
        "text": "Seeking Temple Aid", //Comments for designer      
        "is_replay": 1, //Triggers repeatly
        "auto_start_init": [1], //Activated by default        
        "start_trigger": false, //No immediate condition check
        "on":{
            "round_begin_ba": [3,5]  //start of each 3-5 rounds
        },
        "condition":{
            "counter.7100001":10 //Check if Renown ≥10
        },
        "settlement": [ //When conditions met, executes specific actions
            {
                "tips_resource":"", 
                "tips_text":"", 
                "action":{
                    "prompt":{
                        "id":"5300002_prompt_01", 
                        //Prompt id, no strict format, just needs to be unique
                        “text”:”You are so kind", //Prompt text (supports rich text)
                        "icon":["cards/2000123","cards/2000001"]
                        //Can set background images based on design needs. Optional
                        //positioned left-center-right when multiple images(up to 3) are used
                    }
                }
            }
        ]
    }

Example 3: Using event to generate a option(option popup)

Example: When the protagonist's Renown < 10, generate the option popup(triggers repeatly every 3-5 rounds)
--------------Here is a complete event structure-----------------------
{
        "id": 5300003,
        "text": "Seeking Temple Aid", //Comments for designer      
        "is_replay": 1, //Triggers repeatly
        "auto_start": false, //Deactiviated by default        
        "start_trigger": false, //No immediate condition check
        "on":{
            "round_begin_ba": [3,5]  //start of each 3-5 rounds
        },
        "condition":{
            "counter.7100001<":10 //Check if Renown <10
        },
        "settlement": [ //When conditions met, executes specific actions
         {
            "tips_resource":"", 
            "tips_text":"",
            "action":{
                "option":{
                    "id":"5300003_option_01", //ID for Option popup
                    "text":"You encounter a lady asking for help on the road", //Text for option popup
                    "icon":"cards/2000123", //Background for Option popup
                    "items": [
                        {
                            "text": "Ignore her", //Text for option 1
                            "tag": “op1"    //Tag for option 1
                        },
                        {
                            "text": “Help her", //Text for option 2
                            "tag": “op2"    //Tag for option 2
                        }
                    ]
                },
                "case:op1": { //Action for selecting option 1
                    //Select available action based on design needs
                    //Can set multiple actions and flexibly use choose, delay etc.
                    "prompt":{
                        "id":"5320036_prompt_01",
                        "text":"Nothing happens.",
                    }
                },
                "case:op2": {
                    "counter+7100004": 1, //Notoriety+1
                    "prompt":{
                        "id":"5320036_prompt_02",
                        "text":"She thanks you.",
                    }
                }
            }
        ]
    }

Example 4:How to set a complicated event