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 412 pages long: 1 50 100 ... 102 103 104 105 106 ... 150 200 250 300 350 400 412 · «PREV / NEXT»
JimV
JimV


Responsible
Supreme Hero
posted October 02, 2011 12:13 AM
Edited by JimV at 00:15, 02 Oct 2011.

I have revised the XFiles.erm script in the XFiles Test map as follows, and re-uploaded the package at Box.net.

The script checks for a valid SetOption address (>0) from Angel.dll, and uses that if one is found.  It also gets the starting "hook" value:


!!UN:C5168326/4/?v31; TL triggers off = 2657254 per Bersy

(By my arithmetic,  $4EDCC6= 5168326, $0006A1C6 = 434630 (on), and $00288BE6 = 2657254 (off).)

If the SetOption addess is zero, and the hook value is 2657254, then the script attempts to use the UN:C pokes to control the TL timers.

Using the on/off UN:C pokes without using SetOption has no effect on my system, under Era 1.8.  I do not have Era 1.91, so I cannot test there.

On my system, the starting hook value is indeed 2657254 at the beginning of Heroes, but if I restart the demo map without doing anything at all (other than the ERM !# instructions and PI commands), it becomes 434630, and stays that way for all subsequent restarts.  This seems a bit strange to me, but I guess that is why I don't make the big bucks.

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


Honorable
Supreme Hero
posted October 02, 2011 09:39 AM

Quote:
1. Why there are several identical strings in the exe? For example the string './WoG.ini'  is there nine times. Can eigth of them be removed and all pointers set to the remaining one? (Didn't have time to check how they are used in the code. If they are changed at some point, then of course the can't be deleted)

C++, compilation without optimization, inline constant usage ".\\WoG.ini". Are you going to replace file name?

Quote:
2. I have also found the load game function that calls several functions which load stuff that was added in WoG. It was obvious that  data like town demolitions, Commanders and creature experience, but there were also some functions looking for sections in the savegame that begin with NTWN and SPL0 (I named them LoadNewTown and LoadSpell in my disassembly). Are they fully implemented and usable or do they need finishing? (Also, what does function LoadB1 (sstarts at 0x00706862) do?)

Saves new town buildings info and settings. The code is not finished obviously.
SPL0 - modified !!SS info.

Quote:
I have revised the XFiles.erm script in the XFiles Test map as follows, and re-uploaded the package at Box.net.

I'm really sorry, but it seems that I mixed "on" with "off".
$0006A1C6 = 434630 (off), and $00288BE6 = 2657254 (on).

Also Era 1.9 exports SetOption (compatibility reasons), the resulting address is not zero, but the function does nothing.
The reasons are clear:
-) Everything is settled by memory patches.
-) Color texts became universal and don't need switching.
-) Both Grail and TL patches can be reproduced via UN:C or memory patches.

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


Promising
Famous Hero
posted October 02, 2011 02:48 PM

Quote:

C++, compilation without optimization, inline constant usage ".\\WoG.ini". Are you going to replace file name?

No, I was just looking here and there in the code out of curiosity, saw this and thought about possible optimisation (however it's probably not worth the effort..)

Also what does command HE:L3 do? It's not documented in ERM help, but some code that seems similar to that of HE:L4 is executed if this command is found.

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


Honorable
Supreme Hero
posted October 02, 2011 03:01 PM

Russian ERM manual is ok.
HE:L3 - restore portrait.
HE:L4 - set portrait to that of hero X.

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


Responsible
Supreme Hero
posted October 02, 2011 04:45 PM

Bersy, thanks to your information I now have a test script which does not require SetOption.  (In hindsight, I should have figured it out from the clues I had.)  I have re-uploaded the new demo map at:

http://www.box.net/shared/1n069e3vc5vixc8l1zk5

Thanks again for all your help here.

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


Promising
Famous Hero
posted October 02, 2011 05:03 PM
Edited by solitaire345 at 17:09, 02 Oct 2011.

Quote:
Russian ERM manual is ok.
HE:L3 - restore portrait.
HE:L4 - set portrait to that of hero X.


Yup. Found this myself by testing this in game, but couldn't delete my question, because internet connection was down for a while and later I simply forgot about it. Thanks anyway

EDIT:
This command was even described in english help, but I didn't notice it. Oh well...
Also a question about HE:L0: how does it work? I tried the code !!HE:L0/1; and got a syntax error. (File: service Line: 986)
____________

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


Honorable
Supreme Hero
posted October 02, 2011 05:53 PM

Jim, was glad to help.
About HE:L0. Argument should be number and the function calls CustomHPic. Cannot understand its meaning. Maybe old not working code.

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


Responsible
Supreme Hero
posted October 04, 2011 10:32 PM

Is there any way to change the creatures' background (i mean the background when you click on it and shows animation and its stats not the one on hero screen) for a select number of creatures only?

I am asking this because i made a new background for the sea creatures faction of my mod but since they are neutral creatures they share a background with the war machines (and so the war machines when clicked have a sea background).

In fact if there was a way to make each war machine on a hero gain the town's background that would be more kewl. For instance make the war machines a Knight has to be Castle creatures (and have the castle's background when clicked) and the Ranger's have Rampart's background etc.

