Skip to content

Posts from How to break the save system? Auto-translated

No ratings yet — be the first to rate!
User Avatar
#1
Auto-translated
I'm creating a map where the goal is to survive for as long as possible, but the save system ruins the whole concept. I know how to disable saves in multiplayer using TalkBox, but I have no idea how to do it in single-player mode. Does anyone know a working way to disable saves or make a script recognize that a game was loaded and immediately issue a defeat? I would be very grateful for your help.
User Avatar
#2
Auto-translated
There are Save() and Load() functions; perhaps rewriting them could lead to a viable solution. Alternatively, there's a guaranteed option: simply remove the save game buttons from the menu and disable the hotkey. But that would be a rather crude fix.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#3
Auto-translated
If the game can save and load files using scripts, then after the user clicks "End Turn," the game's identifier can be saved to a file... when the game starts, a session identifier is generated (a random number within a certain range, repeated four times, like a PIN code, although more variables could be used, but four is optimal), and a file with this identifier is saved – we have now recorded the session identifier, and the session control variable receives this value... before the user clicks "End Turn" again, the file is read, and a verification generation of the identifier, similar to a PIN code, is performed, meaning it's generated in four digits – a match is practically impossible!
1
2
3
4
5
6
r = os.clock()
function _random()
  math.randomseed(r);
  r = math.random()
  return r;
end
С уважением, Psatkha (Псатха)

---------------------------------------------

Неудачное планирование ведёт к неудаче ...

NCF - мод, добавляющий дополнительных существ в HeroesV 3.1
In reply to psatkha
User Avatar
#4
Auto-translated
Thank you very much for the advice. I managed to break the save system. I created an empty link in the shared files in /UI/Load.(WindowScreen).xdb and /UI/Save.(WindowScreen).xdb. Now, when I click the save or load button, or press F6, the game simply crashes. This is more than satisfactory for me 😀
Мои карты: Белый Храм, Поменяться местами, Судьба королевства, Стихийные острова.
User Avatar
#5
Auto-translated
If there's a way to do it properly, do it. With an approach that only satisfies you, someone who's used to frequently pressing F5, it definitely won't be to their liking. After the third or fourth "save," they'll swear and delete the scenario.
In reply to Mооnst@r
User Avatar
#6
Auto-translated
But seriously, here’s what I managed to do: In the files /UI/Load.(WindowScreenShared).xdb and /UI/Save.(WindowScreenShared).xdb, I removed the references to the “Save”/“Load” button in the Children section. After that, the buttons disappeared, but it was still possible to save/load by double-clicking the file in the list. I fixed this in the files /UI/SaveLoad/SavesList.(WindowScrolllableContainer).xdb and LoadsList.(WindowScrollableContainer).xdb by removing the double-click block. After that, files can only be saved using F5, and loading is impossible at all (it seems). I’ve attached the mod to the comment.
Attachments 1
1 file attached • Total size: 120.8 KB
Мои карты: Белый Храм, Поменяться местами, Судьба королевства, Стихийные острова.
In reply to Mооnst@r
User Avatar
#7
Auto-translated
Mооnst@r
If there's a way to do something properly, do it. Someone who's used to frequently pressing F5 won't appreciate this "good enough" approach. After the third or fourth save, they'll swear and delete the scenario.

You guys have no sense of humor...
Мои карты: Белый Храм, Поменяться местами, Судьба королевства, Стихийные острова.
In reply to Долгий
User Avatar
#8
Auto-translated
Long
...After this, files can only be saved using f5, and loading is impossible at all (it seems).

You can save by pressing Enter in the "save game" menu.
In reply to Mооnst@r
User Avatar
#9
Auto-translated
Mооnst@r

You can save by pressing Enter in the "save game" menu.

Thank you. It's good that Enter only allows you to save, but not load. I found another issue - the hotkey F8

Added 11 minutes later
And it works even in the first mod (where the crashes occur).
Мои карты: Белый Храм, Поменяться местами, Судьба королевства, Стихийные острова.
User Avatar
#10
Auto-translated
To disable the save and load buttons, you can edit the files -
[UI\SaveLoad\SaveSpecific\Save.(WindowMSButton).xdb] remove the command
				<Commands>
<Item href="/UI/SaveLoad/Save.(UISDirectRunReaction).xdb#xpointer(/UISDirectRunReaction)"/>
</Commands>

and 

				<Commands/>

similarly, remove the command for loading in [UI\SaveLoad\SaveSpecific\Load.(WindowMSButton).xdb].
And for double-clicking [UI/SaveLoad/LoadsList.(WindowScrollableContainer).xdb]

		<Commands>
<Item href="LoadDblClick.(UISDirectRunReaction).xdb#xpointer(/UISDirectRunReaction)"/>
</Commands>
As for [quickload 'F8'] and [quicksave 'F5'], nothing can be done about them—these commands are hardcoded into the exe. Of course, you could break them there too by using a HEX editor to change the values, for example to quicklo1d and quicksa1e. But that's not a great option.
Грешить, злодействовать, а равно и делать добро или совершать подвиги надо без натуги. А если с натугой — то лучше не надо.
К. Прутков-инженер. Мысль № 77.
Многие вещи нам непонятны не потому, что наши понятия слабы; но потому, что сии вещи не входят в круг наших понятий.
© Козьма Прутков
User Avatar
#11
Auto-translated
You can try using a script command to enter the following in the console:
unbind COMMAND_NAME
or bind COMMAND_NAME "MOUSE_B5"
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to vova2112
User Avatar
#12
Auto-translated
vova2112
To disable the save and load buttons
As I mentioned above, the buttons don't even appear in the save/load menu, which is great.
vova2112
However, there's nothing you can do about [quickload 'F8'] and [quicksave 'F5'] – these commands are hardcoded into the executable. Of course, you could break it by changing the values in a hex editor, for example, to quicklo1d and quicksa1e. But that's not a great solution.
Yes, the quickload and quicksave IDs are created in the executable. However, the bindings to f8 and f5 are written in the input_a2.cfg file, which is located in the documents folder. Yesterday, I simply commented out the lines: bind quicksave 'F5' and
bind quickload 'F8'. This helped, but I'll have to explain to users where to put this file or (God forbid) create an installer. I like your idea of changing the bits in the executable, as this map already uses a custom executable.


Added 1 minute ago
}{0TT@6bI4
You could try using a script command to write to the console
unbind COMMAND_NAME
or bind COMMAND_NAME "MOUSE_B5"
I tried it. For some unknown reason, it only works in about 10% of cases.

PS. It worked using
unbind quicksave
unbind quickload
Мои карты: Белый Храм, Поменяться местами, Судьба королевства, Стихийные острова.