Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: ERM help and discussion
Thread: ERM help and discussion This Popular Thread is 407 pages long: 1 50 100 150 ... 177 178 179 180 181 ... 200 250 300 350 400 407 · «PREV / NEXT»
JimV
JimV


Responsible
Supreme Hero
posted January 08, 2013 04:57 AM

I haven't parsed this part of script00 (78) in detail, but I see this pertaining to 63/7:

** table fields: type/subtype/footprint/terrain/back wall/edge x/edge y
** footprint values:  0 = Y, 1 = RY, 2 = YR, 3 = RYR, 4 = other

!!VRvy10&y3=1:C63/7/3/-1/2/2/1; [smuggler] [actually RRYR]


Comparing to other WoG objects, it appears that edge x = number of tiles from yellow square to lower right corner tile of object frame horizontally, and edge y = number of tiles from yellow square to LRCT of object frame vertically, in which case the actual values for 63/7 should be 3/1, not 2/1.

I don't know if this would be enough to prevent the yellow square from landing at x=0 but it would be my first test.  Also I would change the RRYR comment to RYRR.

(Actually the object is:
_RY_R_
___R__)

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
artu
artu


Promising
Undefeatable Hero
My BS sensor is tingling again
posted January 08, 2013 05:24 AM
Edited by artu at 05:25, 08 Jan 2013.

The Wogification (hence randomly replacing stuff on random maps) part of the mod is only the above section of script 78 anyway, so I did as you say and replaced:

!!UN:P108/?y3; [check if Junk Merchant script is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/7/3/-1/2/2/1; [Smugglers Hideout] [actually RRYR]


into this:

!!UN:P108/?y3; [check if Junk Merchant script is enabled]
!!VRy3&y21=0:S0; [set y3 to 0 if Replace Objects isn't enabled]
!!VRy20&y3=1:+1; [add one to object counter]
!!VRy11&y3=1:Sy20 *7; [number to add to index variable]
!!VRy10&y3=1:S593 +y11; [new index number]
!!VRvy10&y3=1:C63/7/3/-1/2/3/1; [Smugglers Hideout] [actually RYRR]

Then I made a test map and placed 10 mystical gardens on the edge of  a test map, the result is they still turn into SH on the edge and they still give same error messages. Should I keep the changes and what else can I try? Thanks in advance.



 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JimV
JimV


Responsible
Supreme Hero
posted January 08, 2013 05:57 AM
Edited by JimV at 06:12, 08 Jan 2013.

I see four further possibilities, in the order I would test them (stopping at the first one which worked):

1) Increase the edge-x value again to 4 - fictitious, but I hope the script is smart enough not to allow a (fictitious) yellow square to be off the map. I would add a comment explaining the fictitious value, so someone doesn't see it and change it back. Disadvantage: the script checks to see that there is a free path somewhere around the yellow square and no red square beneath the yellow square; therefore with a fictitious YS location, a Hideout might be placed where the YS is only reachable by flying or DD, or the placement might fail at some locations. (Note the same is true currently since the current YS location is also fictitious - so if such problems have not been noticed, maybe they are liveable.)

2) Leave the edge-x at 3, but change the footprint value from 3 to 4 and move the whole section down to where type 4 (large) objects are processed, around lines 1325 to 1343 (currently).  Disadvantage: this will only replace Dragon Utopia objects, so not many Hideouts will be added.  Also the percentage of DU objects replaced should probably be increased from 40% to 60%, in this case.

3) Add a special test somewhere in the script to prevent placing the yellow square at X=0, in one of the checking functions. Disadvantage: would require parsing the functions in detail to see where and how to implement the check.

4) Edit the ZxxxxTS.txt files to move the YS to the right one square, eliminate the RS beneath it, and go back to the 2/1 edge values.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
artu
artu


Promising
Undefeatable Hero
My BS sensor is tingling again
posted January 08, 2013 06:16 AM

1) This seems to work out, the mystical gardens on edge still turn into Hideouts but there are no more error messages. I also went in and Smuggler seems to function as usual. So I guess that's it. Thank you very much for your help again.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Siegfried
Siegfried


