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 ... 79 80 81 82 83 ... 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Lord_Immortal
Lord_Immortal


Famous Hero
DoR Dev Team
posted July 06, 2011 04:37 PM

Check my new thread:Changing creatures via erm for a specific town?
Can this be done?(It can mean new towns for free lol).

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


Adventuring Hero
Outcast Fire Witch
posted July 09, 2011 09:34 AM

Hello,
I have a problem with scrip 39 (hero specialization boost). I opened that script with ERM_SE, copied and pasted it in map's time event, then....error (computer said that the error was in line 636). I don't know why.
Sorry for my bad English.

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


Responsible
Supreme Hero
posted July 09, 2011 08:17 PM
Edited by JimV at 14:33, 10 Jul 2011.

RE: Problem with script 39 -

I think your problem is that this script is too big to fit completely into a Timed Event, and will have to be split into two Timed Events.  If you open your map in the Map Editor, select that Timed Event, and scroll to the end, I think you will see that it ends (at about line 636) because the Timed Event cannot hold any more text.

Try splitting the script at the first trigger above line 36:


-----------------------Right mouse click in battle info-------------------------
;VRv425-428 cannot touch                                         [SECTION EDITED by Tobyn]
!?CM4&429/v9001=0/-998;
!!CM:F?y-1;                            //check for right button
!!VRy-1:&512;
!!CM:A?y-2/?y-3;                       get pixel pos at click location


That is copy the script until just before the first line above, and paste that into one Time Event, then copy from the lines above to the end of the script and paste that into a second Timed Event.  Good luck.

P.S. If you want to be sure that this script is active regardless of wog settings, you should add this instruction at the beginning:


!#UN39/1; [Hero Specialization Boost enabled]

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


Promising
Famous Hero
of infamy
posted July 11, 2011 05:22 AM

Hey I've been looking through the ERM doc and there seems to be a lot of support for importing pictures into messages and such. Would there be a way to import a town background and use an alternate one for a single map?

Thanks in advance.

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


Adventuring Hero
Current Russian Peasant
posted July 11, 2011 07:42 AM

You can do it with UN:C

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


Adventuring Hero
Outcast Fire Witch
posted July 11, 2011 11:28 AM

^ The message displays only small picture and one line of text. I want to import lagre images and long text. I saw in some map, the image in message is big. How can I do it?
____________
My HoMM3 Maps
Sorry for my bad English.

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


Responsible
Supreme Hero
posted July 11, 2011 02:08 PM

The IF:D command (with the IF:F and IF:E commands) allows you to display 1, 2, 3, or 4 external pictures, but each has a maximum size of 100x100 pixels.  The description in ERM Help is too big to copy here, however I will add this:

The IF:D description mentions a Title above the pictures and a Caption below the pictures.  The Caption can only be one line of about 50 characters long, but the Title can be four lines - if you end the first three lines with line breaks like this:

!!VRz10:S^This is line 1, about 40-50 characters maximum.
This is line 2, yada, yada, yada.
This is line 3, et cetera, et cetera, et cetera.
This line 4, the last line you can have in the Title.^;

See the Emerald Tower script, script44.erm, for an example.  The commands which show the wizard illustrate this.

[By the way, there is an error in the Emerald Tower script as I received it in the wog Allinon1.zip package.  It was intended to work weekly, but needs to be corrected at line 75 or else it will only work once per tower:

!!UN:U63/65/?v1; [Number of Emerald Towers: v1]
!!VRv2:S-1; [Initialize v2 to -1 to work with new faster UN:U syntax][corr. v1->v2 JHV] <-- this is line 75
!!DO10910/1/v1/1&v1>0:P; [Loop through all Emerald Towers]

End of digression.]

There is also an IF:B command which will display any size picture which will fit on the Heroes screen (which is 800x600 pixels), but this command does not have any text lines.  You would have to edit a picture to add text to it graphically.

Beserker's ERA addon gives access to an more advanced set of ERM instructions which allow you to create new dialog boxes with pictures and text of any size which will fit.

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


Promising
Famous Hero
posted July 11, 2011 05:00 PM

Quote:
Hey I've been looking through the ERM doc and there seems to be a lot of support for importing pictures into messages and such. Would there be a way to import a town background and use an alternate one for a single map?

Thanks in advance.


I have tried to change the look of whole town by editing memory with UN:C command. It works, but for this you have to change these:

1. filename of town background
2. filenames of defs of town buildings (as a bonus I found that fortress has an unused town building graphic with water wheel)
3. filenames of town building outlines
4. filenames of town building hotspot masks
5. coordinates where they should be placed

As you can see there's already much work, furthermore, you have to change everything character after character, because UN:C command can write only one byte (or character) at once and to make everything even worse the character must be represented as a number from ASCII code table.


____________

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


Honorable
Supreme Hero
posted July 11, 2011 05:30 PM

