ERA 2.9.2 is out + download

 EPM script engine optimization allowed to speed up the execution of repeatable code by 10x times! (from 130 thousand commands/sec to 1.3 million commands/sec). It means faster and smoother gameplay, more heavy mods, more opportunities to improve AI.
 Many improvements to the EPM were made, which will have a positive impact on the ease of writing and debugging code.
 New events support: hero screen rendering, mouse clicks handling in recruit troops screens, city hall and kingdom overview dialog.
 Script writers are provided with an interface to work with the recruitment dialog. It became possible to implement many ideas based on it: summoning different creatures in battle, transferring stacks between heroes, remote army purchase, new creature dwellings and much more.
 Evolution of the Era code. Era 1.9 code is fully ported to Delphi. Angel.dll is now just a stub.
 Gift for antiviruses: the old utility DEFka, replaced by a favorable version 2.0 on another engine.

Download
ERA 2.9.2

ERA 2.9.x Changelog

Version 2.9.2
————————
[-] Release building software used to put older angel.dll into installer.
[-] Fixed bug: negative y-variables were reset even in non FU1..FU29999.

Version 2.9.1
————————
#small-fixes #antiviruses-heaven
[+] Replaced ToolsDEFka v1.0 with more feature rich DEFka 2.0.
[+] Replaced Virtual Pascal angel.dll stub with Delphi angel.dll stub.
[+] Added “ErmLegacySupport” option in heroes3.ini. If set to 1, compatibility with old ERM scripts will be better
at the cost of ~15% ERM performance decrease. Options forces local variables reset before each !?XX trigger, even
in DO-loops.
[-] Renamed ModsWoGEraPluginserm_hooker.dll to *.era.

Version 2.9.0
————————
#performance #erm-speed-up #erm-stability #era-evolution #recruit-dialog

[@] Special thanks to HMM 3 fans, who supported the project with donations: Andarium (++) and a few other players (+).
[@] Special thanks to daemon_n for maintaining main Russian Era all-in-one package, script writers and players support,
Advanced Classes Mod translation and more.
[@] Special thanks to MoP. His Battery.dll plugin was used during Recruit Dialog API development.
[@] Special thanks to igrik for his constant plugins updates, advices and help.

[+] Speeded up ERM triggers in 2-10x times. There is no more performance penalty, depending on total triggers number.
Whether there are 5 total triggers or 5000, trigger search time is almost linear. Triggers location in memory and search mechanism
were optimized.

[!] Backward incompatible change: local variables saving and initialization is performed before the first trigger of particular type (like !?CM2)
and restoration is performed after the last trigger of particular type. It means, that code must not depend on local vars initial zero/empty value.
Some original WoG scripts need corrections.

[+] Rewritten trigger execution procedure. Features:
– Up to 32 nested IFs support.
– Each trigger/function from now has its own local set of y1..y100, e1..e100, z-1..z-10, x1..x16, f996..f1000, v997..v1000 variables.
Flags and v-variables are automatically set before first trigger of the same type execution.
x1..x16 usually hold trigger/function paremeters and should be changed only when you know, what you are doing.
– Optimized !!DO support. Variables saving/restoring is performed only once before !!DO-loop and after.

[+] Rewritten !!DO implementation. Now it’s lightning fast (10x), almost same as manual loop with SN:G.
– DO parameters are set only once before the first iteration.
– DO:P? syntax is supported. Get-parameters will have 0 value at first iteration and their final value will be returned after the last iteration.
Example: !!DO(Test)/0/100/1:P?y1; y1 will be set to x1 value after last loop iteration, x1 initial value is 0
– !!DO:P= syntax is not supported anymore.
– Backward iteration is now supported. !!DO(Test)/100/-10/-1; will iterate 111 times from 100 to -10.

[+] v1..v10 and z1 variables are restored after OnKeyPressed event automatically. No keyboard fix scripts is necessary anymore.

[*] Negative y-variables are DEPRECATED and are subject to be removed in the future. Do not use them in new scripts.
They are saved and restored for any event, except !?FU1..!?FU29999. Thus some WoG scripts used them as local variables (positive y-vars are better),
and some scripts used them as return values from FU1..FU29999 functions (like global variables).

[+] SN:E always assigns both v1 and e1. No need to add 4 to calling convention in order to receive float result.

