Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

*out of date* - PS:T 1024x768 UI pack (v0.6)

Joined
Nov 7, 2006
Messages
1,246
Guys, how do I exactly get the spells? I tried overwriting the codes in TORMENT.GAM in one of my saves. I can see the spells and learn them, but when I try to cast any of them, TNO just stands idle. Do I have to increase my level and/or overwrite inventory items with the scrolls for the spells?
 

taplonaplo

Scholar
Joined
Aug 8, 2008
Messages
628
i don't really understand what you mean.
I put the scrolls in my inventory (via dltcep) and then fire them from quick slot.
 

ghostdog

Arcane
Patron
Joined
Dec 31, 2007
Messages
11,086
To test spell effects I used planescape torment hack to get the spell scrolls and I had dakkon use the scrolls form his quickslot. I tired to make a character learn the spells but it didn't work, so it's better to just use the scrolls.

Also some spells like celestial host require to be targeted at a hostile creature for them to work.
 

elricbk

Novice
Joined
Oct 2, 2008
Messages
10
Sorry for a newbie question. I have a weirdest resolution available for gaming (1024x600, netbook). But it looks not so bad with widescreen patch for Torment (2cd ver). Is it possible to modify game sources somehow to center interface elements of the game? I don't want things scaled up and polished. And load/save screens may sit in up left corner of the screen, I need only ingame interface (party, inventory, dialogs, so on). Is there any simple way to do it? There was offsets posted for my version - if I change values in .exe from 640x480 to (what value?), would it help?

Thanks for your replies in advance.
 
Joined
Nov 7, 2006
Messages
1,246
elricbk said:
Sorry for a newbie question. I have a weirdest resolution available for gaming (1024x600, netbook). But it looks not so bad with widescreen patch for Torment (2cd ver). Is it possible to modify game sources somehow to center interface elements of the game? I don't want things scaled up and polished. And load/save screens may sit in up left corner of the screen, I need only ingame interface (party, inventory, dialogs, so on). Is there any simple way to do it? There was offsets posted for my version - if I change values in .exe from 640x480 to (what value?), would it help?

Thanks for your replies in advance.

I haven't the time or patience to make a custom mod for you, but I can come up with a list of things to do and useful info. Give me some hours, I have other things to do first (including eating my lunch :) ).
 
Joined
Nov 7, 2006
Messages
1,246
Here it is.

It's a wall of text, but it's actually not difficult to put into practice. I'm not Shakespeare, so if you don't understand something, ask me.
I may have missed something, since I did part of this work months ago. Again, if something isn't clear, just ask.
Check out the files in my own mod and ghostdog's, it'll make things much, much clearer. You can open the .tp2 files with notepad. Open the various files as you read this post, I can't explain myself clearly enough without them as examples.

Remember, before you start editing, make a backup copy of the /Torment/override folder.

Note: I'm assuming that you want the screens to display like in ghostdog's mod (or like in option 1] of mine).

You need:

1) Edited CHU files. These are the layouts of the UI screens. You need to extract the original ones from the game files, because the widesceen mod resizes them. Near Infinity can extract the files, remember to check "ignore overrides" in "options". You can then use DLTCEP to modify their position from x=0, y=0 to the values that put the screen in the right place (should be (1024-640)/2 = 192 and (600-480)/2 = 60 for you). Note that you have to change the position of all windows (for example, all four in GUIJRNL). DLTCEP lets you select them with ease, and shows you their background, so it shouldn't be difficult to identify them.

-GUICG, GUIINV, GUIJRNL, GUIMG, GUIMOVIE, GUIPR, GUIREC, GUISTORE, GUIWMAP can be edited without problems IIRC.
-GUIALPHA and LUA can be safely ignored, as far as we know.
-START and GUIOPT are the main and options menus. You choose if and how you want to edit them.
-You can't just change the position of window 4 in GUIMA (map) and window 1 in GUIKEYS (keyboard mappings), or you'll experience problems. Instead, you'll need to change the dimensions of these two windows to 1024x467 (check out how the screen is built and you'll understand why) and 1024x600 respectively, then center all of their controls on them.
GUIMA 4 has only 4 controls, but you'll also need a 1024x600 background with a transparent frame around the original 640x480 background, because the background can't be smaller than the window. See 2) for how to create MOS backgrounds.
GUIKEYS 1 has 126 controls, so you might want to ignore this one. If you edit it, you'll need a 1024x600 background for it, and it mustn't be transparent (make it black or put a screenshot of the menu under it).
-If you do decide to edit GUISAVE and GUILOAD, you'll need to do for window 1 of both what you did for GUIMA 4, that is, change their dimensions to 1024 and 600, center all their controls, then create a background for each. The background must not be transparent, make it black, use a screenshot (as I did in SGMOSV2.mos and SGMOSV23.mos) or use art as ghostdog did.

