Version 2.9.7
[+] Added possibility to query function arguments count for functions, called via FU:P, FU:D, DO:P.
New command !!FU:A?$ returns number of x-arguments (not including x16 for DO:P), received by function.
This mechanism allows to write functions with optional parameters (parameters with default values) and
functions with variadic arguments number.
Example 1:
!?FU(KillHero);
; Kills specified hero. Demonstration of optional parameters.
; [x1] - hero ID. Optional. -1 by default
!!FU:A?k; get number of function arguments
!!VRx1&k=0:S-1; set x1 to -1, if no arguments passed
!!HEx1:K; killed hero
!?CM0;
!!FU(KillHero):P; kill current hero
!!FU(KillHero):P155; kill Xeron
Example 2:
!?FU(sum);
; Calculates sum of all passed arguments.
; x1..x[n] - arguments to sum
; x[n+1] - result
!!FU:A?k; count function arguments
!!VRxk:S0; set result to 0
!!VRi:S0;
[:for]
!!SN&i>=k:G[end-for]; repeat k times
!!VRxk:+xi; add next argument value to result
!!VRi:+1;
!!SN:G[for];
[:end-for]
!?CM0;
!!FU(sum):P100/200/300/400/?s; get 100 + 200 + 300 + 400 into "s" quickvar
!!IF:M^%Vs^; displays "1000"
[+] VR:C now supports v, y, x and w-variables.
[+] Improved MR:N and OnBattleRegeneratePhase:x1. Now stack ID is returned more accuratly. Thanks to Heromant.
[+] Small improvements of ERM Editor. Better 'for'-loop snippet, syntax fixes, 'iff' for !!IF, etc.
[*] Map resources, like ERM or Lua scripts were previously located in Maps/[MapName] directories. In order
to support HD-mod maps grouping into folders, the location was changed to Maps/Resources/[MapName].
[-] Fixed wrong/unstable round, used by WoG for creature autosummoning via creature experience system.
[-] Fixed bug: w-variables in SN/MP/RD were always related to current hero.
[-] VR:R will no more crash on invalid value.
Скачать