Author Topic: Event engine  (Read 366 times)

Ocean Yong Kiran

  • Knight
  • **
  • Posts: 83
    • View Profile
Event engine
« Topic Start: March 12, 2019, 08:56:03 AM »
Does the code have already some event engine?

For example, "when Joe enters city X, fire this action"

I have some new ideas but need this type of engine. But! I have already some code like this I can make clean and give to make less work.

This is simple but lets you make things happen when simple condition meets. If you like, I can fix (maybe I do anyway for my game idea)

Zakky

  • Mighty Duke
  • ****
  • Posts: 552
    • View Profile
Re: Event engine
« Reply #1: March 12, 2019, 09:21:03 AM »
Join the dev team. They will probably let you work on this. I believe we already have something similar but most of the events that fire when you enter a region are related to diplomatic relations or angry peasants.

Ocean Yong Kiran

  • Knight
  • **
  • Posts: 83
    • View Profile
Re: Event engine
« Reply #2: March 12, 2019, 09:31:18 AM »
I think maybe this is a little differnt. I will see what dev team answers about it

De-Legro

  • Honourable King
  • *****
  • Posts: 3838
    • View Profile
Re: Event engine
« Reply #3: 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.

Ocean Yong Kiran

  • Knight
  • **
  • Posts: 83
    • View Profile
Re: Event engine
« Reply #4: March 12, 2019, 10:42:52 AM »
No,no. Only a simple polling script to check on condition X, then fire action Y

It sounds like maybe there is not this, exactly

De-Legro

  • Honourable King
  • *****
  • Posts: 3838
    • View Profile
Re: Event engine
« Reply #5: March 12, 2019, 12:12:44 PM »
No,no. Only a simple polling script to check on condition X, then fire action Y

It sounds like maybe there is not this, exactly

Probably not, how often would we need to pool, how many conditions would need to be checked?
Previously of the De-Legro Family
Now of representation unknown.