- 积分
- 10986
- 威望
- 6
- 魅力
- 7
- 经验
- 10158
- 热心度
- 15
- 注册时间
- 2019-10-15
- 最后登录
- 2024-10-7
- 主题
- 20
- 回帖
- 268
- 精华
- 1
- 阅读权限
- 60
TA的每日心情 | 开心 2023-12-23 11:10 |
---|
签到天数: 441 天 连续签到: 1 天 [LV.9]龙巫妖
6级 Legendary Hero
- 积分
- 10986
|
楼主 |
发表于 2020-2-5 23:16:17
|
显示全部楼层
本帖最后由 琭琭有彧 于 2020-2-5 23:19 编辑
Version 2.9.8
------------------------
[+] Introduced high-level fastest loops in ERM via new receivers: !!re, !!br, !!co.
!!re $1[/#2/#3/#4].
...
!!en:;
$1 - loop counter var like 'i' or 'y6'.
#2 - counter start value. Optional. Default: initial value of loop counter var.
#3 - counter stop value. Optional. Default: initial value of loop counter var.
#4 - step. Optional. Default: 1, if stop value is set, 0 otherwise.
Repeats block of code. Only the first argument is obligatory.
At first loop counter variable is initialized.
Counter stop and step values are remembered for the whole loop and won't be evaluated on each iteration.
Step determines, what value must be added to counter variable after each iteration. It also determines type of iteration stop condition.
Positive step checks if counter > stop value. Negative step checks if counter < stop value.
On !!re it's checked, if counter reached stop-value or exceeds it. If true, execution is passed to corresponding !!en block.
On !!en counter is increased by step and if stop condition is not met, next receiver after closest !!re will be executed.
If stop condition is not met, execution goes to the next receiver after closest !!re.
!!br (BREAK) with optional condition immediately jumps after loop !!en receiver.
!!co (CONTINUE) with optional condition immediately jumps to loop !!en receiver, which will be executed as usual.
Examples:
; Endless loop of annoying messages:
!!re i:;
!!IF:M^Donate, please!^;
!!en:;
; Clear current hero army
!!re i/0/6:;
!!HE-1:C0/i/-1/0;
!!en:;
; Display 10, 8, 6, 4, 2 (1 will not be displayed, same as 0)
!!re i/10/1/-2:;
!!IF:M^%Vi^;
!!en:;
; Display number of the first hero empty slot, if it's found
!!re i/0/6:;
!!HE-1:C0/i/?t/?k;
!!if|t=-1/k=0:;
!!IF:M^Free slot number is %Vi^;
!!br:;
!!en:;
!!en:;
!!IF&i>6:M^No free slot was found^;
[+] Added possibility to query syntax, that was used for particular function parameter.
!!FU:S#1/?$2;
#1 - argument index
?$2 - syntax type (0 - get, 1 - set, 2 - add)
Add syntax is applied via 'd' prefix like FU:Pd200.
Using this receiver scriptmakers can write functions which act the same as normal ERM commands.
For instance, one function to get/set/add dwelling population amount.
[+] Rewritten ZvsCheckFlags routine. Now e-variables can be compared to integer variables and constants.
All logical operations are supported for strings. Variable indexes were not checked at all, but are
checked now.
[+] Adapted wonderful PA and QU receivers by gamecreator with Pandora and Seer Hut Quests API.
From now these receivers are officially part of Era. See Help\Erm Help directory for details.
Be sure to delete "pandora's api.era", "receiver pa.era", "receiver qu.era" from old mod packages.
[+] WoG scripts were extractd to a separate mod "WoG Scripts". Some fixes by igrik/Algor were applied.
[+] Included updated TxtEdit and MMArchive by GrayFace. Replaced 'for' snippet in ERM editor with 're' snippet, other syntax file corrections. Maximum 16 nested IF/RE blocks are allowed.
[-] Fixed crash caused by invalid RD:M second parameter handling.
DOWNLOAD
|
|