2) Edited MOS files. These are mostly the art for the backgrounds of screens and bars.
Download MOSWorkshop (I use version I). With Near Infinity, extract the original 640x480 MOS file for a window. DLTCEP tells you what the right MOS for any window is. Open them with MOSWorkshop, copy the image, paste it in an image editor (I use the GIMP) and edit it as you need (for example by putting it on a 1024x600 black backgorund). Save it as bitmap, open the bitmap with DLTCEP, save it as MOS. The "transparent" green that you need for MAPANEL.mos is R=0/G=255/B=0. You can also copy this green from some MOS files, such as GPMO11.mos.
The UI bars are also MOS files. In case you want to edit them, either edit those made by the widescreen mod (you can find them in /Torment/override), or make them from scratch using the original MOS files. Or use mine (they should work, since my screen width is 1024).
In case you want to edit the saving/ loading/ unloading data screens, read the last pages of the thread.
You only have to edit a handful of MOS 640x480 background (bars, map, save, load, keys). In my mod you'll also find extra backgrounds pieces for GUISTORE (since I still haven't implemented taplonaplo's fix), and for the start and options menu. All the normally centered 640x480 screens (GUICG, GUIINV, GUIJRNL, GUIMG, GUIMOVIE, GUIPR, GUIREC, GUISTORE, GUIWMAP) will work fine with the MOS files edited by the widescreen mod.

3) Edited BMPs for journal pics. They have to be put in the lower right corner of a transparent (R=0/G=255/B=0 green) rectangle, so that they appear in the right position. It's a long, boring work to make them, but it's the only way we devised to put them there. Open the PST-1024x768UI/UI_JOURNAL folder of my mod (or ghostdog's equivalent) to see them.

4) Edited Torment.exe. You could open it with a hex editor and edit the offsets manually, but it's a lot better to use the WRITE_SHORT command in WeiDU instead. You'll need to understand how WeiDU works first. Check this out, open the .tp2 files of our mods... it's not that hard. Remember that ghostdog's mod has more features than mine, because I'm still testing the new version, and 0.3 is quite out of date.

This is the part of code that edits the offsets in the next version of my mod, so that you can see more or less what you have to write. Not completely tested, might have errors. "//" is for comments (the line is not executed). Replace "768" with "600". For eff.cent.: cel.host-heaven-gate y, you'll need to do a bit of trial and error to find the correct value (I still haven't).

Code:
// These make the action menu work properly.

WRITE_SHORT "0x3cabc1" "1024"
WRITE_SHORT "0x3cabc8" "768"
WRITE_SHORT "0x3cacec" "1024"
WRITE_SHORT "0x3cacf3" "1023"//  (x-1) (original: 639)
WRITE_SHORT "0x3cad17" "695" // (y-73) (original: 407)
WRITE_SHORT "0x3cad1e" "695" // (y-73) (original: 407)


// These allow the BMP art in the journal to display properly.

WRITE_SHORT "0x232e00" "1024"
WRITE_SHORT "0x232e07" "768"


// These allow the notes in the map to display properly.

WRITE_SHORT "0x24394b" "1024"
WRITE_SHORT "0x243955" "768"


// These allow the notes added by the player in the map to display properly.

WRITE_SHORT "0x24399e" "1024"
WRITE_SHORT "0x2439a8" "768"


// These allow the .MOS backgrounds for editboxes to display properly.

WRITE_SHORT "0x0ffd4e" "1024"
WRITE_SHORT "0x0ffd58" "768"
WRITE_SHORT "0x0ffe99" "1024"
WRITE_SHORT "0x0ffea3" "768"
WRITE_SHORT "0x0fffa3" "1024"
WRITE_SHORT "0x0fffad" "768"


// These allow the .MOS backgrounds for sliders to display properly.

WRITE_SHORT "0x0fcf76" "1024"
WRITE_SHORT "0x0fcf7d" "768"


