Anti chaining script
Anti chaining script
I've been working on an anti chainning script lately and found a problem, i have no way to get the number of the hero, the hero traded with.
The idea is to remove the movement of both heroes once the traded finished or when it's start i sthe same but i have no way to identify the hero i traded with, the HE reciever doesn't have an option for that, any idea?.
Another problem is that the HE trigger , triggers when an allied hero trade or when an enemy hero attack but i want it to work ONLY when an allied hero trade
Edited: I figured out that i could do a HE trigger for EACH possible hero, still any better suggestion?
About the only activating when allied i could check if both heroes belong to the same side, if they do , continue, otherwise, exit
The idea is to remove the movement of both heroes once the traded finished or when it's start i sthe same but i have no way to identify the hero i traded with, the HE reciever doesn't have an option for that, any idea?.
Another problem is that the HE trigger , triggers when an allied hero trade or when an enemy hero attack but i want it to work ONLY when an allied hero trade
Edited: I figured out that i could do a HE trigger for EACH possible hero, still any better suggestion?
About the only activating when allied i could check if both heroes belong to the same side, if they do , continue, otherwise, exit
Here is the script i made and it works perfectly as i meant it to work the problem is that as you noted, it only works for VALESKA!
Since i can't get the trigger hero i can only set it i should make it for EVERY hero, any simpleer way to do it?
If nothing else work i will have to copy and change the parameter 130+ times and of course if i want to do a modification i better kill myself
ZVSE
!?HE1;
!!HE-1:O?y2; Determine side of trigger hero 1
!!HE1:O?y1; Determined side of affected hero 2
!!FU&y1<>y2:E; IF both heroes belong to the same side continue ,
otherwise exit
!!HE1:G?y3 W?y4; Get-hero affected Total movement(y3) and remaining
movement (y4)
!!HE-1:G?y5 W?y6; Get-hero Trigger Total movement(y5) and remaining
movement (y6)
!!VRy7:Sy3 -y4; Determine Hero affected used movement
!!VRy8:Sy5 -y6; Determine hero trigger used movement
!!VRy9:Sy7 *100 :y3; Determine hero affected pr of used movement
!!VRy10:Sy8 *100 :y5; Determine hero triggered pr of used movement
!!VRy12:Sy4 *y10 :100; Translate hero triggered pr of used movement to
hero affected movement
!!VRy14:Sy4 -y12; Variable y14 becomes new affected hero movement
!!VRy13:Sy5 *y9 :100; Translate hero affected pr of used movement to
hero affected used movement
!!VRy15:Sy6 -y13; Variable y15 becomes new triggered hero movement
!!HE1&y10>y9:Wy14;
!!HE-1&y9>y10:Wy15;
Since i can't get the trigger hero i can only set it i should make it for EVERY hero, any simpleer way to do it?
If nothing else work i will have to copy and change the parameter 130+ times and of course if i want to do a modification i better kill myself
ZVSE
!?HE1;
!!HE-1:O?y2; Determine side of trigger hero 1
!!HE1:O?y1; Determined side of affected hero 2
!!FU&y1<>y2:E; IF both heroes belong to the same side continue ,
otherwise exit
!!HE1:G?y3 W?y4; Get-hero affected Total movement(y3) and remaining
movement (y4)
!!HE-1:G?y5 W?y6; Get-hero Trigger Total movement(y5) and remaining
movement (y6)
!!VRy7:Sy3 -y4; Determine Hero affected used movement
!!VRy8:Sy5 -y6; Determine hero trigger used movement
!!VRy9:Sy7 *100 :y3; Determine hero affected pr of used movement
!!VRy10:Sy8 *100 :y5; Determine hero triggered pr of used movement
!!VRy12:Sy4 *y10 :100; Translate hero triggered pr of used movement to
hero affected movement
!!VRy14:Sy4 -y12; Variable y14 becomes new affected hero movement
!!VRy13:Sy5 *y9 :100; Translate hero affected pr of used movement to
hero affected used movement
!!VRy15:Sy6 -y13; Variable y15 becomes new triggered hero movement
!!HE1&y10>y9:Wy14;
!!HE-1&y9>y10:Wy15;
Re: Anti chaining script
There's a command in the CM receiver that lets you check both hero numbers in the hero trading screen (the CM:H command).
The only problem is that this won't activate until a player clicks--which isn't a huge problem since no trading will occur until that happens anyway. However, it means that it wouldn't work for the AI (since the AI never "clicks").
The only problem is that this won't activate until a player clicks--which isn't a huge problem since no trading will occur until that happens anyway. However, it means that it wouldn't work for the AI (since the AI never "clicks").
- Fnord
Okay, that's cool then. And in case I wasn't clear, you'll need to use the mouse-click CM trigger as well (the one for the hero meeting screen is !?CM3). Then in that trigger section you can use the CM:H command to get the hero number and execute the rest of your code from there too.Pollo2002 wrote:No problem about the ai stuff i don't care about ai and even i will let the ai do free chain maybe can help to improve it's patetic skill.
thanks i will try what you say
- Fnord
Down you can see the script, it seems to work perfect, except for one ting it only work once , after that it doesn't work anymore.
as you see i did two different triggers, the first for when the flag 910 is off (default) and then other for when you click on the benchmark and go out. The second function should put the flag off again, it seems that it doesn't do it. and such on futures trades the first function doesn't trigger (Because flag 910 still set) any idea what i'm doing wrong. I did the flag thing because otherwise of course the function run everytime i did a click and i wanted to work only once per trade
ZVSE
!?CM3&-910;
!!CM:H?y16/?y17;
!!HEy17:G?y3 W?y4; Get-hero affected Total movement(y3) and remaining movement (y4)
!!HEy16:G?y5 W?y6; Get-hero Trigger Total movement(y5) and remaining movement (y6)
!!VRy7:Sy3 -y4; Determine Hero affected used movement
!!VRy8:Sy5 -y6; Determine hero trigger used movement
!!VRy9:Sy7 *100 :y3; Determine hero affected pr of used movement
!!VRy10:Sy8 *100 :y5; Determine hero triggered pr of used movement
!!VRy12:Sy4 *y10 :100; Translate hero triggered pr of used movement to hero affected movement
!!VRy14:Sy4 -y12; Variable y14 becomes new affected hero movement
!!VRy13:Sy5 *y9 :100; Translate hero affected pr of used movement to hero affected used movement
!!VRy15:Sy6 -y13; Variable y15 becomes new triggered hero movement
!!HEy17&y10>y9:Wy14;
!!HEy16&y9>y10:Wy15;
!!IF:V910/1;
!?CM3&910;
!!CM:I?y1;
!!IF&y1=30720:V910/0;
as you see i did two different triggers, the first for when the flag 910 is off (default) and then other for when you click on the benchmark and go out. The second function should put the flag off again, it seems that it doesn't do it. and such on futures trades the first function doesn't trigger (Because flag 910 still set) any idea what i'm doing wrong. I did the flag thing because otherwise of course the function run everytime i did a click and i wanted to work only once per trade
ZVSE
!?CM3&-910;
!!CM:H?y16/?y17;
!!HEy17:G?y3 W?y4; Get-hero affected Total movement(y3) and remaining movement (y4)
!!HEy16:G?y5 W?y6; Get-hero Trigger Total movement(y5) and remaining movement (y6)
!!VRy7:Sy3 -y4; Determine Hero affected used movement
!!VRy8:Sy5 -y6; Determine hero trigger used movement
!!VRy9:Sy7 *100 :y3; Determine hero affected pr of used movement
!!VRy10:Sy8 *100 :y5; Determine hero triggered pr of used movement
!!VRy12:Sy4 *y10 :100; Translate hero triggered pr of used movement to hero affected movement
!!VRy14:Sy4 -y12; Variable y14 becomes new affected hero movement
!!VRy13:Sy5 *y9 :100; Translate hero affected pr of used movement to hero affected used movement
!!VRy15:Sy6 -y13; Variable y15 becomes new triggered hero movement
!!HEy17&y10>y9:Wy14;
!!HEy16&y9>y10:Wy15;
!!IF:V910/1;
!?CM3&910;
!!CM:I?y1;
!!IF&y1=30720:V910/0;
after trying i found out that i can set the flag off again if i RIGHT click on the benchmark.
Wich makes everthing more complicated, i want it to be off when i just click it to go out.
Maybe i will have to copy the script just 130+ times?
Can i use somehow the DO recierve instead of do that or it has no sense?
Wich makes everthing more complicated, i want it to be off when i just click it to go out.
Maybe i will have to copy the script just 130+ times?
Can i use somehow the DO recierve instead of do that or it has no sense?
I'm sure there is a way to do it. I have a feeling another value must be returned when you left-click on the checkmark. I'll look into it and post what I find shortly.
EDIT: Okay, I was wrong. This is really weird but it seems that left-clicking the checkmark (to exit the hero meeting screen) doesn't trigger any of the triggers. It works fine in the single hero screen as far as I recall.
So..you'll have to use another trigger to reset the flag. I suggest using two adventure map triggers, CM0 for the right-clicks and CM5 for left-clicks. That should do the trick, right?
e.g.,
EDIT: Okay, I was wrong. This is really weird but it seems that left-clicking the checkmark (to exit the hero meeting screen) doesn't trigger any of the triggers. It works fine in the single hero screen as far as I recall.
So..you'll have to use another trigger to reset the flag. I suggest using two adventure map triggers, CM0 for the right-clicks and CM5 for left-clicks. That should do the trick, right?
e.g.,
Code: Select all
!?CM0;
!!IF:V910/0;
!?CM5;
!!IF:V910/0;
- Fnord
excellent i feel stupid how didn't think of it, after all if you don't click on the adventure map you can't do a new trading
so here is the script i'm using, and for now it works just fine, the only difference with my past method is that now your first click on the trading screen make the screen do some strange stuff for a fraction of second with is a little annoying, but i can live with that, better than copy the script for each hero
Thanks
i left the script writen here for if any other person wanna try to play without chaining.
ZVSE
!?CM3&-910;
!!CM:H?y16/?y17;
!!HEy17:G?y3 W?y4; Get-hero affected Total movement(y3) and remaining movement (y4)
!!HEy16:G?y5 W?y6; Get-hero Trigger Total movement(y5) and remaining movement (y6)
!!VRy7:Sy3 -y4; Determine Hero affected used movement
!!VRy8:Sy5 -y6; Determine hero trigger used movement
!!VRy9:Sy7 *100 :y3; Determine hero affected pr of used movement
!!VRy10:Sy8 *100 :y5; Determine hero triggered pr of used movement
!!VRy12Sy4 *y10 :100 ; Translate hero triggered pr of used movement to hero affected movement
!!VRy14:Sy4 -y12; Variable y14 becomes new affected hero movement
!!VRy13:Sy5 *y9 :100; Translate hero affected pr of used movement to hero affected used movement
!!VRy15:Sy6 -y13; Variable y15 becomes new triggered hero movement
!!HEy17&y10>y9:Wy14;
!!HEy16&y9>y10:Wy15;
!!IF:V910/1;
!?CM5&910;
!!IF:V910/0;
so here is the script i'm using, and for now it works just fine, the only difference with my past method is that now your first click on the trading screen make the screen do some strange stuff for a fraction of second with is a little annoying, but i can live with that, better than copy the script for each hero
Thanks
i left the script writen here for if any other person wanna try to play without chaining.
ZVSE
!?CM3&-910;
!!CM:H?y16/?y17;
!!HEy17:G?y3 W?y4; Get-hero affected Total movement(y3) and remaining movement (y4)
!!HEy16:G?y5 W?y6; Get-hero Trigger Total movement(y5) and remaining movement (y6)
!!VRy7:Sy3 -y4; Determine Hero affected used movement
!!VRy8:Sy5 -y6; Determine hero trigger used movement
!!VRy9:Sy7 *100 :y3; Determine hero affected pr of used movement
!!VRy10:Sy8 *100 :y5; Determine hero triggered pr of used movement
!!VRy12Sy4 *y10 :100 ; Translate hero triggered pr of used movement to hero affected movement
!!VRy14:Sy4 -y12; Variable y14 becomes new affected hero movement
!!VRy13:Sy5 *y9 :100; Translate hero affected pr of used movement to hero affected used movement
!!VRy15:Sy6 -y13; Variable y15 becomes new triggered hero movement
!!HEy17&y10>y9:Wy14;
!!HEy16&y9>y10:Wy15;
!!IF:V910/1;
!?CM5&910;
!!IF:V910/0;
It takes awhile to get used to all the possibilities of ERM (and even then, it's easy to forget something that later seems obvious).Pollo2002 wrote:excellent i feel stupid how didn't think of it, after all if you don't click on the adventure map you can't do a new trading
The strange stuff is probably the automatic screen redraw of the adventure screen hero information window (the one in the lower-right corner) caused by the HE:W command.Pollo2002 wrote: so here is the script i'm using, and for now it works just fine, the only difference with my past method is that now your first click on the trading screen make the screen do some strange stuff for a fraction of second with is a little annoying, but i can live with that, better than copy the script for each hero
Thanks
Try using the "no redraw" syntax instead which just requires that you add /1 after each HE:W command.
For example:
Code: Select all
!!HEy17:G?y3 W?y4/1; Get-hero affected Total movement(y3) and remaining movement (y4)
- Fnord
Great! And you're very welcome.Pollo2002 wrote:Yes! now it works excellent! thanks a lot!
Just a note: it might be wise to warn players that this script will also mean that transferring of artifacts or learning spells from another hero with the Scholar skill will also reduce movement, and that revisiting the hero multiple times in a turn (i.e., re-entering the hero trading screen) will continue to reduce movement each time (if I understand it correctly).
If you want to avoid this, you could ignore any click that's not on a creature slot of one of the heroes. Or if you're fine with transferring of artifacts reducing movement (because chaining artifacts is also disliked by some players), you could check for a creature slot click or an artifact position click and ignore any other.
- Fnord
Who is online
Users browsing this forum: No registered users and 2 guests