Jump to content

GemRB BG2 Weapon Slots and other questions


khelban12

Recommended Posts

1) Thanks for researching it, it's now fixed.

2) The racial and dexterity boni are added in core, since other effects may change these stats and indirectly affect the skills. The simplest way of fixing this is to just add the boni manually (for display only) during chargen only. They're all in nice little tables and git history should contain the old code anyway.

3) Maybe making GemRB.SetModalState use the force parameter to SetModal would be enough.

Link to comment

Greetings.

 

Again i have some questions about BG2.

 

1) Does anyone else have problems with the escape key or i have done something wrong ? Pressing Escape works on Wizard / Priest Spell screen, Options screen and correctly returns to the game but when pressed on inventory, map, record screens it does nothing.

 

2) I noticed that gemrb shows smaller windows than vanilla bgmain when using a custom resolution with the widescreen mod. For example, i use 1280x720 resolution and gemrb shows 640x480 windows while bgmain 800x600 ones.

--- /usr/share/gemrb/GUIScripts/bg2/Start.py.orig	2015-01-09 14:52:04.004473442 +0200
+++ /usr/share/gemrb/GUIScripts/bg2/Start.py		2015-11-09 19:37:25.907315124 +0200
@@ -56,10 +56,10 @@
 	# Find proper window border for higher resolutions
 	screen_width = GemRB.GetSystemVariable (SV_WIDTH)
 	screen_height = GemRB.GetSystemVariable (SV_HEIGHT)
-	if screen_width == 800:
-		GemRB.LoadWindowFrame("STON08L", "STON08R", "STON08T", "STON08B")
-	elif screen_width == 1024:
+	if screen_width >= 1024:
 		GemRB.LoadWindowFrame("STON10L", "STON10R", "STON10T", "STON10B")
+	elif screen_width >= 800:
+		GemRB.LoadWindowFrame("STON08L", "STON08R", "STON08T", "STON08B")
 
 	#if not detected tob, we go right to the main menu
 	if not GameCheck.HasTOB():
I did the above change and now it works as vanilla but i do not know if it is the proper change because i have not tested it with weird resolutions like smartphones and tablets.

 

Does anyone know what dictates which assets will be used ? I tried to see what the vanilla engine does for "supported" resolutions but i couldn't figure it out. I supposed that it uses ston10 for > 1024 but according to strace, bgmain uses ston08 for 1280x960 (scaled i guess) and again ston10 for 1600x1200.

 

Thank you.

Link to comment

1. ESC triggers the default cancel button, so my first guess would be that those aren't set (or get overriden) in the other windows. IE_GUI_BUTTON_CANCEL vs Open.*Window

 

2. Looks good. I can't find it in the logs, but one of our users figured it out. The original did use a mix of scaling and the padding borders, so it went something like 640x, 800x (640+padding), 1024x, 1280x (1024+padding) ...

Link to comment

Thank you for the quick reply.

 

1. ESC triggers the default cancel button, so my first guess would be that those aren't set (or get overriden) in the other windows. IE_GUI_BUTTON_CANCEL vs Open.*Window

I read GUICommonWindows, GUIMA, GUIMG and tried to figure out how to code this but i couldn't do it. All the code i found for CANCEL was to OR it with another button. For example in the guima case there is code that allows escape to return to local map from the worldmap but i couldn't make it also work from the local map and return to game. Anyway, this isn't something crucial. I just reported it so you can have it in mind for when you find time.

 

2. Looks good. I can't find it in the logs, but one of our users figured it out. The original did use a mix of scaling and the padding borders, so it went something like 640x, 800x (640+padding), 1024x, 1280x (1024+padding) ...

Should there also be a check for the height ? If there is a tablet with 1024x580 or something resolution wouldn't the current code choose a bigger window than what can be displayed ?

 

I found another minor cosmetic issue. When you click on a "screen" button like the Inventory or Character screen or something, the icon is correctly changed to contain a orange/golden border to show that this icon is currently pressed. This doesn't occur if you open a screen using a shortcut key.

post-6821-0-39976900-1447146770_thumb.jpeg

As you see in the screenshot, i opened the map using the button and then pressed j and opened the journal screen, but the golden border is still shown on the map icon. This is something unimportant of course. I just report it because it cought my attention.

 

Edit: Another minor cosmetic issue is that (at least in my game) characters do not push other characters out of the way. For example, after the starting BG2 cutscene finishes and Imoen releases you from the cell, she blocks your way. In the vanilla game instructing the PC to walk results in him/er pushing Imoen and walk but in gemrb he doesn't do anything until you select Imoen and move her out of the way.

 

I have two more questions :) I had the impression that i had asked about this before but i can't find it in the thread so forgive me if i did ask it.

 

1) One pixel production mod installs very beautiful paperdolls and icons and stuff. Among the files it installs are the files c*inv.plt, wp*inv.plt. When i run gemrb with 1pp installed, i get the error message that these files are not correct and i get pink artifacts and alignment mismatches in the inventory screen. This is not a gemrb problem per se because the files are indeed not "correct". While they have .plt extensions, they are compressed bam files if i understood it correctly (they have BAMC signature). I understand that this will probably need a lot of work, but can gemrb support such a case ?

 

2) The infinity animations mod installs some new beautiful animations and modifies two ids files and bgmain exe to use them.

post-6821-0-33710500-1447165786_thumb.jpgpost-6821-0-08487800-1447165792_thumb.jpegpost-6821-0-28057600-1447165797_thumb.jpeg

The above screenshots show for example how the cambion in the starting dungeon appear with the vanilla animation, with infinity animations in the vanilla engine and in gemrb (it shows as dual wielding halfling or something). Can i somehow use these better animations (the middle image) ? If yes, this is done with modifying the avatars.2da file ?

 

