Losing Hotkeys
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Moderator (Script&Mod)
- Posts: 22408
- Joined: Sun, 14. Nov 04, 23:26
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
I'd rather be wrong my way than yours. My way, people generally dont notice there was a problem. Yours, its a major disaster.
This is one of the reasons I left the IT industry. The unwillingness of those in charge to pay attention to unexploded bombs and neutralize them before they explode. I got sick of having to be a miracle worker after the event when my warnings got ignored.
If someone is going to be wrong, I'd rather it was me.
In the meantime, as I said, AP is a broken game for me. I'm no longer work on it. And I only play when I'm testing something. Game Over. Waiting now for X - The Next Generation (to find out if I can get it, at least.).
This is one of the reasons I left the IT industry. The unwillingness of those in charge to pay attention to unexploded bombs and neutralize them before they explode. I got sick of having to be a miracle worker after the event when my warnings got ignored.
If someone is going to be wrong, I'd rather it was me.
In the meantime, as I said, AP is a broken game for me. I'm no longer work on it. And I only play when I'm testing something. Game Over. Waiting now for X - The Next Generation (to find out if I can get it, at least.).
-
- Posts: 93
- Joined: Sun, 6. Mar 11, 19:33
-
- Posts: 245
- Joined: Sat, 31. May 08, 19:33
It does seem a bit hard to follow, doesn't it?0o0o0 wrote:Thanks kurush. If you end up figuring it out please post it here and let us know.
I ended up starting a new game and have them all back now. As far as adding any new hotkeys does anyone have a way to do it without them overwriting any that I already have?

Cycrow posted a small script to remove them all now, but... is there a way (scripting) to reinitialize the install hotkey routines? I realize many (most?) are set up using global variables, either in the setup script, or a seperate hotkey installation script. And, I haven't learned enough yet of the MSCI to see if there is a way. Can any of you scripting gurus see a way that maybe we can work together as a community to resolve this issue for the modding community as a whole?
I'm thinking something like a script that can be run when some disappear (are overwritten) that unregs all hotkeys, and then reinitializes all hotkey registrations (that exist in the game NOW) with a message before (Reinitializing, please wait..) and after (Hotkeys reinitialized, have a nice day..

-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Exactly.Cycrow wrote:i think your overestimating the effect its having on the majority of people.
The "noise" in this thread overwhelms the simple solution that I reported almost a week ago: Simply change the name of the hotkey in the setup script for any hotkey that has gone missing.
This increments the broken counter and restores the saved game to fully functional condition.
(You might have to do it for more than one hotkey.)
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 4320
- Joined: Sun, 6. Nov 05, 23:53
What do you mean by "name" here?DrBullwinkle wrote: The "noise" in this thread overwhelms the simple solution that I reported almost a week ago: Simply change the name of the hotkey in the setup script for any hotkey that has gone missing.
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Workaround for lost hotkey bug (AP versions prior to 2.1)
Use the script below.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Details
By "name" of the hotkey I mean:
<RetVar> = register hotkey <name> to call script <Script Name>
Or, for the Hotkey Manager:
<RetVar> = call script 'plugin.hotkeymanager.add' nameid='name' Display Text='My Hotkey' Hotkey Script='plugin.myscript.hotkey'
Change name to something else. Anything else (that is not already used by another hotkey). Then reload a saved game. This will add a second hotkey, with the broken counter incremented.
Result: Problem solved (for that saved game).
(You might have to do it for more than one hotkey setup script, but I only had to do it for the most-recently-added hotkey.)
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
How the bug works
As clarified by Cycrow, the bug is (sometimes) caused when a hotkey is *removed* in AP versions 2.0a and below. The bug causes a minor corruption in the saved game, which makes new hotkeys frustrating.
The complete cure is to start a new game in AP 2.1 or above.
The above workaround is effective if you want to try to preserve a saved game that you began in AP 2.0a or lower.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Here is a script that I used to restore my broken hotkeys. It includes a lot of common scripts (plus a few others). You may have to add global variables from setup scripts that you use.
What it does: The script removes all of your hotkeys, plus many of the global variables that prevent hotkeys from being recreated. The result is that all of your hotkeys will be re-set. If you do this with recent versions of AP, then your game should be free of the hotkey bug forever. (Maybe
)
How to modify for your game:
The global variables that control hotkeys are usually set in the setup script for the hotkey or script. So look in the setup script for any hotkey that has vanished in your game, find the name of the global variable, and add it to the script below. Then follow the instructions for using the script.
How to use this script:
1) Copy and paste the script into X-Studio Script Editor or Exscriptor. (Do not use a normal text or xml editor!).
2) Save as a script. Give it a name that you will remember. Tip: If the first character of the file name is an "a" then it will appear near the top of the list in the in-game Script Editor (SE).
3) Manually run the script from the script Editor (select then press "r"). It does not need any arguments, so just press Enter several times until you return to the SE list.
4) Save, then reload the save. Your hotkeys should be all blank. Re-set the hotkeys and enjoy the game.
The above is based on kurush's similar script.
.
Use the script below.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Details
By "name" of the hotkey I mean:
<RetVar> = register hotkey <name> to call script <Script Name>
Or, for the Hotkey Manager:
<RetVar> = call script 'plugin.hotkeymanager.add' nameid='name' Display Text='My Hotkey' Hotkey Script='plugin.myscript.hotkey'
Change name to something else. Anything else (that is not already used by another hotkey). Then reload a saved game. This will add a second hotkey, with the broken counter incremented.
Result: Problem solved (for that saved game).