// These center the movies.

WRITE_SHORT "0x03f1c0" "832"
WRITE_SHORT "0x03f144" "768"


// These center the game view correctly during dialogue.

WRITE_SHORT "0x09a5cb" "512" // (x/2)
WRITE_SHORT "0x09a5d7" "294" // (y-180/2)


// These allow parts of the loading/ saving/ unloading screens to be displayed properly.

WRITE_SHORT "0x4f564e" "1024"
WRITE_SHORT "0x4f5650" "768"


// These correct the spell display and camera centering issues.

WRITE_SHORT "0x3bc52e" "1024"  // (game area spell display window)      (x)        (original: 640)
WRITE_SHORT "0x3bc535" "768"   // (game area spell display window)      (y)        (original: 444)
WRITE_SHORT "0x3bc524" "0"     // (game area spell display window)  (extension)    (original: 36)

WRITE_SHORT "0x2d63f8" "1024"  // (display window: conflagration)       (x)        (original: 640)
WRITE_SHORT "0x2d6402" "768"   // (display window: conflagration)       (y)        (original: 480)

WRITE_SHORT "0x2d62d5" "512"   // (effect center: conflagration)        (x/2)      (original: 320)
WRITE_SHORT "0x2d62c8" "494"   // (effect center: conflagration)        (y/2 +110) (original: 350)

WRITE_SHORT "0x2d50ca" "512"   // (casting center: conflagration)       (x/2)      (original: 320)
WRITE_SHORT "0x2d50d1" "393"   // (casting center: conflagration)       (y/2 +9)   (original: 249)

WRITE_SHORT "0x2bdafa" "512"   // (effect center: general)              (x/2)      (original: 320)
WRITE_SHORT "0x2bdaf5" "393"   // (effect center: general)              (y/2 +9)   (original: 249)

WRITE_SHORT "0x2caeed" "1024"  // (display window: meteor storm)        (x)        (original: 640)
WRITE_SHORT "0x2caef7" "768"   // (display window: meteor storm)        (y)        (original: 480)

WRITE_SHORT "0x2ca54f" "512"   // (effect center: meteor storm)         (x/2)      (original: 320)
WRITE_SHORT "0x2ca556" "348"   // (effect center: meteor storm)         (y/2 -36)  (original: 204)

WRITE_SHORT "0x2c05a5" "512"   // (effect center: abyssal fury)         (x/2)      (original: 320)
WRITE_SHORT "0x2c05a0" "404"   // (effect center: abyssal fury)         (y/2 +20)  (original: 260)

WRITE_SHORT "0x2d0c68" "512"   // (effect center: rune of torment)      (x/2)      (original: 320)
WRITE_SHORT "0x2d0c63" "407"   // (effect center: rune of torment)      (y/2 +23)  (original: 263)

WRITE_SHORT "0x2c95cb" "512"   // (effect center: power word: kill)     (x/2)      (original: 320)
WRITE_SHORT "0x2c95c6" "534"   // (effect center: power word: kill)     (y/2 +150) (original: 390)

WRITE_SHORT "0x2d25b1" "512"   // (effect center: mechanus' cannon)     (x/2)      (original: 320)
WRITE_SHORT "0x2d25b8" "393"   // (effect center: mechanus' cannon)     (y/2 +9)   (original: 249)

WRITE_SHORT "0x2b90ce" "512"   // (effect center: cloudkill)            (x/2)      (original: 320)
WRITE_SHORT "0x2b90c9" "393"   // (effect center: cloudkill)            (y/2 +9)   (original: 249)

WRITE_SHORT "0x2bf8af" "512"   // (casting center: elysium's fires)     (x/2)      (original: 320)
WRITE_SHORT "0x2bf8aa" "393"   // (casting center: elysium's fires)     (y/2 +9)   (original: 249)

WRITE_SHORT "0x2bf274" "512"   // (effect center: elysium's fires)      (x/2)      (original: 320)
WRITE_SHORT "0x2bf26f" "393"   // (effect center: elysium's fires)      (y/2 +9)   (original: 249)

WRITE_SHORT "0x2a8f4f" "512"   // (effect center: skull mob)            (x/2)      (original: 320)
WRITE_SHORT "0x2a8f4a" "393"   // (effect center: skull mob)            (y/2 +9)   (original: 249)