Either way will be fine. If someone knows how to please share.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 04, 2011 11:28 PM

You can start with this:

ZVSE

!?BA0;
!!BA:H0/?y1;
!!HEy1:B2/?y2; [get attacker class]
!!VRy2::2; [get town he belongs to]
!!DO333/145/148/1:Py2; [set war machines to this town]

!?FU333;
!!MA:Ox16/x1;

The problem is that you can't change the background twice if two different heros are in (or at least I don't know how). The CM4 command ignore MA receivers in battle.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted October 04, 2011 11:46 PM

Actually i was looking for an erm command that works like the hero portrait changing one.

I mean placing a pcx file in the heroes data folder and using a command to acquire that pic and asign it to the creature's background. Is there something like that?
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 05, 2011 12:02 AM

As I said, the only option to change it if there are two different heroes is through CM4 (right click on unit).

But my guess is that MA changes must be done only in BA trigger, because CM4 ignores them. Here is my test script, commands run fine but no change in background:

ZVSE

!?BA0;
!!BA:H0/?y1;
!!BA:H1/?y2;
!!HEy1:B2/?y3;
!!HEy2:B2/?y4;
!!VRy3::2;
!!VRy4::2;
!!VRv101:Cy3/y4;

!?CM4;
!!CM:D?y1;
!!FU|y1<0/y1>186:E;
!!BU:Ey1/?y2;
!!FU&y2<0:E; exit if no battle stack
!!BMy2:T?y3;
!!FU|y3<145/y3>148:E;
!!BMy2:I?y4;
!!DO333/145/148/1&y4=0:Pv101;
!!DO333/145/148/1&y4=1:Pv102;
!!IF&y4=0:M^War machine changed its background to %V101^;
!!IF&y4=1:M^War machine changed its background to %V102^;

!?FU333;
!!MA:Ox16/x1;

____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted October 05, 2011 12:08 AM

Quote:
The CM4 command ignore MA receivers in battle.


MA commands apply to basic creature properties.  In battle (as I understand it), creatures can have various bonuses to their properties as a result of their Hero's primary skills, spells, etc.  So in battle they become stacks.  Once they have been converted to stacks, changing their basic creature properties no longer affects them.  To change stacks in battle, use BM commands instead of MA commands.  E.g., use BM:F instead of MA:X.

(Changing MA properties may show up like this, though:  say the creature basic Speed is 5, and the stack has Haste.  After MA:Sd-2, its speed may show as 3(7) instead of 5(7) - basic speed has changed but not the stack's speed+bonuses.)

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


Admirable
Omnipresent Hero
Wog refugee
posted October 05, 2011 12:13 AM

I figured this, so I guess there is no way to change a creature's line up regardless the class of the hero controlling it, as HoL asks for.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted October 05, 2011 01:13 AM

That's what i was trying to say in my previous post.

Since it's not possible to change it in battle i asked if there's a way to permanently asign a pcx picture with a creature's background (just like we use a command to asign a hero's portrait by placing a pcx in the data folder). That would work too because then the neutral creatures would have a diferent background than the war machines.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 05, 2011 01:44 AM

