|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 18, 2014 03:08 PM |
|
|
|
Siegfried
Famous Hero
|
posted October 18, 2014 07:32 PM |
|
|
Well, here is the whole function:
[php]
** Stack update
** x1 = type (-1 = any)
** x2 = alignment (-1 = any)
** x3 = flags set (0 = none)
** x4 = flags unset (0 = none)
** x5 = AT bonus
** x6 = DF bonus
** x7 = Speed bonus
** x8 = HP bonus
** x9 = max damage bonus
** x10 = min damage bonus
** x16 = number (0-20 = left, 21-41 = right)
!?FU@UpdateStack@&1000;
!!FU&x16<0:E;
!!FU&x16>41:E;
!!BMx16:B?y1; ** Number of creatures
!!FU&y1=0:E; ** Exit if none
!!if&x1>=0:; ** If type specified, check type and/or upgrade
!!FU@IsUpgraded@x16/x1/x1;
!!FU&-1:E;
!!en:;
** Check required flags
!!if&x3<>0:;
!!BMx16:F?y6; ** Flags
!!VRy3:Sy6&x3;
!!FU&x3<>0/y3=0:E; ** Exit if not all requested flags set
!!en:;
** Check disallowed flags
!!VRy3:Sy6&x4;
!!FU&y3<>0:E; ** Exit if some disallowed flags are set
!!if&x2>=0:; ** if alignment specified
!!BMx16:T?y6; ** y6 = Type
!!MAy6/?y5; ** y5 = Alignment
!!FU&y5<>x2:E; ** Exit if alignment mismatch
!!en:;
** Apply Bonus/Malus
!!BMx16:Adx5; ** AT bonus
!!BMx16dx6; ** DF bonus
!!BMx16:Sdx8; ** HP bonus
!!BMx16:U2/dx9; ** Max damage
!!BMx16:U1/dx10; ** Min damage
!!BMx16:S?y5;
!!FU&y5=0:E; ** No speed bonus if speed = 0
!!BMx16:Sdx7; ** Speed bonus
!!FU:E;
[/php]
____________
|
|
igrik
Promising
Known Hero
|
posted October 18, 2014 07:36 PM |
|
Edited by igrik at 20:29, 18 Oct 2014.
|
Mister_kalu said: do you know how to do the following: in the castle with cm1 trigger click on the castle and open the city hall instead of the original one? or click on tavern and open the dwelling 2? without complex SN script or something
!!CM:I?y1; find out what you have clicked
!!CM:F?i S?y2; learn the flags
!!FU&i<>0/y2<>12:E; exit if not the left mouse button
!!CM:R0; to cancel the default action
!!CA-1:T?y4; find out the number of the castle, which was clicked
!!if&y4=0:; Castle
!!VRy2:S[coordinate X]; set the desired X coordinate
!!VRy3:S[coordinate Y]; set the desired Y coordinate
!!en:;
!!if&y4=1:; Rampart
!!VRy2:S[coordinate X]; set the desired X coordinate
!!VRy3:S[coordinate Y]; set the desired Y coordinate
!!en:;
; etc.
!!CM:I39; necessarily!!!!
!!CM:Ay2/y3; click in the desired position
Should work (not tested).
I did in HotkeysWT. It works
|
|
bloodsucker
Legendary Hero
|
posted October 18, 2014 07:38 PM |
|
|
Is it possible to obtain the exact coordinates (x/y/l) of the grail from inside the game?
I don't want to reveal map, I want to alocate an hero there with !!HE:G = !!HE:W ...
P.S. I like those comments, close to my understanding of ERM...
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 18, 2014 07:57 PM |
|
|
Siegfried, no idea. I am rather uncomfortable with macros, so except the macros-which I can't check-, I see nothing wrong in your syntax. Try debug messages until error pops up.
Bloodsucker, yes OxFea posted that code long time ago, try searching upon his user name.
igrik, unfortunately HC does not support Cyrillic. Maybe replace with english descriptions, I know you can
____________
Era II mods and utilities
|
|
igrik
Promising
Known Hero
|
posted October 18, 2014 08:11 PM |
|
Edited by igrik at 20:17, 18 Oct 2014.
|
Siegfried said: Well, here is the whole function:
[php]
!!VRy3:Sy6&x3;
[/php]
!!VRy3:Sy6&x3; maybe wrong?
|
|
Siegfried
Famous Hero
|
posted October 18, 2014 09:18 PM |
|
|
Hmmm? Should be a binary and.
Thanks.
P.S. At least i found a logical error. I'll check if this caused the syntax error message. Thy y6 variable might have been uninitialized.
____________
|
|
bloodsucker
Legendary Hero
|
posted October 18, 2014 10:25 PM |
|
|
I found this in the ERM Help Index Thread
!!VRy1:S[stack number]*4+42149304;
!!UN:Cy1/4/1; attack, no return
or
!!UN:Cy1/4/0; attack and return-Control attack'n'return settings for each stack
Not sure if I understood it right but can I use !!UN:C commands to give habilities that are not in the flagged habilities help (in this case attack and return) to creatures?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 18, 2014 10:57 PM |
|
|
Don't even dream. UN:C codes are direct access to memory, only people with goodly skills can find them.
You, as mortal, have two ways to give abilities. Via !!EA trigger and via flags. EA can give 8 max, for flags check MA:X.
____________
Era II mods and utilities
|
|
Siegfried
Famous Hero
|
posted October 18, 2014 10:58 PM |
|
|
bloodsucker said:
Not sure if I understood it right but can I use !!UN:C commands to give habilities that are not in the flagged habilities help (in this case attack and return) to creatures?
Basically yes. UN:C is to write anything to any memory address. So if you know what you're doing...
____________
|
|
bloodsucker
Legendary Hero
|
posted October 19, 2014 06:18 AM |
|
|
I find strange nobody has ever notice and probably is just the screen that's wrong but this instrution:
!!EA155:B10/1/112/18/100/0/5/10/15/20/30/35/40/45/100; implosion before attack
shows they will casts 100% at novice level and then decrease.
P.S. This is your code from TEW4, forgot to tell you. You have in fact dozens of instructions with this issue. But I'm lovin to read it...
Do you also have a code to change the battle field ground (like Haart's specialty in TDS) or I misunderstood it?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 19, 2014 07:32 AM |
|
|
You have a keen eye!
However there is nothing wrong with those codes, my Alexander map has hundred of such codes. It's a context matter: human player creatures can't get experience from battle, hence their abilities are triggered to work at novice level. On the other side AI troops have always ACE level, hence the code will be 100% effective only at 0 experience and ACE.
What is between novice and ACE level is never triggered so I didn't bother to write it properly.
____________
Era II mods and utilities
|
|
bloodsucker
Legendary Hero
|
posted October 19, 2014 08:15 AM |
|
|
Salamandre said: You have a keen eye!
Not so much, I'm using it and I only noticed after hundreds of battles...
But I tought the first 100 was really the amout of damage done by the spell. The thing is, I've changed it to 200 and in a fight (against Iron Golems so less 40%) it gave me a total of 131. I tought it was suposed to do X damage for each creature (like the 100 HP from each AA) but looks like an absolute value. I seem to remember u worked this with Hero_of_Light some time ago. Do you still remember how it is done?
Most things seem to be working fine with my new mod (I decided to keep all scripts in a single mod but I still script most things in separate files) BUT frequently when I try to load the game stops to function. First I tought I was by accident but now I belive something I'm doing is provoking it, yet I have no clue about why this things happen. Except for the flagged habilities I have no direct accesses to memory but I belive my now three battle objects have some conflicts, even if I couldn't foun them. Maybe I miss something about the use of v vars or PO instruction.
Battle 1
ZVSE
!?OB161/215/0&1000;
!!PO995:S?v1; ask what value in PO, v995 holds current object coordinates
!!IF&v1>=100:M^You have exausted your battles here for today.^; exit if already 100 times today
!!FU&v1>=100:E;
!!IF:M^You are in your %V1 battle here today^;
!!VRv1:+1; increment +1 after each visit
!!PO995:Sv1; set PO to v1
!!FU&v1=1:E;
!!IF:Q1^You can get some resources if you win a battle here. Do you want to try your luck?^;
!!FU&-1:E;
!!HE-1:P?y1/?y2/?y3; [Get position]
!!VRv2:S0 R6; randomize v2 to 0-7
!!HE-1&v2=0:Ty1/y2/y3/116/2000; Gold
!!HE-1&v2=1:Ty1/y2/y3/31/2000; Crystal
!!HE-1&v2=2:Ty1/y2/y3/33/2000; Mercury
!!HE-1&v2=3:Ty1/y2/y3/32/2000; Sulfur
!!HE-1&v2=4:Ty1/y2/y3/30/2000; Stone
!!HE-1&v2=5:Ty1/y2/y3/22/1800; Wood
!!HE-1&v2=6:Ty1/y2/y3/33/1750; Gems
!!EA136:B10/1/112/18/100/0/5/10/15/20/30/35/40/45/100; implosion before attack
!#TM2:S1/999/1/255;
!?TM2;
!!PO161/215/0:S0; reset object square to 0 so can start visit again
______________________
Battle 2
ZVSE
!?OB152/233/0&1000;
!!PO989:S?v1; ask what value in PO, v998 holds current object coordinates
!!IF&v1>=250:M^You have exausted your battles here for today.^; exit if already 150 times today
!!FU&v1>=250:E;
!!IF:M^You are in your %V1 battle here today^;
!!VRv1:+1; increment +1 after each visit
!!PO989:Sv1; set PO to v1
!!FU&v1=1:E;
!!IF:Q1^Here you can find easy oponents to improve your skills, want to give it a try?^;
!!FU&-1:E;
!!HE-1:P?y1/?y2/?y3; [Get position]
!!VRv2:S0 R8; randomize v2 to 0-8
!!HE-1&v2=0:Ty1/y2/y3/1/300;
!!HE-1&v2=1:Ty1/y2/y3/14/300;
!!HE-1&v2=2:Ty1/y2/y3/16/200;
!!HE-1&v2=3:Ty1/y2/y3/29/300;
!!HE-1&v2=4:Ty1/y2/y3/30/120;
!!HE-1&v2=5:Ty1/y2/y3/43/350;
!!HE-1&v2=6:Ty1/y2/y3/56/300;
!!HE-1&v2=7:Ty1/y2/y3/58/240;
!!HE-1&v2=8:Ty1/y2/y3/98/300;
!!IF:M^You've found an artifact^;
!!VRv3:S0 R9;
!!HE-1&v3=0:A4/8;
!!HE-1&v3=1:A4/7;
!!HE-1&v3=2:A4/13;
!!HE-1&v3=3:A4/60;
!!HE-1&v3=4:A4/97;
!!HE-1&v3=5:A4/20;
!!HE-1&v3=6:A4/26;
!!HE-1&v3=7:A4/54;
!!HE-1&v3=8:A4/14;
!!HE-1&v3=8:A4/156;
!#TM2:S1/999/1/255;
!?TM2;
!!PO152/233/0:S0;
_________________
Battle 3
ZVSE
!?OB144/189/0&1000;
!!PO992:S?v1; ask what value in PO, v998 holds current object coordinates
!!IF&v1>=20:M^You have exausted your battles here for today.^; exit if already 150 times today
!!FU&v1>=20:E;
!!IF:M^You are in your %V1 battle here today^;
!!VRv1:+1; increment +1 after each visit
!!PO992:Sv1; set PO to v1
!!FU&v1=1:E;
!!IF:Q1^In this place dwell the strongest creatures in this universe, are u strong enouch or crazy enouch to give it a try?^;
!!FU&-1:E;
!!HE-1:P?y1/?y2/?y3; [Get position]
!!VRv2:S0 R4; randomize v2 to 0-7
!!HE-1&v2=0:Ty1/y2/y3/132/750; Azures
!!HE-1&v2=1:Ty1/y2/y3/133/800; Crystal
!!HE-1&v2=2:Ty1/y2/y3/134/1000; Faerie
!!HE-1&v2=3:Ty1/y2/y3/135/1000; Rust
!!HE-1&v2=4:Ty1/y2/y3/196/800; Dracolich
!!VRv3:S0 R3;
!!HE-1&v3=0:Fd1/d1/d1/d1;
!!HE-1&v3=1:Ed50000;
!!HE-1&v3=2:C2/150/10/1/160000/2;
!!HE-1&v3=3:A4/2;
!#TM2:S1/999/1/255; always use timer 2 for an each day timer. It will be compatible with wog timers.
!?TM2;
!!PO144/189/0:S0; reset object square to 0 so can start visit again
Battle 3 is not sufficiently worked yet, cause it's hard to test. I take some time to build an hero who can take it a by that time it says I have ALREADY fought all the battles I had the right to...
I wanted to give money also but I couldn't manage the trick with hero's owner.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 19, 2014 09:10 AM |
|
|
bloodsucker said:
!!PO995:
!!PO989:
!!PO992:
Where did you see in my scripts PO995, 989 and 992?! What my comment says?
ask what value in PO, v998 holds current object coordinates
|
|
bloodsucker
Legendary Hero
|
posted October 19, 2014 09:16 AM |
|
|
Salamandre said:
bloodsucker said:
!!PO995:
!!PO989:
!!PO992:
Where did you see in my scripts PO995, 989 and 992?! What my comment says?
ask what value in PO, v998 holds current object coordinates
So I should use the same reference for different objects? I tought the problem was precisely that I was overwriting the information by using it for different counters...
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 19, 2014 09:24 AM |
|
|
Try to compare with the manual every time you write something but not sure what is.
When you visit an object, its position is stored in v998, v999 and v1000. (x/y/z). As long as you visit THAT object, those are the variables storing its position*.
!?OBx/y/z&1000;
!!OB998...
!!PO998... [both are referring to above object]
So now, your timer which sets POx/y/z to 0 will work correctly. Read OB receiver, on top:
*v998/v999/v1000 variables will store the location of the current object visited. Also, you can refer to it easily with an indirect reference (for example: !!OB998:...)
____________
Era II mods and utilities
|
|
bloodsucker
Legendary Hero
|
posted October 19, 2014 09:50 AM |
|
|
Ops!!! Thank you, I forgot for a moment that !!PO "creates" a specific object for each location.
P.S. I need Help, PLEASE. As you probably all know by now I am a redimeless cheater. The problem is, this is going exponential since I learned ERM (for instance, I'm only testing but there wasn't one time I didn't dig for grail day 1...). My private mod is doing well, I was able to acchive many of my goals but, as Sal had warn me a thousand times, my armies became so powerfull nor BAI nor 5x growth are enouch to set an oponent.
And ALL my ideas are about how can I became bigger not how can I create an oponent that defies me.
So, what I wanted to ask is if any of you has some ready made definitions for the towns I don't play with (Rampart, Inferno, Conflux, Dungeon and Fortress) that can borrow me so I can copy paste them and don't even look to see what I will be facing (or I will think of ways to crush them from outside the game...).
THank you for your help and compreension.
|
|
mister_kalu
Known Hero
|
posted October 19, 2014 07:45 PM |
|
|
igrik said:
Mister_kalu said: do you know how to do the following: in the castle with cm1 trigger click on the castle and open the city hall instead of the original one? or click on tavern and open the dwelling 2? without complex SN script or something
!!CM:I?y1; find out what you have clicked
!!CM:F?i S?y2; learn the flags
!!FU&i<>0/y2<>12:E; exit if not the left mouse button
!!CM:R0; to cancel the default action
!!CA-1:T?y4; find out the number of the castle, which was clicked
!!if&y4=0:; Castle
!!VRy2:S[coordinate X]; set the desired X coordinate
!!VRy3:S[coordinate Y]; set the desired Y coordinate
!!en:;
!!if&y4=1:; Rampart
!!VRy2:S[coordinate X]; set the desired X coordinate
!!VRy3:S[coordinate Y]; set the desired Y coordinate
!!en:;
; etc.
!!CM:I39; necessarily!!!!
!!CM:Ay2/y3; click in the desired position
Should work (not tested).
I did in HotkeysWT. It works
i test it and edited with some changes it Works for me
!?CM1;
!!CM:I?y1;
!!CM:F?i S?y2; learn the flags
!!FU&i<>0/y2<>12:E;
!!CA-1:T?y4;
!!if&y4=0:; castle screen
!!VRy2:Sxxx;
!!VRy3:Syyy;
!!en:;
!!CM&y1=J:I39; without it does not work!: J is the first building, the false
!!CM&y1=J:Ay2/y3; The second building, the desired on the y2/y3 coordinates,
thanks
Salamandre, any idea of redraw town screen after build with CA:B1 or B6 with the build def and how to check the right hero into de tavern?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 19, 2014 07:49 PM |
|
|
bloodsucker said: I need Help, PLEASE. ALL my ideas are about how can I became bigger
Here. Take care!
____________
Era II mods and utilities
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 19, 2014 07:54 PM |
|
|
mister_kalu said: any idea of redraw town screen after build with CA:B1 or B6 with the build def and how to check the right hero into de tavern?
!!UN:R4/1; to redraw town screen
!!OW:V#/$1/$2; to find left/right tavern heroes.
;# owner
;$1/$2 left right heroes
____________
Era II mods and utilities
|
|
|