szef Posted October 28, 2022 Share Posted October 28, 2022 (edited) Quoting from discord: "Me and my buddy have been working on a little Planescape:Torment EE UI mod and we have an issue with Inventory Background. Replacing the existing mosaic with ours is simple enough, but it seems like there is a permanent black background in the back. We wanted our inventory box to 'float' over the game screen (as we have seen possible on a pre-EE mod screenshot). Does anyone know how to get rid of that black background or is it just not a part of the 'world' setup anymore and whatever we're trying to do, actually cannot be done? This is NOT the indented graphic but illustrates the issue: though clearly both the graphics have some functional transparency, the solid black background prevails": Edited November 2, 2023 by szef Quote Link to comment
FallDamage312 Posted October 31, 2022 Share Posted October 31, 2022 While we couldn't figure out how to remove background to show the world, we decided to make use of the space we're left with. Currently, we're working with a piece of stats page but it has a weird issue. While we did get it to display easily, it only ever displays if it has been displayed in the character sheet first. If we swap to another character's inventory, the stat block remains the same, and we end up with e.g. Morte's summany on the Nameless One's inventory page. Does anyone know a way to refresh that other than display a new character sheet first? Quote Link to comment
szef Posted October 31, 2022 Author Share Posted October 31, 2022 Is it (maybe) something related to: text { area 744 58 218 421 text lua "recordHelpString" text style "normal_parchment" scrollbar 'cgscrl1' } Quote Link to comment
szef Posted November 2, 2022 Author Share Posted November 2, 2022 (edited) Spoiler There are strings in dialog.tlk, like e.g. #59856 ~Current State~, or #4233 ~Armor Class Modifiers~. In-game, the character stats are displayed up-to-date under this strings. Is there any way to find out where this is coming from? (The .dlg files do not have the above strings. Maybe they have a tokens or something? If so, how i can see them?) Edit: print_r - gives something like this, in this example of stats info: [characterInformationString] => table: 06831870 { INFO: LUA: [1] => table: 08D6CA68 { INFO: LUA: [1] => 39596 INFO: LUA: [2] => bestenemy INFO: LUA: } INFO: LUA: [2] => table: 08D6CA68 { INFO: LUA: [1] => 41278 INFO: LUA: [2] => timespent INFO: LUA: } INFO: LUA: [3] => table: 08D6CA68 { INFO: LUA: [1] => 41279 INFO: LUA: [2] => favspell INFO: LUA: } INFO: LUA: [4] => table: 08D6CA68 { INFO: LUA: [1] => 41280 INFO: LUA: [2] => favweapon INFO: LUA: } INFO: LUA: } Table? Is there a way to do something like: text lua "Infinity_FetchString(insert this table, string or whatever) ? New idea - new problem, this time with disappearing "new" journal, after enter the bestiary :D. UPDATE: This issue was solved. Edited November 10, 2023 by szef Quote Link to comment
aqrit Posted January 16, 2023 Share Posted January 16, 2023 Are you doing any engine modding? In the original PST the background was set to be transparent and it mostly worked due to how the DirectX swap_chain was setup. However, to get it working right™... The draw code of all the menus should have been modified to redraw both the "game view" and the menu, every frame. http://www.shsforums.net/topic/56475-drawing-transparent-menu-backgrounds-wip/ Quote Link to comment
szef Posted January 18, 2023 Author Share Posted January 18, 2023 (edited) @aqrit No, we didn't modify the engine, only ui.menu. Looks interesting, thanks. I'm afraid, though, that it is way more complicated...? Hmm. How to start modding the engine? Edited January 18, 2023 by szef Quote Link to comment
aqrit Posted January 19, 2023 Share Posted January 19, 2023 Learning to patch an executable would require understanding regular programming, then say another ~6 months to learn assembly and reverse engineering. Quote Link to comment
szef Posted January 19, 2023 Author Share Posted January 19, 2023 (edited) Yeah, I didn't think that was possible for someone at our level. The more that I'm currently on linux, so dealing with some exe, would be difficult... If I'm not mistaken. As for the native pst files (for linux) also do not know how to sensibly approach with anything useful. I tried debugger (gdb, objdump), unfortunately, it really does not give me much hehe. Too bad . Edit: @aqrit I'm curious how you discovered that this function/offset - 0x00220F4F is responsible for the root inventory background/menu? In general, do you think that the example idea of inventory (grid/backround) on the left and the game-world on the right is possible to obtain in EE version? Edited January 22, 2023 by szef Quote Link to comment
aqrit Posted January 25, 2023 Share Posted January 25, 2023 (edited) > I tried debugger (gdb, objdump) I'm not familiar with any linux tools for this. Assuming EE is even written in C++... gdb could probably get the job done, but you'll probably want something specialized for this type of work. For debuggers/disassemblers, I assume most people use Ghidra or IDA Pro on linux. The freeware version of IDA Pro doesn't include a debugger or decompiler though. Maybe radare2 (or cutter) could be good? For memory scanners: top google results are "GameConqueror" or "PINCE". > I'm curious how you discovered that this function/offset - 0x00220F4F is responsible for the root inventory background/menu? I don't recall, that was ~10 years ago. However, hooking the DirectDraw API and watching the callstack would've made it clear which function was drawing to which screens. There are many ways to find this function, that is the "game" of reverse engineering. e.g. the inventory menu has a hot-key of "i" so one could hook the keyboard handler then trace to the code that launches the inventory. Or one could hook the open file API then trace the lifetimes of the CHU or background image files. A memory scanner combined with hardware breakpoints is a giant shortcut to a lot of different strategies... > In general, do you think that the example idea of inventory (grid/background) on the left and the game-world on the right is possible to obtain in EE version? All things are possible, given enough time... I don't own the EE version and I haven't followed any news about any of the enhancements... but they probably changed the code a lot around this area. Edited January 25, 2023 by aqrit Quote Link to comment
szef Posted January 26, 2023 Author Share Posted January 26, 2023 I'll try to "play" with it ;). Thank you for your comprehensive answer! Quote Link to comment
szef Posted January 26, 2023 Author Share Posted January 26, 2023 (edited) Ending... Ghidra could probably handle it (but the debugger crashed with java version incompatibility error, hmm). However, I discovered some corresponding functions, while gdb gave some list (hmm): Spoiler Non-debugging symbols: 0x00000000008cd9d0 CScreenInventory::EngineDestroyed() 0x00000000008cd9e0 CScreenInventory::EngineGameUninit() 0x00000000008cd9f0 CScreenInventory::EngineInitialized() 0x00000000008cda00 CScreenInventory::OnLButtonDblClk(CPoint) 0x00000000008cda10 CScreenInventory::OnLButtonDown(CPoint) 0x00000000008cda30 CScreenInventory::OnLButtonUp(CPoint) 0x00000000008cda50 CScreenInventory::OnMouseMove(CPoint) 0x00000000008cda60 CScreenInventory::OnRButtonDown(CPoint) 0x00000000008cda70 CScreenInventory::OnRButtonUp(CPoint) 0x00000000008cda80 CScreenInventory::UpdatePersonalItemStatus(int) 0x00000000008cda90 CScreenInventory::OnRestButtonClick() 0x00000000008cdbb0 CScreenInventory::TimerSynchronousUpdate() 0x00000000008cdc50 CScreenInventory::OnKeyDown(int) 0x00000000008cdee0 CScreenInventory::EngineGameInit() 0x00000000008cdf70 CScreenInventory::EngineDeactivated() 0x00000000008ce010 CScreenInventory::~CScreenInventory() 0x00000000008ce010 CScreenInventory::~CScreenInventory() 0x00000000008ce0f0 CScreenInventory::~CScreenInventory() 0x00000000008ce3e0 CScreenInventory::UpdateContainerStatus(int, short) 0x00000000008ce450 CScreenInventory::CScreenInventory() 0x00000000008ce450 CScreenInventory::CScreenInventory() 0x00000000008ce5c0 CScreenInventory::ResetGroundPile() 0x00000000008ce610 CScreenInventory::SetErrorString(unsigned int, unsigned int) 0x00000000008ce6f0 CScreenInventory::SetErrorString2(unsigned int, char*, unsigned int) 0x00000000008ce820 CScreenInventory::SetItemCompareString(CString, unsigned int) 0x00000000008ce850 CScreenInventory::GetCurrentGroundPage() 0x00000000008ce880 CScreenInventory::FetchGroundPile(short, int) 0x00000000008cea10 CScreenInventory::GetMaxGroundPage() 0x00000000008cea70 CScreenInventory::OnGroundPage(int) 0x00000000008cebc0 CScreenInventory::FlushGroundPiles() 0x00000000008cf0d0 CScreenInventory::UpdateLua() 0x00000000008cf140 CScreenInventory::GetAbilitiesList(int) 0x00000000008cf350 CScreenInventory::ApplyItemOnSprite(int, int, Item_ability_st const*, CAIObjectType&, CItem*) 0x00000000008cf730 CScreenInventory::PlaySwapSound(CItem*, CItem*) 0x00000000008d0170 CScreenInventory::CheckMultiPlayerViewable() 0x00000000008d02b0 CScreenInventory::OnPortraitLClick(unsigned int) 0x00000000008d0380 CScreenInventory::EngineActivated() 0x00000000008d04d0 CScreenInventory::DelayLearnSpellCheck(CResRef const&) 0x00000000008d04f0 CScreenInventory::DelayStatChange() 0x00000000008d0520 CScreenInventory::CancelLearnSpellCheck() 0x00000000008d0550 CScreenInventory::UnPauseGame() 0x00000000008d05a0 CScreenInventory::IsCharacterInRange(int) 0x00000000008d0750 CScreenInventory::IsCharacterDead(int) 0x00000000008d07a0 CScreenInventory::GetInventorySlotHighlight(int) 0x00000000008d07c0 CScreenInventory::GetGroundSlotHighlight(int) 0x00000000008d07e0 CScreenInventory::RenderEncumbrance(CPoint, CRect) 0x00000000008d1110 CScreenInventory::ClearPortraitHighlighting() 0x00000000008d1190 CScreenInventory::GetButtonString(int) 0x00000000008d15d0 CScreenInventory::SwapWithPortrait(int, int) 0x00000000008d18a0 CScreenInventory::FindFreePersonalSlotOfType(EquipmentSlotTypes) 0x00000000008d1970 CScreenInventory::IsEquipSlotValid(unsigned int) 0x00000000008d20b0 CScreenInventory::IsSlotValid(unsigned int) 0x00000000008d2220 CScreenInventory::MapButtonIdToInventoryId(int, int) 0x00000000008d2360 CScreenInventory::FindFreePersonalSlot(unsigned int, unsigned int) 0x00000000008d2480 CScreenInventory::GetPersonalSlotHighlight(int) 0x00000000008d2540 CScreenInventory::GetWeaponSlotHighlight(int) 0x00000000008d2840 CScreenInventory::GetSlotHighlight(int) 0x00000000008d2a20 CScreenInventory::CheckSlotMergable(unsigned int) 0x00000000008d2b60 CScreenInventory::GetSlotIdForTempItem() 0x00000000008d3140 CScreenInventory::SwapWithSlot(int, int, unsigned short, int) 0x00000000008d5710 CScreenInventory::SelectItemAbility(int, int, int) 0x00000000008d6330 CScreenInventory::IsAbilitiesButtonActive(int) 0x00000000008d6560 CScreenInventory::GetUseButtonText(int, int) 0x00000000008d6700 CScreenInventory::DrinkPotion(int) 0x00000000008d7a60 CScreenInventory::CheckItemIdentify(int) 0x00000000008d7bb0 CScreenInventory::GetScrollIdentifyEnabled(int) 0x00000000008d7c70 CScreenInventory::GetSpellIdentifyEnabled(int) 0x00000000008d7e30 CScreenInventory::IdentifyWithSpell(int) 0x00000000008d8050 CScreenInventory::IdentifyWithScroll(int) 0x00000000008d8230 CScreenInventory::CopyNote(int) 0x00000000008da810 CScreenInventory::CancelEngine() 0x00000000008dabb0 CScreenInventory::MapButtonIdToItemInfo(int, CItem*&, unsigned int&, CResRef&, CResRef&, unsigned short&) 0x00000000008daf50 CScreenInventory::IsSpriteOrderable() 0x00000000008dafb0 CScreenInventory::IsUseButtonActive(int, int) 0x00000000008db440 CScreenInventory::GetUseButtonMode(int) 0x00000000008db630 CScreenInventory::TimerAsynchronousUpdate() 0x00000000008db910 CScreenInventory::CopySpell(int) 0x00000000008dbed0 CScreenInventory::OnUseButtonClick(int, int) 0x00000000008dc220 CScreenInventory::CheckMouseMove() 0x00000000008dc230 CScreenInventory::CheckSystemKeyCtrl() 0x00000000008dc240 CScreenInventory::SetSystemKeyCtrl(unsigned char) 0x00000000008dc250 CScreenInventory::CheckMouseLButton() 0x00000000008dc260 CScreenInventory::CheckMouseRButton() 0x00000000008dc270 CScreenInventory::GetNumVirtualKeys() 0x00000000008dc280 CScreenInventory::GetVirtualKeys() 0x00000000008dc290 CScreenInventory::GetVirtualKeysFlags() Edited January 27, 2023 by szef Quote Link to comment
szef Posted March 25, 2023 Author Share Posted March 25, 2023 (edited) For profiencies (from previous post) in inventory, it looks like that's enough: text lua "characters[id].proficiencies.pstDetails" As for: Spoiler But how to 'rewrite' the code to display (in inventory) statistics like: bestenemy, favspell, favweapon etc.? There are such functions: --Label stringref, var for value, percent flag characterInformationString = { {39596, "bestenemy"}, {41278, "timespent"}, {41279, "favspell"}, {41280, "favweapon"}, } characterInformationDisplayCategories = { {41308, "partygamexp", 1}, {41307, "partygamekills", 1}, {825, "gamexpvalue"}, {41281, "gamekills"}, } function formatCharacterInformationStr() local str = "" local tab = characters[currentID].Stats for k,v in pairs(characterInformationString) do str = str .. "^N" .. Infinity_FetchString(v[1]) .. "^-" .. "\n" .. tab[v[2]].current .. "\n\n" end return str end function getCharacterInformationValue(row) local str = characters[currentID].Stats[characterInformationDisplayCategories[rowNumber][2]].current if(characterInformationDisplayCategories[rowNumber][3] == 1) then str = str .. "%" end return str end - onOpen " characterInformationDisplayStr = formatCharacterInformationStr() " Does anyone have any ideas? Solution (thanks to @Bubb) "characters[id].Stats.bestenemy.current" "Infinity_FetchString(41308)" "characters[id].Stats.partygamexp.current ..'%'" Edited November 10, 2023 by szef Quote Link to comment
szef Posted May 28, 2023 Author Share Posted May 28, 2023 (edited) Spoiler After some time, I wanted to try to recreate something similar to a combined inventory like in dragonspear++ ui etc. Unfortunately I don't know how to: turn off the highlighting of the entire grid section when moving items? Not a single slot, but all 20 slots highlighted... This purple frame (turn off or proper refreshing). Thanks to @Bubb indispensable help, the black layer problem has been solved. Edited November 10, 2023 by szef Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.