|
|
solitaire345
Promising
Famous Hero
|
posted April 04, 2012 07:04 PM |
|
|
Quote:
Quote: No. Commanders will not exist if you use those 18 for other creatures.
Please re-read my post. the thing I proposed is to switch whole commander mechanics from current monster indexes to 192-209, and those creature indexes are accessible if using amethyst era plugin.
<*snip*>
You can use one ID for attacking commander and another for defender and change their sounds/def/flags/projectile before battle. Though there are many checks for ID range, they are easy to fix.
Quote:
Quote:
Quote: Also could ERA plugins apply binary patches during runtime? (So it for example change commander constants to value captured from SN:W)...
No. Era applies patches after plugins loading only once. Of course there is a procedure "PROCEDURE ApplyBinPatch (CONST FilePath: STRING);" which can be exported if there is a demand.
Ooops. I used wrong words. I meant to ask if era plugin can have a function which would exactly do the same as binary patch would but only once executing the function. So for example there would be function
void setCommanderRange (int first, int last)
which would change in memory all commander constants to values of parameter first and second, depending if it would be lower limit constant or upper one. I believe it should be able to do by calculating a pointer and write value to pointed adress, but I ask because I don't know if such technique is forbidden in era or if there's an API function intended for it. Applying a binary patch FILE would have low sense since functions are intended to take parameters, but this approach could be sometimes useful if for example there will be base of many such files and function will chose which one to import. So yeah export the function you mentioned but it isn't high priority now.
void WriteAtCode (int Size, void *Src, void *Dst) is used for this.
Though there is no calculation of pointers. Simply ~50 places to write another ID.
==========================================================
Quote: I also should ask if adding commands to ERM interpreter is hard (if we found an address for a code supporting targeted receiver), because I may want to add new commands for !!CO receiver (if I fail at it there's always more techniques to access functionality of plugin via scripts).
That's certainly possible. See source of MoP's 'Battery' plugin for implementation.
____________
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 05, 2012 05:08 PM |
|
|
Excuse me but which features from WoG3.59a was not included in ERA II, and can some of them to be reintroduced (for example as a plugin)?
Does it cover any new ERM commands?
@NEW ERA PLUGINS
What are valid linker settings for compiling era plugins? And which headers (aside of windows.h and era.h) and libraries (aside from STDLIB and Windows Commons) does it need to compile? I want to start my tryings from recompiling test era plugin.
What memory mode it should use? 32-bit with segments? if so are pointers relative to place in memory where h3era.exe is located? because I seen pointer constants in ERA code and in ERA plugins codes...
If I work with OllyDbg, adresses are the same or should be increased by a constant?
@EXISTING ERA PLUGINS
I found the site: http://heroescommunity.com/viewthread.php3?TID=35577&pagenumber=1
are there in the wild any other unofficial ERA plugins?
could someone pin a link to the thread for download the plugins which doesn't have valid link in the thread?
|
|
Bersy
Honorable
Supreme Hero
|
posted April 05, 2012 06:09 PM |
|
|
Here is the patch
Quote: @NEW ERA PLUGINS
What are valid linker settings for compiling era plugins? And which headers (aside of windows.h and era.h) and libraries (aside from STDLIB and Windows Commons) does it need to compile? I want to start my tryings from recompiling test era plugin.
What memory mode it should use? 32-bit with segments? if so are pointers relative to place in memory where h3era.exe is located? because I seen pointer constants in ERA code and in ERA plugins codes...
Default win32 dll, nothing special. No other headers are required. You can try it on Dev C++ - small IDE for GCC.
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 05, 2012 08:21 PM |
|
|
Okay I see commanders.txt just contain a dump of commander constants as they were in executable. Very useful as I can change them to anything I want, and choose which ones to change. Are you sure they all are 8bit constants? If yes I must be aware of limit of 255 (yes you can go past this with creatures). Also it seems that amethyst is more stable than I believed.
cmd1.txt and cmd2.txt are some assembler code. What does they suppose to do? Is it an "insert commander to battle" code? If yes it makes sense as there have to be separate code for attacker and defender and it contain the constants inside the code. So I should treat it no different? (mainly changing constants in code). If not please explain. Also I don't seem to understand [ARG.1] and [LOCAL.1] notation as I was working with assembler on MASM/TASM so I believe it's some simple macro (stack related perhaps?). of course I know any code could be disabled with NOPs if not breaking the context. So did I guess what the code do and if not please explain?
|
|
Bersy
Honorable
Supreme Hero
|
posted April 06, 2012 09:48 AM |
|
|
Quote: Okay I see commanders.txt just contain a dump of commander constants as they were in executable. Very useful as I can change them to anything I want, and choose which ones to change. Are you sure they all are 8bit constants? If yes I must be aware of limit of 255 (yes you can go past this with creatures). Also it seems that amethyst is more stable than I believed.
Sorry, I forgot to mention. They are all 4-byte integers.
Quote: cmd1.txt and cmd2.txt are some assembler code.
No, they contain addresses of commands where the lower and the higher commander indexes where used. I wrote a php script to generate commanders.txt from cmd1.txt and cmd2.txt and attached those files only for the purpose of information. That was the script:
<?
function ParseSource (&$Source)
{
for ($i = 0; $i < count($Source); $i++)
{
$Source[$i] = substr($Source[$i], 0, strpos($Source[$i], ' '));
}
}
$p1 = explode("\r\n", file_get_contents('cmd1.txt'));
$p2 = explode("\r\n", file_get_contents('cmd2.txt'));
ParseSource($p1);
ParseSource($p2);
$res = array();
$h3 = file_get_contents('c:\complete\h3era.exe');
for ($i = 0; $i < count($p1); $i++)
{
$Addr = hexdec($p1[$i]);
$Ofs = $Addr - 0x465000;
$Pos = strpos($h3, chr(174), $Ofs);
$out[] = dechex($Addr + ($Pos - $Ofs)).' AE';
}
$out[] = "\r\n";
for ($i = 0; $i < count($p2); $i++)
{
$Addr = hexdec($p2[$i]);
$Ofs = $Addr - 0x465000;
$Pos = strpos($h3, chr(191), $Ofs);
$out[] = dechex($Addr + ($Pos - $Ofs)).' BF';
}
file_put_contents('commanders.txt', join("\r\n", $out));
?>
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 06, 2012 05:04 PM |
|
Edited by majaczek at 17:06, 06 Apr 2012.
|
@ they all are 4-byte integers
So it's perfectly good for me to use them. 16-bit would be completely enough for my purporses, and 32-bit constants is more than anybody would need (until there would be a mod to cover more than 65535 creature indexes - not soon). Anyway for portability sake, when I want to disable the functionality, I have to use 2^31-1 (maximum signed 32bit integer).
@ the assembler code is just to parse proper constants.
Okay I understand, the code just repeat each time the commander creature constant were used, so you eliminated usage of same constants for different purporse. Very clever. Did you seek for 182 and 183 (decimal) constants? they would have the meaning to differentiate between attacker commander and defender commander... or were they never used in monsters.cpp ? (the code for differentiate between two main types of commander creature, may even be not present in that part of code, but I'm sure SOMEWHERE they are used - If you agree to cooperate please find them for me - they would be crucial for moving commander range to higher range - else it's enough for disabling the features of commanders, I just have to use 0 or -1 for maximum and MAXINT for minimum if I want to disable the features - this way all creatures will be out of checked range), anyway thanks a lot. I'll play with constants, until I'm brave enough to make a plugin which would do also hooks. Also if I want to change the constants during runtime, is an ERM code with UN:C enough to change them? (and are adresses for UN:C same as ones for binmagic, or I have to add some constant to every adress to use with UN:C ?)
PS: I hope I didn't make any grammar error/mistake in my phrases, as it's dumbest way for me to be misunderstood. If i did any I'm really sorry .
PPS: So you exported for me all adresses of constants which changing of, result in changing many "is a commander" checks in treating of creatures. Very nice of you. It looks I even don't have to touch OllyDbg and I got most of intresting for me constants adresses. I feel I was a bit too lazy, but I'm thankful that you done all dirty job instead of me.
|
|
Bersy
Honorable
Supreme Hero
|
posted April 06, 2012 10:11 PM |
|
|
You're welcome
Use the same addresses as given (converted to decimal) for UN:C, nothing special is necessary. Most of addresses are pairs (almost equal addresses). Write here if you face any troubles.
I'm currently preparing a pack of mods for Era 2, these are already ready and based on AKUHAK works:
Heroes Chronicles [RUS Campaignes]
Human Castle
New Interface Mod
NIM Rampart
Original Interface
|
|
Lord_Immortal
Famous Hero
DoR Dev Team
|
posted April 07, 2012 11:20 AM |
|
|
Hey,I just downloaded ERA II and tried it.It is great but I want to disable the New Battlefields and all units move at maximal animation speed(I tried to set the animation speed at the battle options but it dosen't works).How do I reset the old BF and Anim Speed?
|
|
Bersy
Honorable
Supreme Hero
|
posted April 07, 2012 11:36 AM |
|
|
Hi. "New Battlefields" is an option in WoG Options. To disable fast animation, delete file "Mods\WoG\Data\cranim.txt"
And try to read manual before asking please )
|
|
n1k
Tavern Dweller
|
posted April 07, 2012 03:44 PM |
|
|
Is it at me only that the wog and commander's artifacts are missing on random maps? Is there anyway to fix it, or i'll have to wait for newer version?
____________
|
|
Bersy
Honorable
Supreme Hero
|
posted April 07, 2012 03:57 PM |
|
|
Open "WoG Options" menu and turn on the appropriate options. Then save settings to YourFileName.dat (not settings.dat).
|
|
n1k
Tavern Dweller
|
posted April 07, 2012 05:36 PM |
|
|
I don't have any banned spell or artifact, commanders are enabled and wog's new buildings, chests and warlord banners are ok. Only the new artifacts and commander's arifacts are missing from the random maps.
|
|
Bersy
Honorable
Supreme Hero
|
posted April 07, 2012 06:19 PM |
|
|
Seems that I got the same report at russian forums. Something connected with changes by rennoy. Then it's a bug. Thanks for reporting.
|
|
Lord_Immortal
Famous Hero
DoR Dev Team
|
posted April 08, 2012 01:26 PM |
|
|
I noticed some problems with the mod-able part of the Era II:
1st-I can't find the WAKE OF GODS sprite file.
2nd-ERM scripter can't access his Help.
3rd-Binmagic says Argument "Cmd" is required.
EDIT:Why didn't you include and/or translate the program that adds new units?
|
|
Bersy
Honorable
Supreme Hero
|
posted April 08, 2012 01:50 PM |
|
|
Quote: 1st-I can't find the WAKE OF GODS sprite file.
Same with me.
Quote: 2nd-ERM scripter can't access his Help.
Bad
Quote: 3rd-Binmagic says Argument "Cmd" is required.
Because it's really required.
Quote: EDIT:Why didn't you include and/or translate the program that adds new units?
Why didn't YOU do it? )
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 11, 2012 04:33 PM |
|
|
@Lord Immortal
First learn about ERA. At least read a bit.
WoG sprites aren't in H3Sprite.lod, Sure, But all we know that, why that, and where they are.
Erm scripter can't find it's help from the first install, Yes it's annoing, but there is very easy way to say the program where it is, and the program will remember.
Binmagic really need you to say what you want to do. If you want the automatical tool with similair functionality, there is one: the Exebuilder, but it has somewhat lesser functionality, because it not only work without these paramters but also doesn't accept them. Read What IS Exebuilder.
There are no particular program for adding units. There are an ERA plugin which ALLOWS adding new units/creatures without replacing the old, but requires a bit of work. So why Bersy didn't include at least this plugin? The answer is easy: Bersy want's the official ERA to be stable as much as possible. The Amethyst plugin you may want is unstable and/or buggy, so you have to install it at your own risk, moreover you haven't any right to blame Bersy for some part of plugin supposed functionality not actually working. Now I see WHY it is fair choice. If someone like you don't read the readmes, he/she may want to just enable the unstable feature, an he/she would act exactly as you - he/she would say "It doesn't work for me so it's your fault, Bersy!", while it's his/her fault for not reading readmes. So including anything unstable may be too annoying for Bersy to public ERA at all.
@Bersy (and all forum readers)
At least now I know why you don't want to include partially unstable or partially not working features, including SU_merged scripts. Even if SU_merged wouldn't include any new instability (as almost would be if i finish my work on it), it still has a problem with incompability with language packs. You are very resistant on making things that only partially works an official part of ERA, but I don't blame you. We all seem to have unwritten agreement - we may provide any unstable/not fully working feature and even ask Bersy for help, which he is pleasant to do - but we aren't allowed to force Bersy to provide any part of the feature. This seem to be fair compromise, and while Bersy is really gently person and helps many modders, it allowed Bersy to force modders to be gently (and players too!).
Bersy I wanted to ask you something once again, because you didn't answer. I know I'm not allowed to force you to answer so I just gently ask again. Are any features from unofficial versions of WoG 3.59 newer than TE (Including published WoG sources), feasible for modders? Could you list most of them you suppose to know? (Yes I perhaps should to read more readmes, but I want at least know where they are...) Do you believe any of the features, including ones you don't know they are there, could be easily reintroduced to ERA (as a plugin of course, since you didn't want to break binary compability of H3era.exe, so "easily" means using main part of feature already implemented there and as much as possible side parts as is, here in ERA, so for WoG sources it would mean, the modder have only to port the code to ERA not rewrite pretty most of it himself/herself)?
If any of answers is not only fair, but also helpful, modders may find an easy way to implement big features. By "easy" I don't mean "easy itself", but "cheaply easy for implementing such a big feature". I'm also curious if secret of ability to add completely new town is perhaps buried in released WoG sources. It should be much more Easy to read WoG source code, than trying to debug and crack HoTA binary additions. While talking about HoTA, their binary file seems to be based on ERA project (so at least include some binary patches for ERA from Bersy or other modders, if not any of plugin mechanics). That would make us more understand why they want to merge with ERA (because they already work with era or at least part of it - so it would be easier for them to achieve updates). It would also say they are liars saying "HoTA is not WoG!". And if it is once again true all OSS programmers could call them Thieves (they use public and open resources in totally closed project without returning any work for open community), as all linuxers may want to call Microsoft (MS has a lot of ways to steal linux code, break the licence and sell it again as part of closed source Windows, and probably do as full OSS rights can't be bought, as most of MS success is just buying proper/right/proficient Companies).
|
|
solitaire345
Promising
Famous Hero
|
posted April 11, 2012 06:01 PM |
|
|
Are any features from unofficial versions of WoG 3.59 newer than TE (Including published WoG sources), feasible for modders? Could you list most of them you suppose to know? <snip> Do you believe any of the features, including ones you don't know they are there, could be easily reintroduced to ERA
Not sure if I understand you correctly, but the features implemented in WoG sources and not accessible in h3era are:
1. LD receiver. Allows to load custom lod files during the game. Some resources aren't replaced as they should but this works. It's probably not easy to implement such a large thing.
2. BG:V, BG:C commands. These allow to manipulate a temporary array of int[100][100] during the battle. Not that hard to implement: MoP has already proved that adding new commands to ERM receivers is possible.
3. UN:J12 command. Allows to get name of map. Easy to implement either as ERM function or exported function from plugin
4. script-local functions. Each script can have their own functions, not accessible from other scripts. I doubt if it's possible to implement in ERA. Plus I don't think they are needed since limit of function numbers is now unlimited.
5. There are some commented-out mentions of script-local variables which I didn't try to use yet. I have the same opinion as with script-local functions.
6. Possibility to provide alternative path for loading ERM scripts. I guess not hard to hook some code to change a pointer to another folder path.
There are probably more hidden features out there.. I didn't read through all the source code. Just learning to work in code, written by someone else.
I'm also curious if secret of ability to add completely new town is perhaps buried in released WoG sources.
There are some comments in B1.cpp concerning new town support, but this is not finished because even using new town types for creature backgrounds (with MA:O command) makes game instable and the game crashes under certain conditions. I am poking around the code here and there to see what is possible.
____________
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 11, 2012 11:35 PM |
|
Edited by majaczek at 23:37, 11 Apr 2012.
|
Solitare THANKS!
It seems the erm extensions you mentioned is just a nice addition.
The thing giving most hope is that really parts of more town support is already in the sources. The people who done Amethyst (new creatures), Emerald (new artifacts) and doing Saphire (New Hero classes), there are also Diamond to dig out - it means the most precious Code Modification, the triumph card of HoTA team is not so hard to achieve as it seems to if You use power of WoG sources and polish the bugs. WE WANT DIAMOND TO BE REAL!
If I managed to work with plugins as much as I want, I would concentrate on small feature increasing commander classes count and more funny things for commander. Diamond is reserved name for new Towns support, but I seem like Gemstone naming idiom, but I haven't choosen my gemstone yet.
EDIT: Solitare if you were the first to dig out Diamond, blessings for you
|
|
Bersy
Honorable
Supreme Hero
|
posted April 12, 2012 04:54 PM |
|
|
majaczek, I'm really grateful to you for warm words and understanding and sorry for delays between responses, usually I need time to prepare the answer.
I will try to reply your post basing on the solitaire345's reply.
1) Hota does not use WoG mechanism at all. It's really based on SoD, written in Delphi. The team theoretically plans to move to WoG platform, but I have many doubts about the necessary time to do it, when main developer remains inactive.
2) I don't have the full list of plugins and most of links even on df2 are dead. If you know the author of plugin which you need, contact him directly. I'm sure, mainly it will be Feanor. I used only stable ones. No so many of them so far. The 6-th slot was buggy, the amethyst too (according to reports here), while usually it's up to me to find the reason of crash (surely, if it's not erm script fault).
Quote: 1. LD receiver. Allows to load custom lod files during the game. Some resources aren't replaced as they should but this works. It's probably not easy to implement such a large thing.
There is not need in such a limited mechanism, though it's implementation can be not so hard. I prefer a simpler solution of automatic resource loading according to mod position.
Quote: 2. BG:V, BG:C commands. These allow to manipulate a temporary array of int[100][100] during the battle. Not that hard to implement: MoP has already proved that adding new commands to ERM receivers is possible.
Era has SN:M with memory allocation / deallocation. No need in large static arrays for the very special purpose.
Quote: 3. UN:J12 command. Allows to get name of map. Easy to implement either as ERM function or exported function from plugin
Even in ERM the name of the map can be accessed quite easily after small research.
Quote: 4. script-local functions. Each script can have their own functions, not accessible from other scripts. I doubt if it's possible to implement in ERA. Plus I don't think they are needed since limit of function numbers is now unlimited.
I can make it using ERM preprocessing at loading. But I think that currently it's better to concentrate on new language development. I already started with simple virtual machine abstraction and planned most of essential elements. In my humble opinion, ERM is not suitable for mods development.
Quote: 6. Possibility to provide alternative path for loading ERM scripts. I guess not hard to hook some code to change a pointer to another folder path.
I don't see any advantage in such solution in mods system. We virtually overwrite any resource proving that resource location is stable, not arbitrary.
Quote: I'm also curious if secret of ability to add completely new town is perhaps buried in released WoG sources.
ZVS stopped working on new town in IDA. No buried magic.
And what is Diamond?
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 13, 2012 05:39 PM |
|
Edited by majaczek at 18:19, 13 Apr 2012.
|
Diamond is codename invented by me to be name of future ERA plugin which would break the limit of town types count since Diamond is most precious gemstone, and we already have Amethyst, Emerald, and Saphire (new hero classes?) is going to be complete. Since I feel useless for doing such big research yet, I used the name as a part of Advert Campaign on ERA which may lead already good reverse engineers to work on advertised Diamonds which when complete would be one of greates news for ERA community.
I know it's not magic - only some Hi-Tech. I used word "magic" as synonyme for something "absurdly labour-intensive and absurdly Hi-Tech", since Hi-Tech seems magic for people who knows almost nothing about the technology. So the "buried magic" is simply "all long and hard work already done to support more town types". It's clearly connected what M&M world's folk think about the Ancients. (Should I stop with idom "Dig the Diamond" and change to "Acquire Knowledge of Ancients" ?).
It seems my advert fails because it needs too much think for the idiom to be understood. (Bersy is already good thinking, hitech man, so if he doesn't understood many others wouldn't also).
I disagree that HoTA isn't based on ERA and I will give example which would make you more understand why I think this way. Four operator calculator definately has to be based on math, sure binary math seems not trivial, still calculator doesn't need to use Divergences and Congroventials - two basic operators working on functions - because it's for arithmetic only. Conclusion: even if we tend to think that basic elements of WoG are already missing from HoTA, it didn't deny it is based on WoG or ERA. We cannot yet proove it is really true that HoTA is based on ERA. However they hide the works and claims "It's only our work", which tend me to think the one of reasons of hiding they work is that they are Liars. By ERA project I understand not only official ERA itself which Bersy provide, but all ERA-based or ERA-useful work which has something of Reverse Engineering and follows common with ERA idea, that should work should be public and/or open. So the reason of comparision of Microsoft - Microsoft already achieved much itself and things hard to be done had to be bought - but Microsoft seems to steal ideas and their implementation from Open Community because those people's work can't be bought for a corporation to be only owner. If someone believe MS didn't do any such "robbery", he/she is really naive. So I think it is naive to think HoTA use only H3SoD and their work - I believe they used at least part of work of WoG team, and more important I believe ERA community itself also were robbed. The only way to not be called Thief (for them) is "to buy" so once enough modders which are not only scripters or only media content creators join them, the lie became true as meaning of "they" would change. perfect for liars. I'm not naive to believe but I'm quietly hope the lies would come out to WikiLeaks (but it's still naive as much more important information have to be leaked, and WL leaders wouldn't perhaps name HoTA sins really important).
EDIT: I always believed ZVS is shortcut from Zielevits... is ZVS Zielevits or Slaava, or they are the same person?
EDIT2: link on the campaign on other threads
http://heroescommunity.com/viewthread.php3?TID=36162&pagenumber=8
EDIT3: Bersy you mentioned new script language. I know you feel better with pascal/delphi than C/C++. But still I'm encouraged to propose you Python as the scripting language to use. Python is scripting language of general use - not only for games and moddders - there are many complete Python application which uses only Python and libraries. Python is really popular scripting language. It has already good bindings to C/C++ in both sides, so despite beeing script language, it has potential of most compiled languages. I mentioned Libraries - any existing binary library with a bit of work can be used in Python. Although Python has an unability to understand libraries as-is it is easy to compile a python-type library to access any other binary library, but also requires porting header files. It's easiest for C/C++ but also possible for others. For example WxWidgets - good gui library intended to be use with C/C++ - is accessible via WxPython tiny library for Python (of course package of WxPython includes also original WxWidgets). Python is High-Level language like Java, Delphi or C++. Python is called script language because although using bytecode like Java, the procedure is to run source file which authomatically compiles to bytecode valid for your version of python compiler/interpreter. Because there exist good bindings also to embed Python Interpreter in any app, while the app has possibility to further integration in Python, it's good idea to use it as script language specific for any game engine or other application which is hungry for capabilities not existent for ones compiled to machine code only. Python has many abilities which seem to be reserved to script languages and ones compiled to machine-abstract bytecode (so generally for dynamic languages) - the easiest use is to execute code written in string variable (variable! not constant only! however it is a bit slower than we have already cached bytecode) or evaluate any expression which code is written in string variable (again same -.-) which makes for example application which can draw any function on provided bitmap is only <20 lines of code plus libraries use (we need math for trigonometry exponential etc. and some GUI library which will provide the bitmap to draw on).
|
|
|
|