(You might have to do it for more than one hotkey setup script, but I only had to do it for the most-recently-added hotkey.)
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
How the bug works
As clarified by Cycrow, the bug is (sometimes) caused when a hotkey is *removed* in AP versions 2.0a and below. The bug causes a minor corruption in the saved game, which makes new hotkeys frustrating.
The complete cure is to start a new game in AP 2.1 or above.
The above workaround is effective if you want to try to preserve a saved game that you began in AP 2.0a or lower.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Here is a script that I used to restore my broken hotkeys. It includes a lot of common scripts (plus a few others). You may have to add global variables from setup scripts that you use.
What it does: The script removes all of your hotkeys, plus many of the global variables that prevent hotkeys from being recreated. The result is that all of your hotkeys will be re-set. If you do this with recent versions of AP, then your game should be free of the hotkey bug forever. (Maybe

How to modify for your game:
The global variables that control hotkeys are usually set in the setup script for the hotkey or script. So look in the setup script for any hotkey that has vanished in your game, find the name of the global variable, and add it to the script below. Then follow the instructions for using the script.
How to use this script:
1) Copy and paste the script into X-Studio Script Editor or Exscriptor. (Do not use a normal text or xml editor!).
2) Save as a script. Give it a name that you will remember. Tip: If the first character of the file name is an "a" then it will appear near the top of the list in the in-game Script Editor (SE).
3) Manually run the script from the script Editor (select then press "r"). It does not need any arguments, so just press Enter several times until you return to the SE list.
4) Save, then reload the save. Your hotkeys should be all blank. Re-set the hotkeys and enjoy the game.