WRITE_SHORT "0x2d3412" "512"   // (effect center: raise dead)           (x/2)      (original: 320)
WRITE_SHORT "0x2d340d" "393"   // (effect center: raise dead)           (y/2 +9)   (original: 249)

WRITE_SHORT "0x2d1f48" "512"   // (effect center: spiritual hammer)     (x/2)      (original: 320)
WRITE_SHORT "0x2d1f43" "393"   // (effect center: spiritual hammer)     (y/2 +9)   (original: 249)

WRITE_SHORT "0x2ba033" "512"   // (effect center: howl of pandemonium)  (x/2)      (original: 320)
WRITE_SHORT "0x2ba03a" "393"   // (effect center: howl of pandemonium)  (y/2 +9)   (original: 249)

WRITE_SHORT "0x2c6fdb" "1024"  // (display window: desert hell)         (x)        (original: 640)
WRITE_SHORT "0x2c6fe2" "768"   // (display window: desert hell)         (y)        (original: 480)

WRITE_SHORT "0x2c7006" "512"   // (effect center: desert hell)          (x/2)      (original: 320)
WRITE_SHORT "0x2c7001" "384"   // (effect center: desert hell)          (y/2)      (original: 240)

WRITE_SHORT "0x2d7094" "512"   // (effect center: ignus' fury)          (x/2)      (original: 320)
WRITE_SHORT "0x2d709b" "393"   // (effect center: ignus' fury)          (y/2 +9)   (original: 249)

WRITE_SHORT "0x2cea73" "512"   // (effect center: deathbolt)            (x/2)      (original: 320)
// WRITE_SHORT "0x2cea6e" "348"   // (effect center: deathbolt)            (y/2 -36)  (original: 204) (useless, not included)

WRITE_SHORT "0x2cd436" "512"   // (eff. cent.: chain lightning storm)   (x/2)      (original: 320)
WRITE_SHORT "0x2cd431" "348"   // (eff. cent.: chain lightning storm)   (y/2 -36)  (original: 204)

WRITE_SHORT "0x2c7ffa" "512"   // (effect center: stygian ice storm)    (x/2)      (original: 320)
WRITE_SHORT "0x2c8001" "348"   // (effect center: stygian ice storm)    (y/2 -36)  (original: 204)

WRITE_SHORT "0x2bba2a" "1024"  // (display window: blade storm)         (x)        (original: 640)
WRITE_SHORT "0x2bba34" "768"   // (display window: blade storm)         (y)        (original: 480)

WRITE_SHORT "0x2bb021" "512"   // (effect center: blade storm)          (x/2)      (original: 320)
WRITE_SHORT "0x2bb02b" "420"   // (effect center: blade storm)          (y/2 +36)  (original: 276)

WRITE_SHORT "0x2c5d1a" "512"   // (effect center: axe of torment)       (x/2)      (original: 320)
WRITE_SHORT "0x2c5d15" "393"   // (effect center: axe of torment)       (y/2 +9)   (original: 249)

WRITE_SHORT "0x2d8ea1" "1024"  // (display window: celestial host)      (x)        (original: 640)
WRITE_SHORT "0x2d8eab" "768"   // (display window: celestial host)      (y)        (original: 480)

WRITE_SHORT "0x2d8a7a" "512"   // (casting center: celestial host)      (x/2)      (original: 320)
WRITE_SHORT "0x2d8a84" "348"   // (casting center: celestial host)      (y/2 -36)  (original: 204)

WRITE_SHORT "0x2d8185" "512"   // (effect center: celestial host)       (x/2)      (original: 320)
WRITE_SHORT "0x2d817a" "348"   // (effect center: celestial host)       (y/2 -36)  (original: 204)

WRITE_SHORT "0x2d9184" "512"   // (eff.cent.: cel.host-heaven-angel)    (x/2)      (original: 320)
WRITE_SHORT "0x2d9166" "384"   // (eff.cent.: cel.host-heaven-angel)    (y/2)      (original: 240)

WRITE_SHORT "0x2d92f6" "512"   // (eff.cent.: cel.host-heaven-gate)     (x/2)      (original: 320)
// WRITE_SHORT "0x2d92c5" ""   // (eff.cent.: cel.host-heaven-gate)     ([y])      (original: 134 [MUST BE DECREASED])

