Done with Expressions (for the most part...)


This weekend I finally managed to implement the last feature for mod expression parsing which was function attributes. It turned out to be much more complicated than expected, having to rewrite quite a bit of what I had done before just to get all expression elements to work together. I also had to deal with a host of issues unrelated to the project this weekend. So I didn't have as much time to spend working on the feature as I wanted. Regardless, that is done and now I will start working on implementing a test event using the new mod expressions. Though it's very likely I'll need keep modifying and adding to the expression system since there are still many minor details that I haven't taken care of. Nevertheless, mod expressions will no longer be the focus for this feature from here on.

Anyway, here's the example event mod I'm going to try to implement using some of the new modding tools. In this case, the intention is to create an event that will trigger the clan split decision. The expression system will be used to define the conditions, time to trigger, and the effects.

    {
      "id": "clan_split",
      "name": "clan split",
      "target": "faction",
      "assignmentConditions": ["faction.type == clan"],
      "triggerConditions": [
        "faction.administrative_load > 0.5",
        "faction.preference.cohesion < 0.7"
      ],
      "timeToTrigger": "91250 * (1 - faction.administrative_load) * faction.preference.cohesion",
      "effects": [
        "target.trigger_decision(clan_split)"
      ]
    }

Hopefully this will not be the only thing I get to work on next week and I'll be able to work on the clan split decision too. Time will tell though.

Get Worlds - History Simulator

Leave a comment

Log in with itch.io to leave a comment.