Sharing Event Codes

Discuss and post your mods and scenarios here for others to download.

Moderator: Vic

Post Reply
E6Jarhead
Posts: 29
Joined: Sun May 31, 2015 10:26 pm
Location: Hendersonville, NC

Sharing Event Codes

Post by E6Jarhead »

Lets all start posting our event codes so others can learn from, copy or incorporate!

Th only reason some people are still alive is because it is illegal to kill them!
LJBurstyn
Posts: 626
Joined: Tue Apr 19, 2011 11:29 am

RE: Sharing Event Codes

Post 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.
User avatar
ernieschwitz
Posts: 4654
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Sharing Event Codes

Post 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.
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
lion_of_judah
Posts: 2332
Joined: Mon Jan 08, 2007 6:36 pm
Location: somewhere over the rainbow

RE: Sharing Event Codes

Post 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
User avatar
ernieschwitz
Posts: 4654
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Sharing Event Codes

Post 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.


Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
User avatar
lion_of_judah
Posts: 2332
Joined: Mon Jan 08, 2007 6:36 pm
Location: somewhere over the rainbow

RE: Sharing Event Codes

Post by lion_of_judah »

how do I get this in the event engine? copy and past from here will not work........
User avatar
ernieschwitz
Posts: 4654
Joined: Tue Sep 15, 2009 3:46 pm
Location: Denmark

RE: Sharing Event Codes

Post by ernieschwitz »

You click and click and click... :)

The process of making this will require quite a number of screenshots :)
Creator of High Quality Scenarios for:
  • Advanced Tactics Gold
    DC: Warsaw to Paris
    DC: Community Project.
Try this Global WW2 Scenario: https://www.vrdesigns.net/scenario.php?nr=280
Post Reply

Return to “Mods and Scenarios”