WRITE_SHORT "0x2dad22" "512"   // (eff.cent.: cel.host-phoenix-impact)  (x/2)      (original: 320)
WRITE_SHORT "0x2dad0a" "348"   // (eff.cent.: cel.host-phoenix-impact)  (y/2 -36)  (original: 204)

WRITE_SHORT "0x2db940" "512"   // (eff.cent.: cel.host-archer-impact)   (x/2)      (original: 320)
WRITE_SHORT "0x2db93b" "384"   // (eff.cent.: cel.host-archer-impact)   (y/2)      (original: 240)

WRITE_SHORT "0x2dba1b" "512"   // (eff.cent.: cel.host-archer-sun)      (x/2)      (original: 320)
WRITE_SHORT "0x2db9fd" "352"   // (eff.cent.: cel.host-archer-sun)      (y/2 -32)  (original: 208)

WRITE_SHORT "0x2dc121" "512"   // (eff.cent.: cel.host-archer-archer)   (x/2)      (original: 320)
WRITE_SHORT "0x2dc103" "348"   // (eff.cent.: cel.host-archer-archer)   (y/2 -36)  (original: 204)

WRITE_SHORT "0x2dd2a0" "512"   // (eff.cent.: cel.host-dragon-impact)   (x/2)      (original: 320)
WRITE_SHORT "0x2dd29b" "348"   // (eff.cent.: cel.host-dragon-impact)   (y/2 -36)  (original: 204)

WRITE_SHORT "0x2debdb" "512"   // (effect center: call lightning)       (x/2)      (original: 320)
WRITE_SHORT "0x2debd6" "504"   // (effect center: call lightning)       (y/2 +120) (original: 360)

Not included: the offsets for tooltips, because the tooltips, if allowed to display everywhere, cause some problems (ghostdog came up with a number of tricks to circumvent them).

Read the last pages of the thread for more details on spells (display problems and some solutions).
You can make a WeiDU mod only for the offsets, but I suggest that you make a complete mod, so that you can install and uninstall it easily. If you don't, just put all the edited files in the override folder.
Note that opening the edited GUISTORE will cause annoying display problems if you don't install taplonaplo's fix (by including it in your WeiDU mod).
 

elricbk

Novice
Joined
Oct 2, 2008
Messages
10
Oh. Many thanks for so comprehensive and in-depth reply. I have to do a lot of things, eh? Your manual is perfectly clear after some background study, so thanks again. At the moment I don't want to mess up with WeiDu, so the easiest way to do modification (AFAI understand) is to replace files in your installation with mine and change values for offsets. Now, about steps:

1) I'm too lazy to do it manually, so it's highly possible, that I will create a small utility to do it automatically. It should work like this: open .chu file, change offset, change resolution if needed, center controls if needed. It will enable to do modifications for every other resolution you want. And to center all 120 controls at once. So, if you need something more from this app, please, don't hesitate to ask.

2) It's not difficult to edit MOSes file by file, but maybe I'll try to automate it too.

3) This is by far the easiest one with any batch edit software. All pics are of the same size, so you just open, crop (or add), then save. Make a macro for it, repeat, done.

Can't say when I'll be able to do all this. But, hope, it wont take a lot of time.

* how funny to make it for the game, you haven't ever played *
 
Joined
Nov 7, 2006
Messages
1,246
If you do automate everything, that would cut the installation size and perhaps allow us to make the whole mod fit for any resolution. That would be awesome!
 

Elwro

Arcane
Joined
Dec 29, 2002
Messages
11,748
Location
Krakow, Poland
Divinity: Original Sin Wasteland 2
Hey, I also very frequently use a 1024x600 machine. If you pull this off anytime, I'd be very interested :D
 
Joined
Nov 7, 2006
Messages
1,246
Version 0.4 is now available. Changelog:

-Now compatible with the 2CD version of Torment without the need of extra files;
-Spells now display better, although some problems remain;
-Some issues with transparency have been fixed, you may now increase brightness and contrast without parts of the interface turning green;
-The saving game, loading game, unloading data and insert CD screens now fit the whole sceen (NOTE: there are minor problems with them, check the "known issues" list);
-The Keyboard Mappings screen has been centered.

I have yet to include taplonaplo's fix for the store interface (which will allow me to remove the background in option 1]) and make the world map bigger. Both will be done in the next version.

The spells will now display better, but I haven't done any tweaking to the animations. Expect something like this:

finallllypq4.jpg

(screenshot by taplonaplo)