UN:C works with bytes(1), words(2) and double words (4)
UN:C[Addr]/[Size=1/2/4]/[Value]

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


Promising
Famous Hero
of infamy
posted July 12, 2011 02:35 PM

Quote:
Quote:
Hey I've been looking through the ERM doc and there seems to be a lot of support for importing pictures into messages and such. Would there be a way to import a town background and use an alternate one for a single map?

Thanks in advance.


I have tried to change the look of whole town by editing memory with UN:C command. It works, but for this you have to change these:

1. filename of town background
2. filenames of defs of town buildings (as a bonus I found that fortress has an unused town building graphic with water wheel)
3. filenames of town building outlines
4. filenames of town building hotspot masks
5. coordinates where they should be placed

As you can see there's already much work, furthermore, you have to change everything character after character, because UN:C command can write only one byte (or character) at once and to make everything even worse the character must be represented as a number from ASCII code table.




Wow really that's amazing I was about to give up as IF:B isn't really too useful for a town. Do you think you could send me a script if you changed it for the Fortress already. I have the background, defs, outlines and hotspots and I simply make every building an 800x374 cyan picture with the building and put all of them at (0,0) for ease, so that part is all done. This is great I may have an optional town switch yet!

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


Promising
Famous Hero
feanor on DF2.ru
posted July 12, 2011 02:45 PM

Quote:


1. filename of town background
2. filenames of defs of town buildings (as a bonus I found that fortress has an unused town building graphic with water wheel)
3. filenames of town building outlines
4. filenames of town building hotspot masks
5. coordinates where they should be placed

6. Siege battlefield
7. Walls on it
8. Town icons
9. Town name
10. Town on the map.
11. Grail map.

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


Promising
Famous Hero
posted July 12, 2011 09:08 PM
Edited by solitaire345 at 21:13, 12 Jul 2011.

Quote:

Wow really that's amazing I was about to give up as IF:B isn't really too useful for a town. Do you think you could send me a script if you changed it for the Fortress already. I have the background, defs, outlines and hotspots and I simply make every building an 800x374 cyan picture with the building and put all of them at (0,0) for ease, so that part is all done. This is great I may have an optional town switch yet!



1. filename of town background
2. filenames of defs of town buildings (as a bonus I found that fortress has an unused town building graphic with water wheel)
3. filenames of town building outlines
4. filenames of town building hotspot masks
5. coordinates where they should be placed
Quote:

6. siege battlefield
7. Walls on it
8. Town icons
9. Town name
10. Town on the map.
11. Grail map.