Famous Hero
posted January 08, 2013 09:23 AM

I found something similar. It seems that for placing and removing objects not the yellow entrance square is relevant, but the lower right corner. I've added in my scripts the option for non-necromancers with more than 100 mana points to destroy necro dwellings. It worked after i adjusted some of the dwelling positions where the entrance square is not the lower right corner.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
robizeratul
robizeratul


Known Hero
posted January 08, 2013 09:58 AM

someone please help me with this,I don't remember the thread but I read somewhere how to change creature stats

this is what I did:

1)Open MMarchive
2)go to crtraits.txt
3)export
4)edit with text table editor
5)copy to the main H3 data folder

I did this and I can't open Wog.It works on heroes shadow of death though...any suggestions?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JimV
JimV


Responsible
Supreme Hero
posted January 08, 2013 02:22 PM
Edited by JimV at 14:24, 08 Jan 2013.

I have done the same process without disabling WoG, so my guess is that the specific changes to crtraits.txt were somehow invalid. For example, reducing the number of lines in a text file (except for those which contain a variable number of lines and a line count) will cause WoG to crash.

Note that crtraits, crtrait0, and zrtraits all contain creature information, so that (valid) changes might have to be made to all three - maybe only to crtaits or zrtraits but I have not tested this. Also, under Era, I think the modified file should be placed in the Data subfolder of the top-priority mod (although placing it in the main Data did not disable WoG, in my recollection).

P.S. Since this question has nothing to do with ERM, a modding thread such as "Introduction to Modding and Scripting" would be a better place to post it, since better modders hang out on modding threads.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JimV
JimV


Responsible
Supreme Hero
posted January 08, 2013 02:27 PM
Edited by JimV at 14:27, 08 Jan 2013.

Quote:
It seems that for removing objects not the yellow entrance square is relevant, but the lower right corner.


As clearly stated in ERM Help for the UN:O receiver.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
kegolo
kegolo


Promising
Famous Hero
of infamy
posted January 08, 2013 05:20 PM

Quote:

Note that crtraits, crtrait0, and zrtraits all contain creature information, so that (valid) changes might have to be made to all three - maybe only to crtaits or zrtraits but I have not tested this.


crtrait and crtrait0 (not exactly sure the difference between these two) are loaded on executable startup, and changes in these can be seen when right clicking town names (team lineup names will change if you change creature names)

zcrtrait overrides the things in these two when starting a game.

and the reason wog won't start is as JimV said, you must have altered the number of lines in any of these, or only altered line number in one and not all 3. I say only line number because other changes like stats and names can differ between the three files.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Bersy
Bersy


Honorable
Supreme Hero
posted January 09, 2013 03:22 PM

Guys, do you have ready to use scripts for Era to prevent stack size overflowing in Hero screen? One player needs such scripts.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JimV
JimV


Responsible
Supreme Hero
posted January 09, 2013 04:26 PM
Edited by JimV at 16:27, 09 Jan 2013.

There are several over-flow-fix scripts in "The Dragon Slaughter v2.07".  This is one that involves troop size (count):

ZVSE

* troop slot move checker (Town Screen), JHV, Jan. 18, 2011
* Fixes this problem:
*  Troop numbers >32767 must be moved by either shift-left click
*  or Split Creatures Button in Town Screen because in Town Screen troop
*  counts use 2-byte integer arithmetic except in those functions.

* uses unclaimed flags 452-455 and v3410-v3417 and FU8039-FU8043

!?OB98&1000; Town
!!IF:V452/0 V453/0 V454/0 V455/0;
!!VRv3412:C8040/0/8041/0;

!?CM1&454; click on Town Screen [CM1&454 must be before CM1&453]
!!CM:S?v6; click type
!!FU&v6=13:E; exit if LMB release
!!IF:V454/0 V455/0; re-enable 4th CM1