Note: I've uploaded two versions of the pack. The one labelled as "update" doesn't include the UI_JOURNAL folder. If you already have version 0.3, you can download this, take UI_JOURNAL from v0.3 and put it in the PST-1024x768UI folder after you've extracted the archive in the Torment folder. This will save you some time.
 

elricbk

Novice
Joined
Oct 2, 2008
Messages
10
taplonaplo
Concerning your transparency fix:
All such entries:
Code:
READ_BYTE (PalStart + l * 4 + m * 1024) Transb             //read n palette item's color
READ_BYTE (PalStart + 1 + l * 4 + m * 1024) Transg
READ_BYTE (PalStart + 2 + l * 4 + m * 1024) Transr
can be replaced with
Code:
READ_LONG (PalStart + l * 4 + m * 1024) PaletteEntry
then you can compare it with constant for transparent color (namely #00FF00 = 65280). It should speed up you code a little and make code cleaner and looking better. If you are concerned about fourth byte (which is always a 00 as i could see) you can compare 65280 with (PaletteEntry BAND 16777215). This is #FFFFFF00 and it cuts the eldest byte.

Also, for store fix, all three variants:
Code:
REPLACE_TEXTUALLY ~StartStore("MerchMo",Protagonist)~ ~MoveViewObject(Myself,INSTANT) SmallWait(3) StartStore("MerchMo",Protagonist)~
can be replaced with this one:
Code:
REPLACE_TEXTUALLY ~StartStore("MerchMo", *Protagonist)~ ~MoveViewObject(Myself,INSTANT) SmallWait(3) StartStore("MerchMo",Protagonist)~
Since it's regexp. Might work longer though. This is not important at the moment, but may help in future.

2all
So, I made a little research about patching. Here are some questions:
1) Should patching programms be written only in WeiDU? It can manipulate standard Infinity files, but syntax is not that handy, and the only debug option is try and error method. This is weird. Can small command-utility be used for patching?
2) Where are the journal entry pics? I can't find 'em in my install dir (yes, it's also easier to patch BMPs not with WeiDU)
3) When we speaking about centering controls all is clear, when new windows dimensions are even. Then we should move control by (newX-oldX)/2 and (newY-oldY)/2. But what should we do, when new windows has odd dimensions like map panel? How should the controls (and MOS picture) be centered?
4) It seems nearly impossible (for me) to add arbitrary background to MOS file, because of palette limitation and different sizes. As a solution, already processed big (i.e. 1600x1200) MOS file can be used. For every resolution less than 1600x1200 big file is cropped and all is ok. What do you think about this?
 
Joined
Nov 7, 2006
Messages
1,246
elricbk said:
1) Should patching programms be written only in WeiDU? It can manipulate standard Infinity files, but syntax is not that handy, and the only debug option is try and error method. This is weird. Can small command-utility be used for patching?
WeiDU would be better, because we could put everything into a single executable. Unless it is possible to execute automatically WeiDU from a script within another program (don't know if I've explained myself...), so that the end user only clicks on a single file and everything is installed automatically.
However, if it's easier for you to write other utilities, do so. You are, after all, doing everyone a favor.

2) Where are the journal entry pics? I can't find 'em in my install dir (yes, it's also easier to patch BMPs not with WeiDU)
They're compressed. You can view them thanks to an utility such as Near Infinity and Infinity Explorer. NE can batch export game files, don't know about IE.

3) When we speaking about centering controls all is clear, when new windows dimensions are even. Then we should move control by (newX-oldX)/2 and (newY-oldY)/2. But what should we do, when new windows has odd dimensions like map panel? How should the controls (and MOS picture) be centered?
I don't quite understand... just adding the same values should work. Or perhaps I don't understand what you're saying... sorry, I'm a little tired.

4) It seems nearly impossible (for me) to add arbitrary background to MOS file, because of palette limitation and different sizes. As a solution, already processed big (i.e. 1600x1200) MOS file can be used. For every resolution less than 1600x1200 big file is cropped and all is ok. What do you think about this?
Should be ok, after all 1600x1200 is already big enough for anyone and large MOS files shouldn't increase the mod's size too much.

Hope this helps. I'm very busy with the university, so don't expect much from me these days. Wish I could do more.
 

taplonaplo