[+] SN:X works directly with x1..x16 now. Parameters for Era triggers are assigned to x1..x16. Thus you can write:
!?FU(OnKeyPressed)&x1=27; handle ESC key (code 27)
!!VRx2:S1; disable default reaction

[+] Era 1.9 was fully ported to Delphi. Angel.dll is left as deprecated stub only. Antiviruses no longer complain on angel.dll.
[+] All SN receiver commands are now handled by Era.
[+] ERM Hooker was updated to 2.1 version and is now part of Era package. Mod makers should not include it in their mods.

[+] Added new event “OnLoadHeroScreen”. It occurs just before Hero Screen is drawn for specific hero: after “OnOpenHeroScreen”
event and during each switching in the same dialog between different heroes. Event also occures during RMB on hero in tavern
and in battle (with special plugins). The event can be used to change hero skills/info/troops only for hero screen dialog.

[+] Added “OnRecruitDlgMouseClick”, “OnTownHallMouseClick” and “OnKingdomOverviewMouseClick” events. All parameters
can be obtained via !!CM, as usual. Default reaction can be disabled.

[+] Improved SN:S / !?SN pair. Sound name is always copied to a separate buffer before calling PlaySound.
Previously the following code used to produce no sound:

!!VRz1:S^test.wav^;
!!SN:Pz1;

!?SN;
!!VRz1:S^WTF^;

[+] OnBeforeHeroInteraction event has 3-d parameter (x3): “enable interaction”. Set it to 0 to disable interaction.

[+] Added SN:F^era.dll or kernel32.dll exported function name^/…function arguments… for executing functions
with STDCALL calling convention. No more need to use SN:L… A… E… in most cases.
Example: !!SN:F^ReadStrFromIni^/^key^/^section name^/^Datatest.ini^/?z2;
!!SN:F^GetButtonID^/^testBtn^;

[+] Added ERM command for dynamical string interpolation (substitution of variables in string).
SN:I(string to interpolate)/?z#.
Command can be used for interpolating strings, obtained from external sources, such as ini-files
and SN:T, though its usage is recommended only for debugging/porting needs.

Example:
Use SN:T, UN:N6 or get input from dialog in z2.
Example z2 contents: ‘%Y5 %V996 test %Z5’
!!SN:Iz2/?z3; z3 now contains z2 contents with all variables substituted/interpolated

[*] Updated “Quick Savings” mod.
[+] Updated “wog native dialogs” plugin by igrik.

[+] Era.dll now exports 2 additional functions: GetArgXVars and GetRetXVars. Each one returns pointer to int[16].
The first set of values should be used as parameters for generated events. They are automatically copied to x1..x16
right on trigger execution start. The second array holds copied x1..x16 values after trigger execution and serve
as return values.

Example:
GetArgXVars()[0] = 1; // default reaction is enabled
FireErmEvent(100000); // call trigger 100000
int defReactionEnabled = GetRetXVars()[0]; // get “default reaction enabled” parameter final value

[-] Backward compatibility with plugins, adding new ERM receivers is broken. New API for regestering custom
ERM receiver handler is ready, only docs are missing for now.

[+] Added new receiver !!RD for managing recruit dialog and a few new events.

Whenever recruit dialog is created, an event “OnOpenRecruitDlg” is triggered with the following parameters:
x1 – selected/active monster slot (0..3)
x2 – flags/options. Combination of bits, controlling dialog behavior:
CLOSE_ON_BUY       = 1; Dialog should be closed, when buy button is clicked. Used normally in towns
ir when there is only single recruit slot. Unset this flag to force use to manually close dialog.
AUTO_UPDATE_ADVMAP = 2; Adventure map screen should be updated after any recruit is hired (even when dialog is shown).
This flag is used during hiring recruits from adv. map dwellings, allowing player to see
new creature quantities in the right bottom info screen.
x3 – enable dialog = 1.   Set to 0 to not show dialog at all.

When recruit dialog is closed, an appropriate “OnCloseRecruitDlg” is trigger without parameters.

When dialog slider is touched or active slot changed, recalculation of number of monsters to hire
and total costs is performed in “OnRecruitDlgRecalc” event. All parameters can be changed.
x1 – creature cost in gold
x2 – resource ID (0..5) or -1
x3 – resource cost

Dialog was modified to allow zero gold/resource cost.

Leave a Comment

Your email address will not be published.

Anti-Spam Quiz: