Page 1 of 1

Sharing Event Codes

Posted: Mon Jun 01, 2015 11:07 pm
by E6Jarhead
Lets all start posting our event codes so others can learn from, copy or incorporate!


RE: Sharing Event Codes

Posted: Tue Jun 02, 2015 9:51 am
by LJBurstyn
One of the things you have to know is when the event runs. Some events can be keyed to run only when the round changes (everyone does their turn)..Some can be keyed to NOT run (run only when a card is played or when another event calls it)..some can happen during a turn of each player...and finally some can run only when AI is doing it's thing. Running an event every turn when it can run only on round changes will cause the event to run between every player's turn--this will play havoc with any counter you have set up in the event if you want the count to increment after everyone does their turns. And it wastes the time of the processor if it needs to run only after everyone does their turn.

Round runs before anyone does a turn or after everyone does their turns.

Early Turn runs before each player does his turn.

Late Turn runs after each player does his turn.

NOT run (forgot what's it called) does not run unless called by a card or another event.

AI only runs when the player is the AI.

RE: Sharing Event Codes

Posted: Tue Jun 02, 2015 2:01 pm
by ernieschwitz
There are some other options too, but some of them require more expert knowledge of what when runs, and such.

For instance there is the End Turn Check. This runs at the closing of the turn, that is when the player presses End Turn.

This is useful for instance for removing a change in code that only should run during one players turn.

The there is the Late Turn Check, which is run before the player gets the turn, but after effects are run, for instance supply or readiness recovery and the like.

They all have their uses.

RE: Sharing Event Codes

Posted: Tue Jun 02, 2015 3:24 pm
by lion_of_judah
I'm asking if anyone has made an event to activate a regime after a certain terrain objective has fallen and if so please post it here. I really suck at programming, couldn't begin to tell you how bad so any help will be appreciated. Thanks

RE: Sharing Event Codes

Posted: Tue Jun 02, 2015 3:45 pm
by ernieschwitz
That could be made too.

You could do it several ways. One way is to do soemthing like this.

(Round or turn check, depending on when you want it to happen, in the turn that it happens or the round it happens).

Check hex owner ("x","y") "NOT =" "Starting owner"

Execute: ExecSetSleep (0, "Regime to be woken")

BlockEvent

End Check


The BlockEvent is in there to stop it from checking once it has happened. The values in " " are values you must put in.



RE: Sharing Event Codes

Posted: Tue Jun 02, 2015 5:25 pm
by lion_of_judah
how do I get this in the event engine? copy and past from here will not work........

RE: Sharing Event Codes

Posted: Tue Jun 02, 2015 5:37 pm
by ernieschwitz
You click and click and click... :)

The process of making this will require quite a number of screenshots :)