Scholar
Joined
Aug 8, 2008
Messages
628
elricbk said:
taplonaplo
Concerning your transparency fix:
All such entries:
Code:
READ_BYTE (PalStart + l * 4 + m * 1024) Transb             //read n palette item's color
READ_BYTE (PalStart + 1 + l * 4 + m * 1024) Transg
READ_BYTE (PalStart + 2 + l * 4 + m * 1024) Transr
can be replaced with
Code:
READ_LONG (PalStart + l * 4 + m * 1024) PaletteEntry
then you can compare it with constant for transparent color (namely #00FF00 = 65280). It should speed up you code a little and make code cleaner and looking better. If you are concerned about fourth byte (which is always a 00 as i could see) you can compare 65280 with (PaletteEntry BAND 16777215). This is #FFFFFF00 and it cuts the eldest byte.

Also, for store fix, all three variants:
Code:
REPLACE_TEXTUALLY ~StartStore("MerchMo",Protagonist)~ ~MoveViewObject(Myself,INSTANT) SmallWait(3) StartStore("MerchMo",Protagonist)~
can be replaced with this one:
Code:
REPLACE_TEXTUALLY ~StartStore("MerchMo", *Protagonist)~ ~MoveViewObject(Myself,INSTANT) SmallWait(3) StartStore("MerchMo",Protagonist)~
Since it's regexp. Might work longer though. This is not important at the moment, but may help in future.

2all
So, I made a little research about patching. Here are some questions:
1) Should patching programms be written only in WeiDU? It can manipulate standard Infinity files, but syntax is not that handy, and the only debug option is try and error method. This is weird. Can small command-utility be used for patching?
2) Where are the journal entry pics? I can't find 'em in my install dir (yes, it's also easier to patch BMPs not with WeiDU)
3) When we speaking about centering controls all is clear, when new windows dimensions are even. Then we should move control by (newX-oldX)/2 and (newY-oldY)/2. But what should we do, when new windows has odd dimensions like map panel? How should the controls (and MOS picture) be centered?
4) It seems nearly impossible (for me) to add arbitrary background to MOS file, because of palette limitation and different sizes. As a solution, already processed big (i.e. 1600x1200) MOS file can be used. For every resolution less than 1600x1200 big file is cropped and all is ok. What do you think about this?

Thanks about the info on palettes, store is actually is simplified already.
1: i suggest to use weidu for that it is the common mod program for infinity engine
2: as TVO said, they are biffed (jrnlpic.bif). Could you tell me what approach would you take to patch them. I did it with byte-by-byte in weidu but it's rather slow.
3: i haven't tried what happens if i get a non integer (error or it gets bigger/smaller). In the 2nd case i don't really think 1 pixel makes a real difference. windows are located by top left corner, so window dimensions actually doesn't matter all that much. Note that map panel should be made xnew*(ynew-73) in dimension instead of coordinate moving else mapnotes will appear in a wrong place so buttons have to be changed. (same goes for guikeys, but it's 640x480)
4: you might want to consider the 1680*1050 widescreen res, but it's up to you

I have some kind of base for the chu work and other basic things (exe patch, basic image editing). but it is full of bugs.
 

elricbk

Novice
Joined
Oct 2, 2008
Messages
10
1: i suggest to use weidu for that it is the common mod program for infinity engine
2: as TVO said, they are biffed (jrnlpic.bif). Could you tell me what approach would you take to patch them. I did it with byte-by-byte in weidu but it's rather slow.
3: i haven't tried what happens if i get a non integer (error or it gets bigger/smaller). In the 2nd case i don't really think 1 pixel makes a real difference. windows are located by top left corner, so window dimensions actually doesn't matter all that much. Note that map panel should be made xnew*(ynew-73) in dimension instead of coordinate moving else mapnotes will appear in a wrong place so buttons have to be changed. (same goes for guikeys, but it's 640x480)
4: you might want to consider the 1680*1050 widescreen res, but it's up to you
1:: as you can see yourself, weidu isn't suited for work with graphics; it can help you with distribution of your mod, patching dialogs or hex value here or there, but when you get to image processing it sucks even when copying large arrays of data without processing them. Weidu can be easily combined with any 3rd party utilities via .bat-files, so it's not a big deal, I believe
2:: thanks, accidentally found it yesterday by myself; there are two pictures missing from that file, though ('default' and 'image'). They are stored as simple 24-bit bmps, so we can just take data from file, add transparent region and put result into override dir. I wouldn't patch the original .bif, just in case. It won't be fast, because it's something about 60-100 Mb of data to be written to HDD. Something about 4-5 seconds. But with weidu it can take much longer because you must read and write data by 4 bytes at best.
3:: Ok, there is no issue here, if we displace picture and controls by the same value
4:: Issues with palette can arise in either cases (arbitrary or prepared background). It's a pity. Have to think some more about it.
 

