- 积分
- 4835
- 威望
- 6
- 魅力
- 6
- 经验
- 289
- 热心度
- 5
- 注册时间
- 2009-6-21
- 最后登录
- 2025-1-26
- 主题
- 200
- 回帖
- 2624
- 精华
- 21
- 阅读权限
- 90
TA的每日心情 | 开心 2021-2-18 14:28 |
---|
签到天数: 2 天 连续签到: 1 天 [LV.1]投石矮人

论坛嘉宾
请叫我黑椒哥哥
  
- 积分
- 4835
 

|
有一小部分内容我不太懂,所以贴出来给高手翻译下,请跟帖回答。(注意保持原文的格式,包括表格、文本颜色和超链接)
1、FU:D命令:
D$/$/$...
最多接到 16$。
| Call the function at opposite side.
这个命令与FU:P的用法几乎相同,请先查看:FU:P。
Now during a battle you may pass the values of v vars to the other side and call functions at
the other side. Say, you run a user dependent script (like stack splitting). The script runs at one side because it runs as a reaction to a human action (mouse click). So all that you change at this side will not be changed on the other side. Now you can pass all changed values to the other side not running a script there.
Example.
On the one side you run a mouse event driven script:
...
!!VRv1234:S999;
On the other side v1234 will still keep the old value.
To fix it use:
...
!!VRv1234:S999;
!!IP:V1234/1234;
The last command will immediately send the value of v1234 to the other side.
Now to the second part of the problem. Say you use some specific command that has some
effects on the battlefield (say you cast a spell with ERM).
Again, if it is done only at one side, there will be a problem because it is not done on the
other side. Now you may use a distant call for those cases. This means that you call a function
but it runs not at this local PC but at a distant one (the opponent's PC).
Up to 16 x parameters are transferred.
Example.
On one side you have:
...
!!BMv10:Mi/y5/5;
To make it run correctly you should make some changes:
...
!!BMv10:Mi/y5/5;
!!FU12345:Dv10/i/y5/5;
!?FU12345;
!!BMx1:Mx2/x3/x4;
That is all. How it works. FU:D immediately transfer all x parameters to the other side and
makes a call of FU1234 there. So BMv10:M... command runs at one PC and BMx1:M... at the other PC. If you pass all in the right order, you will see the same effect at both sides.
Note that you can pass some vars with IP:V command and then call FU:D to pass more than 16 x parameters to the other side.
Now, an example that you can check (tested):
***********
ZVSE
!?BG0;
!!IF:M^Hi!^;
!!VRv99:S99;
!!VRv100:S100;
!!VRv101:S101;
!!IP:V99/100;
!!FU123:D1/2/3/4/5;
!?FU123;
!!IF:M^V99=%V99, V100=%V100, V101=%V101, X1=%X1, X2=%X2, X3=%X3, X4=%X4, X5=%X5^;
***********
You will see "Hi!" message at any action of a stack, then you will see a message "V99=99,
V100=100, V101=0, X1=1, X2=2, X3=3, X4=4, X5=5" at the other PC. Then you get "Hi!" at the other
PC.
If you continue, you may notice that the next time the message will be: "V99=99, V100=100,
V101=101, X1=1, X2=2, X3=3, X4=4, X5=5". So v101 is changed. This is because first you send v99
and v100 through the network and call a function that shows a message (and this is why
v101 is 0). But then the BG0 trigger will work out at the defender's side and v101 will be set
to 101.
This example is only an example because in the script:
!?BG0;
!!IF:M^Hi!^;
!!VRv99:S99; !!VRv100:S100; !!VRv101:S101;
will work fine (identical) at both sides.
But if you run a script as a reaction to a human related event (mouse click generally), you need to think how to transfer changes to the other side.
|
2、HE:C命令C(...)
(SE支持)
| Extended !!HE:C0, !!HE:C1 and !!HE:C2 syntax for setting or retaining Stack Experience.
(Note: does not work with C#1/#2/..../#14).
Now these commands may have 5 or 6 parameters:!!HE...:C#/#1/$2/$3/$4/$5;
# = 0 - change monsters (by slot)
# = 1 - change monsters (by type)
# = 2 - add stack of monsters
$4 = experience value (default is 0)
$5 = experience modifier (default is 0)
Supported $5 modifier values:
Mode 0 - Use this mode to add additional creatures that have experience.
|
| New creatures have their own experience $4, but old creatures (if you add monsters) keep their own experience. The result of experience per creature is calculated as:
Exp=(ExpOld*NumOld+ExpNew*NumNew)/(NumOld+NumNew)
a) Say you have a stack of 10 Monks with Exp 1000 (here and later per creature) and want to add 5 Monks with experience 3000.
The result will be: (1000*10+3000*5)/15=1666
E.g. HE...:C0/0/d/d100/5000/0;
Add to the stack 100 creatures with exp 5000.
b) If you add a creature of a different type, only the experience of the new creatures is taken. So if you have 10 Griffins Exp 1000 and want to add 5 Monks with experience 3000.
The result will be: 3000.
This is used to avoid problems when you move stacks from one slot to another and the experience is mixed. Say you placed a stack of Griffins in the stack 1 and then changed it to Monks accidentally forgot to change experience (so it IS a stack of Monks but the system thinks that it IS a stack of Griffins). So now adding more Monks, the system will think that you changed the type of creatures and takes only experience of new creatures.
Exception: if the stack has not gained experience yet the experience will be averaged as if you weren't changing the type (same as mode 1).
Note:
do not use the 'd' modifier for $4 with mode 0.
| Mode 1 - The same as Mode 0 except that there is no check of creature type. So it always works according a) formula (above) whatever type of ex and new creature type you have.
|
| Examples.
a) you want to set creatures in slot to Pikemen and they should have the experience (per creature) of previous creatures in the stack (whatever they were) plus new 7 creatures has 50 exp. points.
!!HE...:C0/1/0/d7/50/1;
Note:
do not use the 'd' modifier for $4 with mode 1.
| Mode 2 - Use this mode to set experience for the whole stack.
|
| The stack will always be set to $4 experience.
Example:
HE...:C0/0/d/d/5000/2;
The stack will have experience 5000
Note:
if you use the 'd' modifier with Mode 2 for $4, it will add the experience instead. This is identical to the operation of mode 3.
| Mode 3 - Use this mode to add additional experience to a stack.
|
| E.g. HE...:C0/0/d/d/5000/3;
The stack will have +5000 experience.
New creatures take the experience of the old creatures plus $4. Experience is not distributed. So if you have a stack of 10 Monks with Exp 1000, want to add 5 Monks and add 3000 experience with Mode 3, the result is: 1000+3000=4000.
E.g. HE...:C0/0/d/d5/3000/3;
The stack will have +5 creatures and +3000 experience.
You can also use this mode to add creatures to a stack without reducing the stack's experience, or change the type of creatures in the stack while keeping the experience unchanged.
You may use this modifier for temporary creature type changing as well, because the new stack will still have the same experience and if you change it then back, the stack will keep the experience.
!!HE...:C0/1/0/d/0/3;
!!HE...:C0/1/99/d/0/3;
!!HE...:C0/1/0/d/0/3;
Note:
if you use the 'd' modifier for $4 with mode 3 it will work the following way:
StackExp=OldExp+OldExp+AdditionalExperience.
So if a stack had 200 experience, and you add 100 experience, it will have 200+200+100=500.
Then if you add another 100 experience it will have 500+500+100=1100.
| Mode 4 - Use this mode to add experience Levels (Ranks) to a stack.
|
| New creatures take the experience of the old creatures plus experience equal to $4 levels.
Experience is not distributed. So if you have a stack of 10 Monks with Exp 1000, and want to add 5 Monks and add 3 experience levels, the result is:
1000+3levels=????
It uses the next calculation:
- we have E exp
- get a current stack exp. level L0
- get an exp. value E0 for level L0
- get a reminder dE as E-E0
- we have a level bonus L
- get a resulting level L1 as L0+L
- get an exp. value E1 for level L1
- get a final exp. E as E1+dE
E.g. HE...:C0/0/d/d/5/4;
The stack will have +5 experience levels.
Note:
do not use the 'd' modifier for $4 with mode 4.
| Mode 5 - Use this mode if you upgrade creatures.
|
| The same as Mode 3 but the experience of new creatures is taken as though you made an upgrade of old creatures. The new experience will be the old experience multiplied by the Upgrade Multiplier plus an experience bonus.
E.g. HE...:C0/0/d/d/500/5;
The stack will have experience as if upgraded +500 experience.
Note:
do not use the 'd' modifier for $4 with mode 5.
| Mode 10 - Use this mode to add additional creatures with levels (ranks) of experience.
|
| This is the same as Mode 0 but $4 means additional levels (ranks) of new creature type experience.
E.g. HE...:C0/0/d/d100/5/10;
Add to the stack 100 creatures with exp of Rank 5.
Note:
do not use the 'd' modifier for $4 with mode 10.
| Mode 11 - The same as Mode 10 but regardless of creature types.
|
| This is the same as Mode 1 but you add creatures with experience equal to $4 levels (ranks).
E.g. HE...:C0/0/3/d100/5/11;
Add to the stack 100 creatures with exp of Rank 5, but also changing their type to Marksmen.
| Mode 12 - Use this mode to set the experience level (rank) for the whole stack.
|
| This is he same as 2 but $4 means experience levels (ranks).
E.g. HE...:C0/0/d/d/5/12;
The stack will have 5 levels (ranks) of experience.
| Mode 13 - Use this mode to set the equivalent percentage of experience for a new type of creature.
|
| This is the same as Mode 3 but it is assumed that you change the type of creatures and a new creature experience is taken as the same percentage that the old creatures have.
So if you have a stack of Monks with exp. X and change it to a stack of Angels, the new experience will be:
X*MaxA/MaxM+dE
where MaxA is a max experience of an Angel and MaxM is a max experience of a Monk, dE is the added experience.
E.g. HE...:C0/0/../d/1000/13;
The new stack gets the corresponding experience that the old stack had plus 1000 exp.
NewExp=OldExp*NewCreatureTypeR10Exp/OldCreatureTypeR10Exp+ExtraExp.
| Mode 14 - The same as Mode 13 but an addition is experience levels (ranks).
|
| E.g. HE...:C0/0/../d/3/14;
The new stack gets the corresponding experience that the old stack had plus 3 levels (ranks) of exp.
|
|
3、If else endif章节:
If-Else-Endif construction If-else-endif construction used to act by conditions without using new functions or spamming triggers.
To start IF section use the next receiver/instruction:
!!if&condition:;
Note that 'if' is in lower case.
Condition is a standard AND and OR condition that you use now in any receiver. If during a script execution the condition evaluation is TRUE, the followed section is executed. If it is FALSE, the followed section is skipped until ELSE section begins or ENDIF found.
To start ELSE section use the next receiver/instruction:
!!el:;
'el' is in lower case.
No condition is evaluated even if present so this is unconditionally executed.
ELSE section always expects IF part and linked to the latest found in the script IF.
To end IF or IF-ELSE section use the next receiver/instruction:
!!en:;
'en' is in lower case.
No condition is evaluated even if present so this is unconditionally executed.
ENDIF section always expects IF part or IF_ELSE part and linked to the latest found in the script IF or IF-ELSE.
You may use included IF-ELSE-ENDIF sections but not deeper than 10 levels.
Every trigger (and thus function) has its own set of IF-ELSE-ENDIF and so may have up to 10 levels of included IF-ELSE-ENDIF.
When you call a function the caller IF-ELSE-ENDIF state stays active, so when you are back the local IF-ELSE-ENDIF set is used again (a similar way as local function variables).
Example:
ZVSE!?HM-1;!!VRv10:S5;!!if&v10=5:; !!IF:M^First IF^; !!VRv10:S10; !!if&v10<>10:; !!IF:M^Second IF^; !!el:; !!IF:M^Second ELSE^; !!en:; !!IF:M^Second IF finished^;!!el:; !!IF:M^First ELSE^; !!VRv10:S99; !!if&v10=99:; !!IF:M^Third IF^; !!el:; !!IF:M^Third ELSE^; !!en:; !!IF:M^Third IF finished^;!!en:;!!IF:M^First IF finished^;
You should see the next messages:
First IF
Second ELSE
Second IF finished
First IF finished
4、VR命令,数位运算。(这个我真不懂)数位运算
| &#
| Check or remove specific bit of a variable
& does a logical AND on the bits of a variable and can be used to check if a specific bit has been set. For example, to test if the variable v1 has the 5th bit (16) set, use: !!VRv1:&16; v1 will be set to 16 if bit 5 is set and 0 if it isn't. This can be very useful when checking monster flags.
Example:
!!BRx16:F?i; read flags
!!VRi:&33554432; just look at waiting bit
!!IF&i>0:M^This stack is waiting.^;
You can also clear (remove) a specific bit without touching the other bits in a variable. To do so, use the negative minus one of the bit value you wish to remove. For example, to remove the 5th bit (16), use -17, e.g., !!VRv1:&-17;
To check or unset several bits at once sum their values. E.g. to remove 4th(8), 3rd(4) and 1st(1) bits use &-14 ( =-1*(8+3+1)-1 ).
To check them use &13.
| |#
| Set a specific bit of a variable
| does a logical OR on the bits of a variable and can be used to set a specific bit without changing the other bits. For example, to set the 6th bit (32) for v1, use: !!VRv1:|32;
If v1 already had this bit set, nothing is changed. If it didn't, it now has this bit set. This can be very useful for adding new flags to a monster if you don't know which ones it already has, and in fact, this is really the only completely safe way to do so.
To set several bits at once sum their values. E.g. to set 5th(16) and 3rd(4) bits use |20
| X$
| Does a logical XOR on a bits of a variable
E.g. X-1 will invert bits of a variable.
To check for difference between two variables use syntax :VR@:X$ , where @ is variable which is one of variables to compare and also will keep the result of comparison. $ is second comparing variable.
Example:
Say v1=163 (10100011) and v2=106 (01101010). Then after
!!VRv1:Xv2; v2 is still 106.
| 1
| 0
| 1
| 0
| 0
| 0
| 1
| 1
|
| 0
| 1
| 1
| 0
| 1
| 0
| 1
| 0
| XOR
| -
| -
| -
| -
| -
| -
| -
| -
|
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| So v1=201 (11001001)
|
5、UN:U的用法详解
New faster method for U command (search object engine)
Now if you use a search object syntax UN:Utype/subtype/index/varindex you can set index to -1 or -2 (it was allowed to be 1...N before). A value of -1 means it will search for the next object of a type, using the coordinates of the previously found object of the same type while a value of -2 means the same but it will search for the previous object of a type on the map, starting from the last coordinates.
In the standard syntax (index=1...N), UN:U is searching for each object from the beginning of the map and skips them until the index object is found. Thus it is a long process on larger maps, especially if there are a lot of objects of the specified type.
With the new syntax (index=-1 or index=-2) the coordinates returned in v[varindex]/v[varindex+1]/v[varindex+2] are used, and a search for an object of the type specified starts from the next square on the map for -1 or the previous square for -2, not from the beginning. This means that the process should be faster, but it requires that you HAVE NOT CHANGED the returned coordinates of the previous search in V vars.
Moreover, for the first (or last) object you should use a standard syntax OR you may set V[xcoord] var to -1 for the first object or -2 for the last object (见examples below).
If you use -1 and -2 as an index of the object to find you may move forward and backward from the current object. You may use them in any order.
Examples:
It works fine
!!UN:U53/-1/1/1; (get location of mine 1: v1/v2/v3)
...
!!VRv1:S99; (change v1 to anything)
...
!!UN:U53/-1/2/1; (get location of mine 2: v1/v2/v3)
It works WRONG!!! for v1 was modified
!!UN:U53/-1/1/1; (get location of mine 1: v1/v2/v3)
...
!!VRv1:S99; (change v1 to anything)
...
!!UN:U53/-1/-1/1; (get location of NEXT mine (2): v1/v2/v3)
It works fine
!!UN:U53/-1/1/1; (get location of mine 1: v1/v2/v3)
... (v1/v2/v3 are NOT modified)
!!UN:U53/-1/-1/1; (get location of NEXT mine (2): v1/v2/v3)
... (v1/v2/v3 are NOT modified)
!!UN:U53/-1/-1/1; (get location of NEXT mine (3): v1/v2/v3)
It works fine
!!VRv1:S-1; (start search from the first object on the map)
!!UN:U53/-1/-1/1; (get location of NEXT mine (1): v1/v2/v3)
... (v1/v2/v3 are NOT modified)
!!UN:U53/-1/-1/1; (get location of NEXT mine (2): v1/v2/v3)
... (v1/v2/v3 are NOT modified)
!!UN:U53/-1/-1/1; (get location of NEXT mine (3): v1/v2/v3)
To 见a demonstration of how this syntax works, the following sample script may be used with a randomly generated XL 2 levels SoD map. It runs through all Creature banks in forward and then backward order.
Example:
ZVSE
!#TM1:S1/999/1/1; set TM1 for red
!?TM1;
!!UN:U16/-1/?v100;
!!VRv1:S-1;
!!IF:M^Found %V100 Creature Banks. Now run through all of them.^;
!!DO123/1/v100/1:P;
!!IF:M^Put Shroud.^;
!!UN:H72/72/0/1/100; Close for Red
!!UN:H72/72/1/1/100; Close for Red
!!VRv1:S-2;
!!IF:M^Now run in backward order.^;
!!DO124/1/v100/1:P;
!?FU123;
!!UN:U16/-1/-1/1;
!!UN:Sv1/v2/v3/0/3; Open for Red
!!UN:Lv1/v2/v3/100; Move a look for 100 ms
!?FU124;
!!UN:U16/-1/-2/1;
!!UN:Sv1/v2/v3/0/3; Open for Red
!!UN:Lv1/v2/v3/100; Move a look for 100 ms
[ 本帖最后由 da3338280 于 2011-1-30 23:54 编辑 ] |
|