!?CM1&453; click on Town Screen [CM1&453 must be before CM1&452]
* get second slot click, after SCB
* NOTE--in Town Screen, for 2nd slot click get push (12) AND release (13) triggers,
* even after push change to SCB release.
!!VRv6:Sv3410+2; read-->write
!!VRv7:Sv3414+2;
* Do not move last army to Garrison
* NOTE--before I added this test, I didn't have to reset type, just number.
* Apparently HE:C resets type to -1 if the number is negative.
!!FUv3410:Pv3411/1/2; v1=type, v2=number
!!FUv3414:Pv3415/3/4; v3=type, v4=number
!!IF:V1/0;
!!IF&v1=v3412/v2=v3413/v3=v3416/v4=v3417:V1/1;
!!IF&1:V452/1 V453/0; click of last army to Garrison w/be negated, 1st slot still active
!!FU&1:E; go back to CM1&452 for valid 2nd slot
!!FUv6:Pv3411/3416/3417;
!!FUv7:Pv3415/3412/3413;
!!IF:V453/0 V454/1; enable 1st CM1
!!UN:R4/-1;

!?CM1&452; click on Town Screen [CM1&452 must be before CM1&-455]
!!CM:F?v1 I?v2 S?v3; get flag and clicked object values
!!IF:V452/0 V454/1; enable 2nd CM1, disable this CM1--assume normal operation
!!FU&v1=0/v2=154/v3=13:E; if SCB clicked by player, done here
!!FU&v1=0/v2=123/v3=12:E; if Garrison Hero clicked by player, done here
!!FU&v1=0/v2=125/v3=12:E; if Visiting Hero clicked by player, done here
!!IF:V452/1 V454/0; restore CM1&452 operations
!!FU|v1<>0/v3<>12:E; exit if not left-click push
!!FU8039:Pv2/3414/3415; get FU# and slot # for valid slot
!!FU&1:E; exit if not creature slot
!!IF:V452/0 V454/1; assume normal operation for now
!!FU&v3410=v3414/v3411=v3415:E; normal operation if same slot re-clicked (view creature)
!!FUv3410:Pv3411/3412/3413; v3412=type, v3413=number
!!FUv3414:Pv3415/3416/3417; v3416=type, v3417=number
!!FU&v3412=v3416:E; normal op if same type combined (works ok)
!!IF:V1/0;
!!VRv4:Sv3413+v3417;
!!IF|v3413>32767/v3417>32767/v4>32767:V1/1;
!!FU&-1:E;
!!IF:V452/0 V453/1 V454/0; disable this CM1, enable CM1&453 [it must restore #'s]

!?CM1&-455; click on Town Screen
!!CM:F?v1 I?v2 S?v3; get flag and clicked object values
* Note--normally get I=slot code/S=12 followed by I=slot code/S=13,
* But after clicking the Town Castle (I=7/S=12) then exiting its screen,
* the next slot click gives, e.g., I=117/S=12, I=-1/S=13.
* So use the S=12 trigger:
!!FU|v1<>0/v3<>12:E; exit if not left-click push
!!FU8039:Pv2/3410/3411; get FU# and slot # for valid slot
!!FU&1:E; exit if not creature slot
!!FUv3410:Pv3411/3412/3413; v3412=type, v3413=number
!!FU&v3412<0:E;
!!IF:V452/1 V455/1; set flag for next click to be handled by CM1&452

!?FU8039; x1=CM1:I (slot #s 115-121 & 140-146), set vx2 & vx3 to FU# and slot
!!IF:V1/1; set for non-troop slot [flag 1 = 0 for valid troop slot]
!!FU&x1>121/x1<140|x1<115/x1>146:E;
!!IF:V1/0;
!!VRvx2:S8040; start w/Garrison
!!VRvx3:Sx1-115;
!!FU&vx3<7:E; done if valid slot
!!VRvx2:S8041; set for Visiting
!!VRvx3:Sx1-140;

!?FU8040; Garrison function, x1=slot, vx2=type, vx3=number
!!CA-1:H0/?y1;
!!CA-1&y1<0:M2/x1/?vx2/?vx3;
!!HEy1&y1>-1:C0/x1/?vx2/?vx3;

!?FU8041; Visiting Hero function,x1=slot, vx2=type, vx3=number
!!CA-1:H1/?y1;
!!VRvx2:S-1;
!!VRvx3:S0;
!!HEy1&y1>-1:C0/x1/?vx2/?vx3;

!?FU8042; Garrison function, x1=slot, vx2=type, vx3=number
!!CA-1:H0/?y1;
!!CA-1&y1<0:M2/x1/vx2/vx3;;
!!HEy1&y1>-1:C0/x1/vx2/vx3;

!?FU8043; Visiting Hero function,x1=slot, vx2=type, vx3=number
!!CA-1:H1/?y1;
!!HEy1&y1>-1:C0/x1/vx2/vx3;

* TestSlotMoveHMS3, JHV, Feb. 18, 2012

* uses v1-v10, and FU8044

!?CM3; click on Hero Meeting Screen
!!CM:F?v1 I?v2 S?v3 H?v4/?v5; get flag and clicked object values, Left-Right Heroes
!!FU|v1<>0/v2<13/v2>78/v3<>12:E; exit if not left-click push or not cr slot or number
!!FU&v2>26/v2<65:E; exit if not creature slot (13-26) or number (65-78)
* check for first slot selected
!!UN:C6962576/4/?v6;
!!VRv6:+72; add offset
!!UN:Cv6/4/?v8; get 1st selected slot's side (-1 if none)
!!FU|v8<0/v8>1:E; exit if 1st slot not selected yet
!!VRv9:Sv6+8;
!!UN:Cv9/4/?v10; get 1st selected slot's number (0-6)
!!VRy1&v2<20:S0; y2=2nd selected slot's side (0-left, 1-right)
!!VRy1&v2>19/v2<27:S1;
!!VRy1&v2>64/v2<72:S0;
!!VRy1&v2>72/v2<79:S1;
!!VRy2&v2<20:Sv2-13; y2=2nd selected slot's humber
!!VRy2&v2>19/v2<27:Sv2-20;
!!VRy2&v2>64/v2<72:Sv2-65;
!!VRy2&v2>72/v2<79:Sv2-72;
!!FU&v10=y2/v8=y1:E; exit if same slot re-clicked
!!FU8044:Pv4/v5/v8/v10/y1/y2; swap contents

!?FU8044; x1=HE(0), x2=HE(1), x3=side A, x4=slot A, x5=side B, x6=slot B
!!VRy1:Sx1; side A Hero
!!VRy1&x3=1:Sx2;
!!VRy2:Sx1; side B Hero
!!VRy2&x5=1:Sx2;
!!HEy1:C0/x4/?y3/?y4/?y5/2; Slot A y3=type, y4=number, y5=experience
!!HEy2:C0/x6/?y10/?y11/?y12/2; Slot B
!!FU&y3=y10:E; combining same type works okay
!!CM:R0; disable move
!!EXy1/x4:R?y6/?y7/?y8/?y9; Slot A artifact info
!!EXy2/x6:R?y13/?y14/?y15/?y16; Slot B artifact info
* swap
!!HEy1:C0/x4/y10/y11/y12/2; Slot B-->A
!!HEy2:C0/x6/y3/y4/y5/2; Slot A -->B
!!EXy1/x4:Ry13/y14/y15/y16; Slot B-->A
!!EXy2/x6:Ry6/y7/y8/y9; Slot A-->B
!!UN:Cv6/4/-1; unselect 1st selected slot's side
!!UN:Cv9/4/-1; unselect 1st selected slot's number
!!VRy17:Sv9+8; flag for 1st selection
!!UN:Cy17/4/-1; unselect 1st selection

It works for the Town Screen (when a Hero enters a Town and moves or combines troops) and the Hero Meeting Screen. The UN:C addresses (e.g., [0x6A3D90]+0x48) used worked for both WoG 3.58f and Era 1.8 on my system.  I have not tested under Era 2.  If there is a problem under Era 2 I will take responsibility for fixing it.

There are other scripts which handle stack experience overflow and Hero experience overflow.  As far as I know, there are no longer any overflow problems in TDS.  (More details are discussed in the TDS thread.)

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Bersy
Bersy


Honorable
Supreme Hero
posted January 09, 2013 05:48 PM
Edited by Bersy at 18:20, 09 Jan 2013.

Thank you very much.

EDIT: Player reported that script worked successfully. Now the only trouble left is experience overflowing. There is a script from TDS, right?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JimV
JimV


Responsible
Supreme Hero
posted January 09, 2013 08:31 PM
Edited by JimV at 20:41, 09 Jan 2013.

You are of course very welcome and thanks again for Era et al. I just finished testing under Era 2.4 myself and was going to edit my comment to say that the UN:C address above also works under Era 2.4

Creature experence:  I tried several versions in TDS.  The earliest checked creature experience after battles and set negative values back to level 10; and also checked troop experience when the troop slot was right-clicked in the Hero screen and reset negative values to 10.

Currently in TDS I do this instead:

ZVSE

* CreatureExpRescale, JHV, Jan. 8, 2011

* uses FU8038

!?FU8039; x16=cr#
!!EAx16:L?y1 C?y2;
!!VRy1: :100;
!!VRy2: :2;
!!EAx16:Ly1 Cy2;
!!VRy2:Sx16*20+v5; address of Level 11 - Level 10 exp for creature
!!UN:Cy2/4/?y3;
!!VRy3: :100;
!!UN:Cy2/4/y3;

!#UN:V?v1/?v2; WoG/ERM versions
!#VRv5&v1=358:S8771844; base address of Delta11 for WoG 3.58f
!#VRv5&v1>358/v1<401:S8776540; base address of Delta11 for Era 1.8
!#IF&v1<358|v1>400:M^WoG version not recognized, Creature Experience Level script not activated!^;
!#DO8038/0/196/1|v1=358/v1=359/v1=400:P; scale back creature exp levels by 1/100

This "re-scales" all creature experience settings/limits by a factor of 100. EA:L and EA:C allow changing most of the limits, but there was one I had to find UN:C addresses for.

In TDS, these settings do not seem to affect game play, and eliminate all need to check for overflows. In a map in which experience is harder to obtain, a different scaling factor might work better.

Edit - I see that the EA:C limit for experience gained per battle was actually divided by 2, not 100.  This is probably the parameter that will need the most adjustment for different maps.  In TDS the battles are all huge.

Edit 2 - I also had to adjust the Henchman script which is used in TDS and depends on creature experience level.  TDS uses a lot of WoG scripts (or variations on them), and that was the only one which was affected by the rescaling - but there might be others which I am not aware of.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Bersy
Bersy


Honorable
Supreme Hero
posted January 09, 2013 09:18 PM

Thank you again, posted the script to the guy.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OxFEA
OxFEA


Promising
Famous Hero
feanor on DF2.ru
posted January 09, 2013 10:51 PM


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted January 10, 2013 11:51 AM

Same dwelling offering different creatures from one town to another?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
OxFEA
OxFEA


Promising
Famous Hero
feanor on DF2.ru
posted January 10, 2013 01:18 PM

Yes.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Siegfried
Siegfried


Famous Hero
posted January 10, 2013 01:21 PM

Very interesting. How? Possible with WoG?

I'd like to add that as a scripted option to some heroes, depending on speciality.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted January 10, 2013 06:42 PM

Does anyone have some code or idea on how to skip first human player turn (get AI move directly on day 1)?
____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JimV
JimV


Responsible
Supreme Hero
posted January 10, 2013 08:42 PM

Using the XFiles plugin under Era 2, use a day-one timer, check for human players (and any other necessary conditions), then if so execute:

!!SN:L^XFiles.dll^/?y2; get address of XFiles.dll in y2
!!SN:Ay2/^KeyPress^/?y3; y3 — address of function KeyPress
!!SN:Ey3/1/69/1042; send "E" to end turn

(See Battle Poker 2 for example uses.)

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 407 pages long: 1 50 100 150 ... 177 178 179 180 181 ... 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.5968 seconds