Author Topic: Event engine  (Read 2308 times)

De-Legro

  • Honourable King
  • *****
  • Posts: 3838
    • View Profile
Re: Event engine
« Topic Start: March 12, 2019, 09:53:36 AM »
Without some context, this is hard to answer.

Do you mean some sort of scripting that players can access?
Are you referring to a specific pattern like events/emitters?

It has been years since I was a dev with access to the code so take this with a grain of salt. Actions either occur as part of the half turn/turn process in which case they are run in a specific order, things like movement and battles. This code relies on things happening in a certain order which is defined by the order the scripts run in, for example movement occurs first so that we can determine which units will be involved in battles. There are IF THEN cases like Zakky stated, like the function to determine if angry peasants are generated when you enter a enemy region, but they are not called by a generic engine, rather they are simple a check made within the appropriate code.


The other are actions like infil actions, looting, take over actions that are processed when you click. As before many of these have variable outcomes, do you manage to stab your opponent, how badly do you stab them etc. They also call things like the message code to relay results, but again mostly this is all coded within the specific action event.
Previously of the De-Legro Family
Now of representation unknown.