Code: Select all
$id = 1536
while $id < 3000
unregister hotkey $id
inc $id
end
$hotkeys = array alloc: size=0
set global variable: name='manager.hotkeys' value=$hotkeys
set global variable: name='com.agent.hotkey1' value=[FALSE]
set global variable: name='com.logistics.hotkey1' value=[FALSE]
set global variable: name='com.logistics.hotkey2' value=[FALSE]
set global variable: name='missile.defense.mosquito.hotkey1' value=[FALSE]
set global variable: name='yalam.ship.trader.hotkey' value=null
set global variable: name='LitQB.Bounce.HotKey.Toggle' value=null
set global variable: name='GZ.TURRET.ONOFF.CONFIG' value=null
set global variable: name='plugin.advthrust.key' value=null
set global variable: name='cycrow.cheat.hotkey' value=null
set global variable: name='cheat.hotkey.destruct' value=null
set global variable: name='cheat.hotkey.destruct' value=null
set global variable: name='hotkey.scs' value=null
set global variable: name='jump.hotkey' value=null
set global variable: name='hotkey.plugin.loadout' value=null
set global variable: name='lv.ep.hk' value=null
set global variable: name='lv.ep.hk1' value=null
set global variable: name='plugin.mailo.loot.ship.loot.hotkey' value=null
set global variable: name='plugin.mailo.loot.check.loot.hotkey' value=null
set global variable: name='plugin.mailo.loot.consumable.afterburner' value=null
set global variable: name='plugin.mailo.loot.consumable.shieldboost' value=null
set global variable: name='plugin.mailo.loot.consumable.weaponboost' value=null
set global variable: name='bw.phq.upgrade.config.key' value=null
set global variable: name='raumwarentransporter.hotkey' value=null
set global variable: name='missile.defense.mosquito.hotkey1' value=null
set global variable: name='RC.scanTargetObject.key' value=null
set global variable: name='ship.hijacker.registered' value=null
set global variable: name='warp.hotkey' value=null
set global variable: name='xtlc.cs.hotkey' value=null
set global variable: name='hotkey.xai.launch.fdrone' value=null
set global variable: name='xi.hack.target.k' value=null
set global variable: name='hotkey.xai.missiledef' value=null
set global variable: name='SC.Dev.Chat.Hotkey' value=null
set global variable: name='RSwE.Hotkey' value=null
set global variable: name='wob.wse.hotkey.menu' value=null
set global variable: name='trov.hotkey' value=null
set global variable: name='globvar.terranpolicelicence.setupscriptversion' value=null
* Note: This will wipe Smart Turret configuration completely:
set global variable: name='Glen.Smart.Turret' value=null
set global variable: name='missile.defense.mosquito.hotkey1' value=null
* Note: This will wipe MARS configuration completely:
set global variable: name='GZ.MARS.CONFIG' value=null
return null
The above is based on kurush's similar script.
.
Last edited by DrBullwinkle on Sat, 26. Jan 13, 22:04, edited 6 times in total.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 245
- Joined: Sat, 31. May 08, 19:33
I missed that too, Doc... And thank you, I do enough testing at times, so run into the hotkey thing more than I'd like to. While not elegant, it will work until it's fixed, or a more elegant solution comes along.DrBullwinkle wrote:Exactly.Cycrow wrote:i think your overestimating the effect its having on the majority of people.
The "noise" in this thread overwhelms the simple solution that I reported almost a week ago: Simply change the name of the hotkey in the setup script for any hotkey that has gone missing.
This increments the broken counter and restores the saved game to fully functional condition.
(You might have to do it for more than one hotkey.)
I see the problem with a 1 fix for all. It doesn't look like a solution (script) could be made that would work for all the 100s of combinations of modded games. And all the diffrent ways scripters put their hotkeys into the game.
-
- Posts: 4320
- Joined: Sun, 6. Nov 05, 23:53
Yeah, a canned solution is almost impossible here. Dr.B's method seems to be the best. I actually think I ended up doing something similar to restore the hotkeys I lost in my game, just didn't realized it was the name change among other chaotic changes that fixed thingsAegyen wrote: I see the problem with a 1 fix for all. It doesn't look like a solution (script) could be made that would work for all the 100s of combinations of modded games. And all the diffrent ways scripters put their hotkeys into the game.