12. background for creatures (and strings with it's name is stored in several locations throughout memory and if you change it in a wrong place, the game will crash)


My script is ugly (I have just tested if it's possible at all with ERM and have just overwritten all the castle's builddings with fortress's buildings and copied building coordinate table for fun. The script itself just changes few buildings, town and creature backgrounds and is many lines long (IIRC it takes sixteen lines to change one building def, hotspot mask and outline and three lines for coordinates)), far from being finished and it doesn't restore original graphics for town buildings, so it will still be changed when other map is loaded.. Since currently I have some more free time, I think, I will try my luck at writing ERM function to write strings to game's memory or try to find some way to do so through external DLL's. If I succeed, I will share my work, but there's big possibility of my failure..

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


Promising
Famous Hero
feanor on DF2.ru
posted July 12, 2011 09:38 PM
Edited by OxFEA at 21:39, 12 Jul 2011.

13. Hall icons.


Sometimes I want to write DLL for support different skins of towns. Chanding coordinates and defs is quite simple, but I'm not sure for town icons and names.

Maybe later I'll try it.

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


Promising
Famous Hero
of infamy
posted July 13, 2011 04:55 AM

Quote:
Quote:

Wow really that's amazing I was about to give up as IF:B isn't really too useful for a town. Do you think you could send me a script if you changed it for the Fortress already. I have the background, defs, outlines and hotspots and I simply make every building an 800x374 cyan picture with the building and put all of them at (0,0) for ease, so that part is all done. This is great I may have an optional town switch yet!



1. filename of town background
2. filenames of defs of town buildings (as a bonus I found that fortress has an unused town building graphic with water wheel)
3. filenames of town building outlines
4. filenames of town building hotspot masks
5. coordinates where they should be placed
Quote:

6. siege battlefield
7. Walls on it
8. Town icons
9. Town name
10. Town on the map.
11. Grail map.

12. background for creatures (and strings with it's name is stored in several locations throughout memory and if you change it in a wrong place, the game will crash)


My script is ugly (I have just tested if it's possible at all with ERM and have just overwritten all the castle's builddings with fortress's buildings and copied building coordinate table for fun. The script itself just changes few buildings, town and creature backgrounds and is many lines long (IIRC it takes sixteen lines to change one building def, hotspot mask and outline and three lines for coordinates)), far from being finished and it doesn't restore original graphics for town buildings, so it will still be changed when other map is loaded.. Since currently I have some more free time, I think, I will try my luck at writing ERM function to write strings to game's memory or try to find some way to do so through external DLL's. If I succeed, I will share my work, but there's big possibility of my failure..


I actually just wanted the script as there seems to be no documentation on UN:C that I can find. I simply want to see how it is structured and such, I will do all the annoying coding myself and figure those things out. So can you send it to me plz?

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


Adventuring Hero
posted July 13, 2011 05:46 AM

Quote:


I actually just wanted the script as there seems to be no documentation on UN:C that I can find. I simply want to see how it is structured and such, I will do all the annoying coding myself and figure those things out. So can you send it to me plz?


I'd gladly accept any script samples, too! These can be so hard to find exactly when you need them. An archive helps when you return to wog periodically, usually forgotten most things and starting from scratch.

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


Promising
Famous Hero
posted July 13, 2011 07:22 AM

Quote:


I actually just wanted the script as there seems to be no documentation on UN:C that I can find. I simply want to see how it is structured and such, I will do all the annoying coding myself and figure those things out. So can you send it to me plz?

Quote:

I'd gladly accept any script samples, too! These can be so hard to find exactly when you need them. An archive helps when you return to wog periodically, usually forgotten most things and starting from scratch.


I'll just quote Bersy's post above:
Quote:
UN:C works with bytes(1), words(2) and double words (4)
UN:C[Addr]/[Size=1/2/4]/[Value]


Addr is address in memory (IIRC, must be written in decimal)
Size is length of integer in bytes
Value is ... well, value. If size of your integer is 1, then the value must not exceed 255, if size is 2, then it mustn't exceed 65535 and if 4 byte length integers can go as high as 49294967295.

command that writes noncapital letter 'a' to memory location 0xABCDEF, looks like this:
!!UN:C11259375/1/97

I didn't use any fancy triggers for my script and simply wrote a !?PI; trigger at the beginning of script. (This also means, that the town won't be changed when loading a saev game.)

____________

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


Adventuring Hero
Current Russian Peasant
posted July 13, 2011 08:32 AM

Quote:
Is there a script that enables to have more than two creatures recruitable in each town's building?

Try this EraPlugin by MoP. With it you can have 4 creatures in 1 town building.

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


Promising
Famous Hero
posted July 13, 2011 02:15 PM
Edited by solitaire345 at 14:18, 13 Jul 2011.

I wrote an ERM function to write sequence of bytes to game's memory. I will test it when I return home, but if anyone can test it before I do, please do so and report:

!?FU1;

!!UN:C?y1/1/?y2;
!!VRy1:+1;
!!UN:C?y1/1/?y3;
!!VRy1:+1;
!!UN:C?y1/1/?y4;
!!VRy1:+1;
!!UN:C?y1/1/?y5;
!!VRy1:+1;
!!UN:C?y1/1/?y6;
!!VRy1:+1;
!!UN:C?y1/1/?y7;
!!VRy1:+1;
!!UN:C?y1/1/?y8;
!!VRy1:+1;
!!UN:C?y1/1/?y9;
!!VRy1:+1;

!!FU1:P[address_of_first_byte_of_name]/f/i/l/e/n/a/m/e;

It is important that f/i/l/e/n/a/m/e must be represented not by letters, but by their ordinal numbers. To handle this I wrote a small python script to convert a filename to sequence of integers.

Filename = 'ABCDEFGH' #change this to your filename without extension (note that it must be eight characters long
ReturnParams = ''
for Char in Filename:
ReturnParams = ReturnParams+str(ord(Char))+'/'
ReturnParams = ReturnParams[0:len(ReturnParams)-1]

print ReturnParams


You can run this in codepad and replace that f/i/l/e/n/a/m/e thing with the output it gives.

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


Adventuring Hero
Current Russian Peasant
posted July 13, 2011 06:43 PM

If you want a numbers of letters just look at ASCII Table

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


Promising
Famous Hero
posted July 13, 2011 07:52 PM
Edited by solitaire345 at 21:21, 13 Jul 2011.

I used to work this way, but with python it's waaay faster than finding numbers for each letter. Also, my ERM script doesn't work. Not much a surprise actually :). I'll try to fix it and upload the result.

By the way, could someone delete that big line of smiles above? It distorts the view a lot..

EDIT:
I made it!
This python script prints out an ERM script ready to be pasted to timed event.

StrToWrite = 'your string'
StrBeginAd = 6857500

print 'ZVSE'
i = 0
for char in StrToWrite:
  print '!#UN:C'+str(StrBeginAd+i)+'/1/'+str(ord(char))+';'+char
  i = i+1


I wanted to write an ERM function, so I could have my own library of functions to use, but I guess this way is still not very bad..

 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 ... 79 80 81 82 83 ... 100 150 200 250 300 350 400 407 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.8033 seconds