|
Post by ascension64 on Mar 11, 2007 0:59:32 GMT -6
Hello, I am here to make an announcement about a personal mod that I have made available for the general community to use. It is the Unofficial 3.02 Patch Modification. As there is too much to put here, please find further information about the modification, along with a few screenshots and download information, here. I hope you take some time to try out the features of the modification, and let me know of your queries, suggestions, and troubleshooting questions here. Thanks for your time, Asc64 P.S. This modification requires Lords of Magic: Special Edition 3.01. The 3.01 patch can be found here. Current Version: Build 0014.3 Changes-Corrected mixing tooltip text from the revised unit information panel
|
|
|
Post by Boaster on Mar 11, 2007 1:29:35 GMT -6
I'm curious to know how you removed the "CD Checks" and what the script window is.
I also like you you changed the map rotation hotkey to PageUp and PageDown.
With the installation of your mod, why is "settings.cfg" apart of it?
Seems like you can teach me a few things.
xxxxxx xEDITx xxxxxx
Before, I didn't think it was possible to remove the CD Check through the MPQ Archive. Since you've been able to do it, I did a search for the word "CD."
I came up with nearly 200 matches for the text search of CD, or cd. Slowly, I investigated the results and eliminated the documents which had no relevance. Then it all came down to documents in the "gs/dlg". I did a search for CD and found "checkforcd 0 eq" etc. Using what knowledge I knew about MPQ Editing I carefully removed one part at a time to experiment with changes.
My first test granted me access to a new game without the CD in the the drive, however the dialog did pop up for the CD Check. Regardless of whether or not I hit cancel or ok on this dialog, the game proceeded.
Then I tried deleting the whole line to see if the game would skip the dialog and the check all together. This proved to be a success and I went into "gs\dlg\newdlg.gs" "gs\dlg\panels.gs" and "gs\dlg\NetGmDlg.gs" and removed every CD Check carefully.
I don't think I would've come across this without your success in doing so. I was content just using the Virtual CD/DVD Rom via Daemon Tools. Now I do not have to use that even and soon, neither will my mod users.
Before, I tried using the LOMSE Demo to figure this out and I didn't have any success finding things. I should probably offer the tool I used to find the CDchecks, Notepad++.exe.
|
|
|
Post by Boaster on Mar 11, 2007 1:31:20 GMT -6
Wow, I really like the new menu and the new options panel. Very very nice.
How did you do that with the options panel? You've added all of those options. That is just amazing.
|
|
|
Post by ascension64 on Mar 12, 2007 4:30:25 GMT -6
The checkforcd procedure does a cd check and returns 1 if successful and 0 if not. I only removed the cd checks from gs/dlg/newdlg.gs in my mod, which afterwards looking at gs/dlg/panels.gs and gs/dlg/netGmdlg.gs, I've missed those important ones as well. I'll fix that up.
The rotatemap procedure was the key to this one. Don't try it on the world map, since 90 and 270 degree rotations result in graphical errors that crash the game. Hence, I've restricted it to combat only, which should help when you get a huge melee mob bunched together and can't select the unit you want.
"settings.cfg" is a file I created myself (and is created in the game when you hit the "Save Settings" button in the options menu) that will store all the options in the options menu. I know "lom.cfg" does some of these things already, but I've made those parts of the file redundant by referring to "settings.cfg" instead. If you simply opened "settings.cfg" with a text editor, you'll find I made a fairly straightforward format for the file, but the values are not intuitive, so I wouldn't suggest changing them manually without getting errors loading the file in game.
Well, I did spend the last couple of weeks annotating, formatting, and reading a lot of the .gs code. Unreleased as it is difficult to read and not formatted, I've catalogued every single hard-coded procedure, all constants, and am making an effort to catalogue what every .gs file does, along with what every procedure does. It will be quite a while before I'm ready to release this publicly; but I believe it will massively increase the ability to edit the game. Interestingly, there is enough customization out there to make total conversions out of Lords of Magic.
So far the major downside is that you cannot make Lords of Magic run in any resolution other than 640 x 480, and you cannot make it run in a window either. Well, at least not by typing code into .gs files.
Cool stuff. I use ConTEXT, and made my own highlighter file for all the basic procedures like eq, if, replace, bind, def, etc.
Wow, I really like the new menu and the new options panel. Very very nice.
Well, yes and no. Those options already existed in Lords of Magic, but Impressions never really got to allowing you to customize it. I simply added the ability to customize without getting bad errors and crashing, etc. If you are interested, have a look at gs/dlg/opdlg.gs. You won't find it in any standard gs.mpq, since I created it entirely myself. That file controls the options dialog.
Happy modding!
|
|
|
Post by ascension64 on Mar 12, 2007 6:15:45 GMT -6
I think you may have edited out your query about the 'console', but I'll talk about it anyway. The 'console' is really called the 'script window' by the developers. You can open it with openscriptwindow, clear it with clearscriptwindow, update it (dunno what it really updates) with updatescriptwindow, save its contents with savescriptwindow, and close it with closescriptwindow. The script window itself has a status textbox which displays all the functional output, and an input textbox where you can type in GameScript commands. It also has a 'Clear' button which clears the output window, as well as a 'Stack' counter, which I won't talk about since it can get quite complicated (basically, how many objects you have on the operand stack, if that means anything at all; its good to keep it at 0). You can obviously play around by typing anything you want into the input textbox. Have a go by loading up my mod, starting a game, then pressing the tilde (~) key. Here are some commands to play with: - string print - outputs string into the status textbox (note: a string is something in quotations)
- exitapp - quits the program
- memorystatistics - shows memory allocations to various objects
- checkforcd - does a CD check, pushes 1 on the operand stack if successful, otherwise pushes 0 on the operand stack
- cheatbalkoth - increments the number of times Balkoth has been killed by 1; this won't be saved into lom.cfg unless you also execute saveconfig (basically, allows you to play as Death if you haven't killed Balkoth already)
- saveconfig - saves current configuration into lom.cfg (details include sound volumes, center movement, blitting options, help panel toggles, how many times Balkoth died, etc.; not all of these from lom.cfg are used in my mod)
- clear - removes all objects from the operand stack
Obviously, there are a vast majority of things you can do with the console than just the above. I tend to use it to test what unknown procedures do, so that I can document them. So, there is a short primer about what the console is. It is terribly handy!
|
|
|
Post by Boaster on Mar 12, 2007 13:28:32 GMT -6
Well, it sounds like you've got a handle on this. Have you had any prior experience in game modification or programming
|
|
|
Post by ascension64 on Mar 12, 2007 22:19:20 GMT -6
Well, it sounds like you've got a handle on this. Have you had any prior experience in game modification or programming I am currently an active Infinity Engine modder (Baldur's Gate Series) over at spellholdstudios.net and have been so for close to 2.5 years. I taught myself Java not too long ago as well. So yes, quite a bit of past experience with game modding. I will give you a hint though. The basic procedures in GameScript are based upon PostScript language level 3, the language used by Adobe Inc. for their .ps files. It is a stack-oriented language, something new to me too, and I got around to teaching myself the relevant details as well. Look up PostScript on Wiki and you'll see a variety of free manuals to peruse.
|
|
|
Post by Boaster on Mar 12, 2007 22:42:32 GMT -6
Well, it sounds like you've got a handle on this. Have you had any prior experience in game modification or programming I am currently an active Infinity Engine modder (Baldur's Gate Series) over at spellholdstudios.net and have been so for close to 2.5 years. I taught myself Java not too long ago as well. So yes, quite a bit of past experience with game modding. I will give you a hint though. The basic procedures in GameScript are based upon PostScript language level 3, the language used by Adobe Inc. for their .ps files. It is a stack-oriented language, something new to me too, and I got around to teaching myself the relevant details as well. Look up PostScript on Wiki and you'll see a variety of free manuals to peruse. Well, sounds like we've got an expert. You definitely know a lot more than me. How did you come about finding this place?
|
|
|
Post by ascension64 on Mar 13, 2007 3:57:28 GMT -6
Well I wouldn't say, that with your expansive knowledge of unit, spell, and artifact editing. They are a few areas I still need to look into detail at. I'd be happy to try and look at any issues you might have with bugs, etc.
I found this place when I was trying to play a multiplayer game with a friend and found that the games wouldn't ever show. I can't remember if finding the information about the use of the IPX Protocol was actually at this site, but Google searching definitely popped this site up. I was interested in how you could actually mod the game, and then I found out that most of it was simply script-controlled without much encryption. That rather inspired me to look at the code and see how it was done.
I've loved playing Lords of Magic for quite a while, but the bugs were the thing that always repelled me to other games. Given my experience at programing, I thought I might be able to fix some of that, and hence started my delve into GameScript. Voila, I guess!
This does bring me to the question of multiplayer synchronization. One thing my friend and I got extremely annoyed about was the frequency of a multiplayer game getting unsynchronized and demanding a resynchronization. It seemed to occur whenever an AI player tried to parley with any human player. Also, rapidly pausing/unpausing combat seems to cause this as well, forcing auto-calculation to occur. I'm wondering if you experience much of that on KALI and various other network protocols, since you seem to play (or use to play) network games a lot.
Anyway, if you have any questions about modding, I'll try to help as best as I know.
|
|
|
Post by Boaster on Mar 13, 2007 9:12:36 GMT -6
Bugs that I'd like dealt with? Definitely would have to be multiplayer stability. It seems that LOMSE uses some form of redundant information exchange (probably to ensure neither side is cheating). I don't know much about it.
IPX/SPX compatable protocol is what every player will need to play multiplayer. I heard this isn't available in Vista.
One thing I'd like to figure out? I'd like to know how to tweak and modify the effects of some Special Buildings.
For instance the Cathedral and Barbarian Arena. The Cathedral won't allow Paladins above Level 11 to benefit from the Level boost. And with the Barbarian arena, I want it to give either 1.) more experience or 2.) Give a random bonus to a random stat (health +2, armor +1, attack +1).
So far the Special Buildings for Chaos and Order are largely unexplored for me.
|
|
|
Post by Boaster on Mar 13, 2007 15:23:25 GMT -6
One other thing I'd like to know how to do is find some way of having some sort of "universal" artifact settings. Such as all artifacts replenishing charges, even if they're not equipped. Or if two particular artifacts become equipped together on one champion, it provides a bonus. I had something like the second one before, where wearing two particular artifacts would provide a additional (synergy) bonus, but the coding was very problematic.
|
|
|
Post by ascension64 on Mar 14, 2007 1:26:48 GMT -6
Its interesting that LoM was developed using Blizzard's (Startcraft, Diablo, Warcraft, etc.) dynamic link libraries (DLLs), yet TCP/IP play isn't available. There are ever references to battle.net! Well, one thing I can't do is to modify the hard-coded stuff, and I think the multiplayer code is one of these hard-coded things. However, you can change the behaviour of the game when it does go out of sync. I'm not sure exactly what can be done at the moment. Have you made any changes to any other special buildings. Unless you know something I don't know, I have bad news - the effects are hard-coded! The procedure that applies the special building effects is /do_special_building_action found in gs/dlg/newbuild.gs. From what I read from the code and some console testing of the various procedures, the following two hard-coded procedures control special building effects: - building getspecialbuildingresult - returns an integer that indicates whether the units in the building are legal to receive the special building effect (things like, whether the great temple is controlled by the same player as the owner of the units, whether units are of correct faith, if they need to wait for one turn, whether the requirements are met, etc.)
- building val dospecialbuilding - applies the special building effect of the special building specified to the legal units currently inside that building; val is usually -1 but I have no idea what it does at the moment
So, unfortunately, you'll have to try and work around this. One idea for the Cathedral at least is to arbitrarily set the level of the Paladin so that the level is legal for application of the special effect, apply the effect, then set the new level of the Paladin manually. Alternatively, you can completely reomve usage of dospecialbuilding and code in your own effect, probably the best way to handle the Barbarian Arena. However, this will make it extremely difficult to ensure that a unit only receives the effect once. I do have an idea for the Arena, or anything else, and that is to use dospecialbuilding, but then completely reverse all effects it had on the unit, and then apply your effect. Can't be easy to do, unfortunately. If I have some free time in the near future, I might take a look for you. You'll know much more about exactly how all the artifact type parameters work. I'm not sure whether the /begin_turn_proc parameter will trigger only if the artifact is equipped. That's the only thing I can think of right now. As for the Diablo set-style handling of artifacts you suggest, you should be able to modify the /mod_proc parameter with the use of if blocks. I haven't thought of exactly how to do this yet, but you could make use of the following code: -1 currentarmy 0 2 copy getunitleftartifact ARTIFACT_TYPE getartifactdata ARTIFACT_DICTIONARY getartifacttypedata begin name ;returns the name of the artifact end "Great Axe" eq { <do something> } if
You could just as easily use getunitrightartifact instead for the artifact equipped in the right hand. The 0 is the unit index in the current army, 0 being the 1st unit.
|
|
|
Post by Boaster on Mar 14, 2007 1:45:57 GMT -6
As far as the dospecialbuilding stuff, i've already looked through it all and added some comments there (I think) so that later on if I get inspired again I'll know what some of the things do. But yes, this looks like it's hard coded and might be something in the LOMSE.exe file and not gs.mpq.
As far as the artifact deal, I've tried finding a way of doing such things through "gs/artftool.gs" but the things I've tried haven't worked.
The only thing artifacts will do at the moment, without being equipped, is replenishing artifact mana at the begining of the turn.
|
|
|
Post by ascension64 on Mar 14, 2007 3:54:42 GMT -6
Well, I'm very certain that it is hard-coded, since I've catalogued all 1802 hard-coded procedures in the EXE (not necessarily knowing what they all do). I'll release a list of all hard-coded procedures, standard procedures, and constants soon.
|
|
|
Post by rigel on Mar 16, 2007 13:46:38 GMT -6
Special Buildings hardcoded eh? What else is hardcoded? I guess only 1 life faith, order faith, ect. would be hardcoded to.
What would it take to alter something that is hardcoded? Is it possible?
|
|
|
Post by Boaster on Mar 16, 2007 16:22:48 GMT -6
Special Buildings hardcoded eh? What else is hardcoded? I guess only 1 life faith, order faith, ect. would be hardcoded to. What would it take to alter something that is hardcoded? Is it possible? To alter something that is hardcoded, the LOMSE.exe would have to be edited and modified. Adding a new playable faith would require recreating the entire game. At this point, it looks like Acension would be the only one here capable of editing LOMSE.exe with his extensive game editing knowledge. What he knows is much greater than what I know, and I've learned to edit this game with no advanced knowledge whatsoever. So that says a lot.
|
|
|
Post by ascension64 on Mar 16, 2007 16:29:19 GMT -6
Editing an executable requires, for want of a better term, 'hacking' it. This is something that I won't, and probably never will, learn how to do.
Faith numbers are hardcoded - so you have {0, 1, 2, 3, …, 7} as {LIFE, DEATH, ORDER, CHAOS, FIRE, WATER, EARTH, AIR}. However, they are simply labels you use in your code. You can easily change the actual label that you give them in a game to be something totally different. Interestingly, WANDERING_MONSTER_PLAYER is 15 (marauders and stuff), so that might suggest you could even have a 15 player game!
|
|
|
Post by rigel on Mar 16, 2007 20:15:38 GMT -6
Amazing. That might give a starting point for a potential hack. more players would be great.
Surely though, there's a way to look at the .exe file code so that someone could potentially alter it. I know that people have altered a few things about the Baldur's Gate 2 .exe file.
If you could tell us how to at least look at the .exe file, that'd be awesome, and a starting point for others with an interest in that area.
|
|
|
Post by ascension64 on Mar 17, 2007 6:22:44 GMT -6
Well, for BGMain.exe (Baldur's Gate 2 .exe file), it was first the hackers who removed the CD check. I'm not sure exactly who and how people were then able to find the XP cap in that file. I believe it wasn't actually hacking, and that people just did a hex search for a number corresponding to the XP cap, thereby revealing the offset where the XP cap was stored. At a very elementary level, I know that breaking down an .exe file requires disassembly of the executable, using a disassembler. I don't know much else at all. However, I warn that reverse-engineering lomse.exe would be a breach of copyright, and yadda yadda yadda. For a quick view of lomse.exe, just open it up in a hex editor. You'll get a lot of garbage, and you'll get a lot of text as well. How to make sense of it, I wouldn't know. What I meant for making more players is not actually a hack of lomse.exe, but rather just the use of the features already available in GameScript. I think it might be possible, but can't really prove anything yet. Amazing. That might give a starting point for a potential hack. more players would be great. Surely though, there's a way to look at the .exe file code so that someone could potentially alter it. I know that people have altered a few things about the Baldur's Gate 2 .exe file. If you could tell us how to at least look at the .exe file, that'd be awesome, and a starting point for others with an interest in that area.
|
|
|
Post by wrathofdog on Mar 28, 2007 16:37:58 GMT -6
Very cool looking! Also, are you the Ascension64 of Baldur's Gate fame? Edit: Ah, I see that you are. Cool. I've enjoyed your work.
|
|