Ok, now it is time to finally write that missile spam hotkey I was contemplating for a long time.
-
- Moderator (Script&Mod)
- Posts: 22408
- Joined: Sun, 14. Nov 04, 23:26
a script might be able to to work, but there would be no guarntees.
most scripts tend to use simlar names for thier global variables so you can use the reg ex commands to get a list of the various types of names used to remove them.
this wouldn't help for any scripts that use odd names thou, those your only choise is to do it manually
most scripts tend to use simlar names for thier global variables so you can use the reg ex commands to get a list of the various types of names used to remove them.
this wouldn't help for any scripts that use odd names thou, those your only choise is to do it manually
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
My solution does. It completely fixes the broken saved game. You will have to reassign ONE hotkey (or, possibly, a small number), and you will only have to reassign it/them once.apricotslice wrote:None of that addresses the issue of having to reassign the hotkeys to keys every time you start a new game.
Try it before complaining about it.

.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
Game start = zero save games. How does fixing a save game affect a game start ?DrBullwinkle wrote:My solution does. It completely fixes the broken saved game. You will have to reassign ONE hotkey (or, possibly, a small number), and you will only have to reassign it/them once.apricotslice wrote:None of that addresses the issue of having to reassign the hotkeys to keys every time you start a new game.
Try it before complaining about it.
.
I repeat, every time you start a new game, all hotkey assignments are removed, including the custom saves of hotkeys.
Try it yourself.
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
As far as I know, the game has always worked that way. Is your comment relevant to this thread?apricotslice wrote:every time you start a new game, all hotkey assignments are removed
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Posts: 14163
- Joined: Sun, 16. May 04, 13:01
AP yes. TC and before, no. In the past, hotkeys got assigned once, and you never needed to reassign them again unless you reinstalled the game.DrBullwinkle wrote:As far as I know, the game has always worked that way. Is your comment relevant to this thread?apricotslice wrote:every time you start a new game, all hotkey assignments are removed
The entire way hotkeys are done was rewritten for AP, to solve some issues that were in TC, like multiple installs of the same hotkey.
Hotkeys disappearing is only PART of the problem I originally brought up.
I want to WHOLE problem solved, not just that one bit of it.
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
I'll take that as a "no".
Thank you.
Thank you.
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
-
- Moderator (Script&Mod)
- Posts: 22408
- Joined: Sun, 14. Nov 04, 23:26
the only change to hotkeys in AP was that it now checks if an existing hotkey is already registered, and overrights instead of adds a new one.
This has exposed an existing problem that was been present since X3 Reunion. Just hidden.
The hotkey system hasn't been rewritten, despite what you may think
there was no change to how the keys are assigned or stored.
are you sure u've set it to use the correct profile ? as the assigned keys are stored in the profile and it its not set, it'll load the defaults which wont include the added hotkeys.
i've started lots of TC and AP games while testings, and they both work in the same way
This has exposed an existing problem that was been present since X3 Reunion. Just hidden.
The hotkey system hasn't been rewritten, despite what you may think
there was no change to how the keys are assigned or stored.
are you sure u've set it to use the correct profile ? as the assigned keys are stored in the profile and it its not set, it'll load the defaults which wont include the added hotkeys.
i've started lots of TC and AP games while testings, and they both work in the same way
-
- Posts: 39
- Joined: Sun, 28. Dec 03, 12:53
Any plans to release an update that fixes this bug?Cycrow wrote:the only change to hotkeys in AP was that it now checks if an existing hotkey is already registered, and overrights instead of adds a new one.
This has exposed an existing problem that was been present since X3 Reunion. Just hidden.
The hotkey system hasn't been rewritten, despite what you may think
there was no change to how the keys are assigned or stored.
are you sure u've set it to use the correct profile ? as the assigned keys are stored in the profile and it its not set, it'll load the defaults which wont include the added hotkeys.
i've started lots of TC and AP games while testings, and they both work in the same way
As atm X3AP will only allow a max of 11 hotkeys here & any new script added removes the existing ones from the menu.
-
- Posts: 5715
- Joined: Sat, 17. Dec 11, 01:44
Easy Way to Repair Saved Games with Broken Hotkey CounterOok wrote:Any plans to release an update
Peace through superior firepower
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)