I don't understand what you mean. You want the war machines to show the background of the native town of the hero owning them. If one hero, it works. If two, they will show the same background, once the battle started and BA trigger occurred, there is no command to change town affiliation for one stack during the battle. Nor sending to read pcx from Data folder or whatever when war machines turn.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted October 05, 2011 01:52 AM

Yes, but since that didn't work (and even if it did it would only apply on battles) i asked for another solution to my problem.

As i said my problem was that i made the neutral creatures in my mod a sea creature oriented faction and so the war machines had the same background. THAT was the problem. One solution was changing the background according to the hero. As you said it doesn't really work so i droped it.

So what i was trying to ask in my two previous posts is if there was a way of changing the background of some creatures using pcx files in the Data folder. That way I could just change the backgrounds of the war machines and make them diferent than the neutral background.
____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 05, 2011 01:55 AM

Just set all war machines to castle (or other town) before the game starts. They are creatures.
____________
Era II mods and utilities

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


Responsible
Supreme Hero
posted October 05, 2011 05:44 AM
Edited by JimV at 05:45, 05 Oct 2011.

If have made a small update to XFiles:  the DrawBmp function now has an 8th parameter, which is a a keyboard or mouse button code.  If the key or mouse button is pressed during the delay time, the delay will be ended early.  The update is at:  http://www.box.net/shared/1n069e3vc5vixc8l1zk5

I did a small test of the MA:O command during a battle.  It does take effect for the creature type, but not for battle stacks which have already been set.  That is, MA:O173/0 under !?BR does not change the Santa Gremlin stacks in the battle, but after the battle (and in the next battle) the SG's have the Castle background.

This implies that the creature town type has been read from the creature basic (MA) properties and saved as part of the stack data when a stack is defined.  Therefore, this data should exist in memory and be modifiable with UN:C, if the memory address (as a function of stack number) were known.  Cheat Engine could probably be used to find the address function, with some work - similar to how I found MR:N addresses (the address function could be different for different versions of WoG/Era).

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


Responsible
Supreme Hero
posted October 05, 2011 12:00 PM
Edited by Hero_of_Light at 13:04, 05 Oct 2011.

You're still missing my point so let's forget all the previous post for a sec. Forget!

Ok I'll start over with some visual aids and hope i'll make myself understandable this time.

THE PROBLEM:



In my latest mod i made the neutral creatures into a sea creatures faction. And so i changed the original CRBKGNEU.pcx in order to let these creatures have a background of their own (left pic).

However, that same picture was given to the war machines (since they are neutral as well (right pic). So the War machines had a background that didn't fit.

THE POSSIBLE SOLUTIONS:

One solution would be to assign the war machines to the faction of the hero that carries it (but that didn't really worked that good and that's why i told you to forget it).

THE OTHER SOLUTION would be to assign a new pcx (let's say Blacksmith.pcx) on the War machines only (leaving the CRBKGNEU.pcx free to be used for the sea creatures). What i've been trying to ask you all this time is this:
Is there a command to assign Blacksmith.pcx to the war machines ONLY? Just like there is a command to asign a pcx portrait on one hero ONLY. If there isn't such a command then ok let's forget the whole thing.

Actually that solution would be nice for other mods as well. For instance (if that solution would work) i would pick a blacksmith interior as a background and it would be something like this:


____________
Not idly do the leaves of Lorien fall.

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


Admirable
Omnipresent Hero
Wog refugee
posted October 05, 2011 03:22 PM

I tried to explain why it can't work, but you don't read and bring that hero pcx example for the 5th time.

Hero portrait: use HE:L to get whatever pcx you want for him. You can't have the same hero fighting on both sides, so this portrait is unique.

Creatures background: Use MA:O to script which town they belong to. Once the battle started, you cannot change this. You can have the same creature fighting on both sides, so their background will be same.

War machines are creatures, and have to belong to one of the 10 factions. There is no way to have for them an additional background unless you crack the exe and add a 11th faction.

They look nice on water background, not big deal.
____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 412 pages long: 1 50 100 ... 102 103 104 105 106 ... 150 200 250 300 350 400 412 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.4888 seconds