Thank you

Link to comment

What effects? In general, all the windowpacks contain all the CHUs. Which CHU we load is explicitly requested in the relevant GUIScripts.

Thats what I thought, but khelban12 indicated that changing the conditions around LoadWindowFrame changed which window was loaded which made me wonder if there are some odd sideeffects I didnt realize.

 

 

 

Does anyone know what dictates which assets will be used ? I tried to see what the vanilla engine does for "supported" resolutions but i couldn't figure it out. I supposed that it uses ston10 for > 1024 but according to strace, bgmain uses ston08 for 1280x960 (scaled i guess) and again ston10 for 1600x1200.

 

Does it matter what original does? They are the same aspect ratio arent they? that means the logical thing to do is use the larger size despite what the original does, no?

Link to comment

Thats what I thought, but khelban12 indicated that changing the conditions around LoadWindowFrame changed which window was loaded which made me wonder if there are some odd sideeffects I didnt realize.

I probably misled you by explaining it poorly.

 

This is how gemrb shows the window before and after my patch:

 

 

post-6821-0-66482300-1447247310_thumb.jpegpost-6821-0-92771200-1447247318_thumb.jpeg

post-6821-0-47730100-1447247327_thumb.jpegpost-6821-0-55847700-1447247334_thumb.jpeg

 

 

Link to comment

oh, didn't see the edits.

0. Yes, we know - we call it npc bumping (it also happens with any non-enemy characters).

1. BAMC is supported already, so this just needs looking into. Especially if 1pp did exe hacking for it.

2. Yes, you would change the resrefs in the avatars.2da file. This is something the mod should do for you, but it would make the install a bit harder (extra param to weidu or manually copying the file beforehand). I don't use 1pp, but if there's a list of all modifications somewhere (iirc 1pp has good docs), avatars.2da patching is easy to add.

If there are any missing animation types, we'd just add them.

(cambion looks like in the original without 1pp)

Link to comment

1. BAMC is supported already, so this just needs looking into. Especially if 1pp did exe hacking for it.

I think 1pp patches the exe only for supporting the extended palette entries not for the paperdolls but it is quite possible i am wrong. I do not understand much of what 1pp does :) For example, the plt files i mentioned, are copied by the following code

 

 

ACTION_FOR_EACH paperdoll IN ~CDFC1INV~ ~CDFC2INV~ ~etc~ BEGIN

COPY		~1pp/core/base/%paperdoll%.BAM~ ~override~

ACTION_IF FILE_EXISTS_IN_GAME ~%paperdoll%.plt~ BEGIN
COPY		~1pp/core/ilove.plt~ ~override/%paperdoll%.PLT~
END

END

 

so the plt files are all the same file (which really is a bam file as i said and dltcep shows a heart with the message i love). Who knows what is the purpose of these plt files :)

 

2. Yes, you would change the resrefs in the avatars.2da file. This is something the mod should do for you, but it would make the install a bit harder (extra param to weidu or manually copying the file beforehand). I don't use 1pp, but if there's a list of all modifications somewhere (iirc 1pp has good docs), avatars.2da patching is easy to add.

If there are any missing animation types, we'd just add them.

(cambion looks like in the original without 1pp)

I tried yesterday to modify avatars.2da to use the new filenames but couldn't make it work. The problem was the "type" field. I tried incrementing the type field and i managed to make the cambion work using the "9" type. So i just need to do the same for every modified creature. A bit tedious but easy to do.
Link to comment

1PP copies over intentionally-corrupted .PLT files in order to force the game to use its .BAM paperdolls instead.

That's what i thought too that it does it to invalidate the same files in the bifs but i wasn't sure. Thank you for clarifying it.

 

So could a way of doing it be that when gemrb finds bam paperdoll files alongside plt files, to ignore the plt and use bams instead ? Or it could have negative side effects ?

Link to comment

I've looked into this. We already try to load a BAM if the PLT is missing or corrupt (bad signature). This is handled by GemRB_Button_SetPLT and PLTImporter::Open (hidden in the im instantiation line) respectively and works fine. Is it still reproducible? I don't think any of this code changed, but I can't inject any problematic faults.

Link to comment

I've looked into this. We already try to load a BAM if the PLT is missing or corrupt (bad signature). This is handled by GemRB_Button_SetPLT and PLTImporter::Open (hidden in the im instantiation line) respectively and works fine. Is it still reproducible? I don't think any of this code changed, but I can't inject any problematic faults.

Yes, i can reproduce it.

[ResourceManager]: Searching for 'CHMF1INV'...
[Unknown]: [PLTImporter]: Not a valid PLT File.
[ResourceManager]: Found 'CHMF1INV.plt' in 'chitin.key'.
[ResourceManager]: Searching for 'CHMF1INV'...
[Unknown]: [PLTImporter]: Not a valid PLT File.
[ResourceManager]: Found 'CHMF1INV.plt' in 'chitin.key'.
[ResourceManager]: Searching for 'CHFT1INV'...
[Unknown]: [PLTImporter]: Not a valid PLT File.
[ResourceManager]: Found 'CHFT1INV.plt' in 'chitin.key'.
[ResourceManager]: Searching for 'CHFT1INV'...
[Unknown]: [PLTImporter]: Not a valid PLT File.
[ResourceManager]: Found 'CHFT1INV.plt' in 'chitin.key'.
GemRB prints the above info and the result is different avatars and different paperdolls in the inventory screen.

 

Offtopic: Are the file size limits supposed to be so low ? (In my last post about animations, i could only upload files up to 6Kb and now i get the message that i can only upload up to 558bytes of files)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...