Main Menu

News:

Please be aware of the Forum Rules of Conduct.

Event engine

Started by Ocean Yong Kiran, March 12, 2019, 08:56:03 AM

Previous topic - Next topic

Ocean Yong Kiran

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

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

I think maybe this is a little differnt. I will see what dev team answers about it

De-Legro

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

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

Quote from: Ocean Yong Kiran on 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

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.