Closed FakelsHub closed 7 years ago
@FakelsHub : What are these two?
#define INTFACEUSE (0x8000)
#define INTFACELOOT (0x10000)
I have an idea! How about we add a hook script when game mode changes? This way you won't need to check it every frame, saving some CPU and scripter's time :)
What are these two?
INTFACEUSE - The backpack interface that opens through the icon menu. INTFACELOOT - Interface when exchanging with Сontainers or NPC's.
I have an idea! How about we add a hook script when game mode changes?
Closing inventory will also be determined by this hook? - otherwise how to check that the player has closed inventory.
Implemented in develop, without the hook (for now).
В 3.8.5 какая-то странная ошибка присутствует в новых режимах, а именно с INTFACELOOT. Проверял на скрипте Filter Inventory, если открыть инвентарь обмена с контейнерами и закрыть, а потом выйти в главное меню, и начать игру заново, то игра падает с критической ошибкой. В версии 4.0 и Crafty такой ошибки нет.
Which version of yours? 1.2? I can't click buttons in 1.3 with sfall 3.8.5 or 4.0. I tested your 1.2 advanced with sfall 4.0 and can still crash the game while looting containers. Actually the filter has already screwed up when clicking a catalog button but there's no corresponding items. The buttons just stay on the screen even if I close the container interface.
I can't click buttons in 1.3 with sfall 3.8.5 or 4.0.
I do not know why you can't click on the buttons) AllowUnsafeScripting enabled ?
Do not try to test this error, it is specific and appears under certain conditions only in version 3.8.5. why don't know. I tried to test the error in Nevada with 3.8.5 but the error does not occur, But it appears on my custom test map! I can't pass this test map to you, since it contains objects from my mod.
Can I somehow help you to correct this mistake, what should I do?
I do not know why you can't click on the buttons) AllowUnsafeScripting enabled ?
Nope, I usually disable it and deem any script requires it as "dangerous/unreliable". It's better to find some way to not rely on those functions if possible.
Do not try to test this error, it is specific and appears under certain conditions only in version 3.8.5. why don't know. I tried to test the error in Nevada with 3.8.5 but the error does not occur, But it appears on my custom test map! I can't pass this test map to you, since it contains objects from my mod. Can I somehow help you to correct this mistake, what should I do?
If I were you, I'd test the error in normal game or vanilla maps and see if the error can be reproduced in a reliable way, since you can't share your test map. I've tested 1.3 with sfall 3.8.5 in RP and couldn't trigger the crash (the filter itself works smoothly)
I found out the reason. As it turned out, there was no script .int file in the scripts folder attached to the object, so under such circumstances with sfall version 3.8.5 the game crashes with an error. How this interacts with INTFACELOOT is not entirely understandably to me, and why this works well (without crash error) with 4.0 and Crafty. :/
You can check this, put two objects on the blank map, a container and any other, attach a non-existent script to the second object (for example, none.int).
Save the map and test it.
Open inventory exchange with containers and close, and then go to the main menu, and start the game again.
👍
Nope, I usually disable it and deem any script requires it as "dangerous/unreliable". It's better to find some way to not rely on those functions if possible.
I do not understand what's dangerous here? There is no way to do without these engine functions, or you will have to write a new FuncX function each time for such specific engine functions. Or come up with a "safe" way to access the engine functions directly.
You can check this, put two objects on the blank map, a container and any other, attach a non-existent script to the second object (for example, none.int).
When I try to enter a fake name the mapper automatically ignores it, so I just added an extra line of the fake script in scripts.lst to trick mapper to attach the name to a computer. I added the test objects on the temple map, and yeah, the game crashed with memory error:
The instruction at 0046716b referenced memory at 0000c039
The memory could not be read from
Even if I switch to use Crafty's setup_inventory_hook (a combo of INVENTORY + INTFACEUSE + INTFACELOOT + BARTER hooks), sfall 3.8.5 still crashed. Honestly the whole extra get_game_mode backporting is pretty much a half-assed job; I didn't even backport HEROWIN.
I can keep the current INTFACEUSE, INTFACELOOT, and BARTER modes for 3.8.5, but the crash issue would still exist, or I might just completely revert the get_game_mode changes back to the same as older 3.8.x builds for stability over functionality. Given that 3.8.x branch has been already in "maintenance" lifecycle, and 3.8.5 will be the last release of legacy 3.x codebase. It's just me wanting to cram bug fixes and applicable & easy-to-implement minor features to keep 3.8.x a bit more up-to-date before its final moment.
I can keep the current INTFACEUSE, INTFACELOOT, and BARTER modes for 3.8.5, but the crash issue would still exist
Probably still leave these new modes. What's the problem, why does the game crash?
Probably still leave these new modes.
Maybe, they seem working fine when there's no "bugged" object in a map, and the crash only happens with your inventory filter mod so far. But given that 4.0 works completely fine, I lean toward cutting them off from 3.8.x. At least that doesn't cause any crash with the inven filter for objects w/ missing script.
What's the problem, why does the game crash?
Honestly I don't know. Crafty's 1.7.31 (20170215, the last release with source code) also crashed with the same error. Guess old 3.x codebase has a bug in certain error handling or something.
EDIT: is it normal for your invenfilter 1.3 that in the container interface, clicking catalog buttons only moves corresponding items to the top of the list, instead of hiding other items?
I still think that AllowUnsafeScripting should always be disabled, unless you are in the process of adding new scripting functions to sfall or you are just a mean hacker-modder and want to screw up player's PC with viruses and such :D
Add these new modes. from Crafty
define INTFACEUSE (0x8000)
define INTFACELOOT (0x10000)
define BARTER (0x20000) // игрок находится в режиме торговли, у crafty get_mode возвращает 0x20004 (BARTER+DIALOG)
define HEROWIN (0x40000) // ??? это я не знаю чего такое :)