<h3><aclass="toc-backref"href="#id58">Events from EventManager</a></h3>
<p>These events are straight from EventManager module. Each of them first needs to be enabled. See functions for more info. If you register a listener before the game is loaded, be aware that no events will be triggered immediately after loading, so you might need to add another event listener for when the game first loads in some cases.</p>
<p>Gets called when job is finished. The job that is passed to this function is a copy. Requires a frequency of 0 in order to distinguish between workshop jobs that were cancelled by the user and workshop jobs that completed successfully.</p>
<p>Gets called when someone picks up an item, puts one down, or changes the way they are holding it. If an item is picked up, old_equip will be null. If an item is dropped, new_equip will be null. If an item is re-equipped in a new way, then neither will be null. You absolutely must NOT alter either old_equip or new_equip or you might break other plugins.</p>
<p>Enable event checking for EventManager events. For event types use <ttclass="docutils literal">eventType</tt> table. Note that different types of events require different frequencies to be effective. The frequency is how many ticks EventManager will wait before checking if that type of event has happened. If multiple scripts or plugins use the same event type, the smallest frequency is the one that is used, so you might get events triggered more often than the frequency you use here.</p>
These events are straight from EventManager module. Each of them first needs to be enabled. See functions for more info.
These events are straight from EventManager module. Each of them first needs to be enabled. See functions for more info. If you register a listener before the game is loaded, be aware that no events will be triggered immediately after loading, so you might need to add another event listener for when the game first loads in some cases.
1. ``onBuildingCreatedDestroyed(building_id)``
1. ``onBuildingCreatedDestroyed(building_id)``
@ -3069,7 +3069,7 @@ These events are straight from EventManager module. Each of them first needs to
4. ``onJobCompleted(job)``
4. ``onJobCompleted(job)``
Gets called when job is finished. The job that is passed to this function is a copy.
Gets called when job is finished. The job that is passed to this function is a copy. Requires a frequency of 0 in order to distinguish between workshop jobs that were cancelled by the user and workshop jobs that completed successfully.
5. ``onUnitDeath(unit_id)``
5. ``onUnitDeath(unit_id)``
@ -3089,7 +3089,7 @@ These events are straight from EventManager module. Each of them first needs to
Gets called when someone picks up an item, puts one down, or changes the way they are holding it.
Gets called when someone picks up an item, puts one down, or changes the way they are holding it. If an item is picked up, old_equip will be null. If an item is dropped, new_equip will be null. If an item is re-equipped in a new way, then neither will be null. You absolutely must NOT alter either old_equip or new_equip or you might break other plugins.
Functions
Functions
---------
---------
@ -3108,7 +3108,7 @@ Functions
4. ``enableEvent(evType,frequency)``
4. ``enableEvent(evType,frequency)``
Enable event checking for EventManager events. For event types use ``eventType`` table.
Enable event checking for EventManager events. For event types use ``eventType`` table. Note that different types of events require different frequencies to be effective. The frequency is how many ticks EventManager will wait before checking if that type of event has happened. If multiple scripts or plugins use the same event type, the smallest frequency is the one that is used, so you might get events triggered more often than the frequency you use here.
@ -2993,7 +2993,15 @@ To skip a row in your design, use a single <tt class="docutils literal">;</tt>.<
<p><cite>invasion-now civName</cite> trigger an invasion from the civilization with the id civName, starting in about ten ticks</p>
<p><cite>invasion-now civName</cite> trigger an invasion from the civilization with the id civName, starting in about ten ticks</p>
<p><cite>invasion-now civName start</cite> trigger an invasion from civName in a number of ticks between 10*start and 11*start-1 (inclusive)</p>
<p><cite>invasion-now civName start</cite> trigger an invasion from civName in a number of ticks between 10*start and 11*start-1 (inclusive)</p>
<p><cite>invasion-now civName start end</cite> trigger an invasion from civName in about 10*start ticks, and continue triggering invasions every ten ticks afterward until about 10*end ticks have passed</p>
<p><cite>invasion-now civName start end</cite> trigger an invasion from civName in about 10*start ticks, and continue triggering invasions every ten ticks afterward until about 10*end ticks have passed</p>
<p>Probably fails if the start time of a triggered invasion is later than the start of the next year.</p>
<p>Probably fails if the start time of a triggered invasion is later than the start of the next year.
digmat
======
Designates a tile for digging. Monitors the tile, and when it is dug out, add
surrounding discovered tiles of the same material for digging. Similar to 'digv',
but less cheaty. Works for stone layers, soil layers, veins, etc.</p>
<p>If the tile you call the script on already has a digging designation, reuse the
same designation for future digging (eg dig up/downstairs). When digging stairs,
also designate tiles on z-1 and z+1 when they are discovered.</p>