taplonaplo

Scholar
Joined
Aug 8, 2008
Messages
628
2: rightnow it's around 7-8sec/picture for me with bmps.
original .bif-s are never patched. That's what the override folder for.
4: i see what you mean with mos-es.
My problem with a a general chu/mos mod is rightnow that if i patch the files before the widescreen mod, they might later get rewritten (for moses it doesn't matter) when the widescreen mod processes the chus. If patch after, i have to revert the changes on the chus (which is no problem), but mos files can't be changed so easily. (unless i find a way to read directly from the bif). I could include the default moses tho...
 

elricbk

Novice
Joined
Oct 2, 2008
Messages
10
This is not a problem. Here is list of all in-game MOSes. First column is name, second is datatype (this corresponds to MOS), third - BIF file and fourth is ID in this BIF file (last 13 bits of resource locator). Using this link and info in the file, you can find any MOS in standard resources. Alternatively, if you give me names of BIFs containing MOS-in-question, I can supply to you list of all MOSes in these BIFs with offsets and lengthes. It will help you to avoid frustrating part of code with data analysys.
 

taplonaplo

Scholar
Joined
Aug 8, 2008
Messages
628
i should have said copy, it's more like what i need.
With extracted data from the biff i could rebuild the mos (tho i have no idea as i've never tried such before. i can't even program hehe:)), but i'd rather delete the ones in the override or undo the changes by the widescreen mod.
 
Joined
Nov 7, 2006
Messages
1,246
Just an idea, but it might solve some problems: what about a dedicated PS:T high resolution mod that incorporates parts of the widescreen mod? I don't know if it's possible... however, if we didn't depend on a previous installation of the ws mod, we wouldn't need to undo anything.
Also, if you two can enable patching for any resolution, we could also make this a joint project - you, ghotsdog, me. The PST-HR team, or something :)
 

taplonaplo

Scholar
Joined
Aug 8, 2008
Messages
628
I'd rather stick with only patching the widescreen mod. While it could make a thing or two easier, it'd make troubleshooting a whole lot more complicated.
 

elricbk

Novice
Joined
Oct 2, 2008
Messages
10
taplonaplo
You can easily extract original data with WeiDu. Just run it with params:
Code:
weidu --biff-get somefilename.mos
and file will be extracted into original dir
 

taplonaplo

Scholar
Joined
Aug 8, 2008
Messages
628
but can i use it in a tp2? isn't it cmd only? With AT_INTERACTIVE EXIT i can call a bat, but extend mos is tp2 only (tho with the bat i could start a setup, but it'd be rather wierd).
 

elricbk

Novice
Joined
Oct 2, 2008
Messages
10
Small utility for BMP patching. Works from 2 secs on 640x480 res to 10-12 on 1680x1050 (depends on final filesize). Saves about 30 megs of zipped mod size. Usage:
Code:
BMPPatch NewScreenWidth NewScreenHeight
Should be placed into original gamedir (where jrnlpic.bif and interface.bif are situated). If you include this file into mod, mod should be run with .bat file like this:
Code:
BMPPatch.exe 1024 768
1024_768_UI_Pack.exe
Link
 

taplonaplo

Scholar
Joined
Aug 8, 2008
Messages
628
elricbk said:
Small utility for BMP patching. Works from 2 secs on 640x480 res to 10-12 on 1680x1050 (depends on final filesize). Saves about 30 megs of zipped mod size. Usage:
Code:
BMPPatch NewScreenWidth NewScreenHeight
Should be placed into original gamedir (where jrnlpic.bif and interface.bif are situated). If you include this file into mod, mod should be run with .bat file like this:
Code:
BMPPatch.exe 1024 768
1024_768_UI_Pack.exe
Link

Nice! any chance you could read a given short from the exe (one defined by the widescreen mod eg: 4CD: 0x432300 => x 0x432307 => y 2CD: 0x432f60 => x 0x432f67 => y) for calculating the dimensions so that it could be used on any resolution with one bat?
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom