EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
Losing Hotkeys
Post new topic Reply to topic Goto page Previous  1, 2, 3, 4, 5  Next
View previous topic :: View next topic
Author Message
kurush



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3856 on topic

Thank you for registering your game
PostPosted: Thu, 5. Jul 12, 07:55    Post subject: Reply with quote Print

DrBullwinkle wrote:

Question: Does that repair your damaged save file? Does it now work correctly?
.

It seems to, at least until I hit that unknown code that unregistered a hotkey for me. I wonder if it could be a result of moving my save file from one PC to another.
Quote:
I would expect it to NOT work that way.

Care to elaborate why? I started from just renaming them of course.

Here is the script that I ended up running:
Code:

$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]

This covers CLS, CAG, and MDM hotkeys plus whatever is registered in the hotkey manager (i.e. turbo boost). After running this script I saved and reloaded.


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
DrBullwinkle





Joined: 17 Dec 2011
Posts: 3754 on topic
Location: Boston, USA
Thank you for registering your game
modified
PostPosted: Thu, 5. Jul 12, 08:37    Post subject: Reply with quote Print

kurush wrote:
that unknown code that unregistered a hotkey for me.


My guess is that the Plugin Manager runs an uninstall script, if available. So you might be safe if you never uninstall anything. Maybe.

kurush wrote:
Quote:
I would expect it to NOT work that way.

Care to elaborate why?


The problem is in the saved game, not in the "register hotkey" command. So I would expect that repeating the command in a loop would have no effect.

You have to create a new hotkey, then SAVE. Test. Repeat, if necessary.

Also, I specifically changed the setup script for the missing hotkey (not just any arbitrary hotkey). That is another reason why making a loop does not make sense to me, because you may have to fix whichever hotkey is broken. At least, that is what I did.

But I am mostly guessing. I only had one bad hotkey, so maybe my case was simpler than yours.

Thanks for posting your code. Why do you loop from 1536 to 3000? If that has been mentioned before, I must have missed it.
.


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software (DCS) | Ship Tricks: Mini-Guides (with Video)


Last edited by DrBullwinkle on Thu, 5. Jul 12, 08:42; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
kurush



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3856 on topic

Thank you for registering your game
PostPosted: Thu, 5. Jul 12, 08:42    Post subject: Reply with quote Print

DrBullwinkle wrote:

Thanks for posting your code. Why do you loop from 1536 to 3000? If that has been mentioned before, I must have missed it.
.

This is the Cycrow's code that I just copy/pasted. It was his suggestion to run it. Now I realized that I am still missing one hotkey *sigh*. Now it is Plugin Configurations, I wonder where does it get registered.


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
DrBullwinkle





Joined: 17 Dec 2011
Posts: 3754 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Thu, 5. Jul 12, 08:51    Post subject: Reply with quote Print

Oh, right... now I remember the 1536-3000.

kurush wrote:
Plugin Configurations, I wonder where does it get registered.


init.community.config.xml?


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software (DCS) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 19893 on topic
Location: London
Thank you for registering your game
PostPosted: Thu, 5. Jul 12, 10:06    Post subject: Reply with quote Print

1536 is the id of the first custom hotkey, 3000 is just a random number to cover all hotkeys.

if i get chance tonite ill create a script that will remove all the registered hotkeys using regex


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Charon_A





Joined: 06 Nov 2002

Location: Argon Prime

PostPosted: Thu, 5. Jul 12, 10:38    Post subject: Reply with quote Print

I banged against this some time ago.
The problems started after I tried to start a new game to test my script and then loaded old save and unregistered/registered some hotkeys. To be on the safe side - do not start new game until you're really done with the one you're playing Smile

As for regex, I tried this, but not every script follows naming convention.
$global.keys = get global variables: regular expression='.*key.*'

I even went to the length of analyzing all the scripts I had and manually unregistered all their hotkeys. That didn't help either.

So after all I tried a brute-force 1500-2000 loop and unregistered all I could - still got missing/overlapping hotkeys on consecutive registration attempts.

I finally gave up and decided to roll back to the last save before I started uninstalling hotkeys and stating new games. That save has most of the hotkeys I need and works for now. I try very hard not to add any more hotkeys in my current game.


_________________
Be careful about reading health books. You may die of a misprint.
---Mark Twain---
Back to top
View user's profile Send private message
apricotslice





Joined: 16 May 2004
Posts: 13376 on topic
Location: Mapping beyond the Unknown Regions.
Thank you for registering your game
PostPosted: Thu, 5. Jul 12, 13:46    Post subject: Reply with quote Print

DrBullwinkle wrote:
I only had one bad hotkey, so maybe my case was simpler than yours.


Yes, yours is the most simplest case, hence the difference in emphasis.

I have over a dozen that go missing as soon as you add 1 new hotkey, and as soon as you start a new game.

Its too many for hit and miss fixes.


_________________
Apricot Mapping Services HQ

CLICK HERE for : X3R/TC Handbook; X3R, TC and AP Guides, Mods, & Scripts; X3R, TC and AP Downloads

Apricot X3 Forum
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DrBullwinkle





Joined: 17 Dec 2011
Posts: 3754 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Thu, 5. Jul 12, 15:43    Post subject: Reply with quote Print

Charon_A wrote:
I try very hard not to add any more hotkeys in my current game.


Adding hotkeys is not a problem.

The only issue is with *removing* hotkeys.


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software (DCS) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
kurush



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3856 on topic

Thank you for registering your game
PostPosted: Thu, 5. Jul 12, 18:25    Post subject: Reply with quote Print

Cycrow wrote:
1536 is the id of the first custom hotkey, 3000 is just a random number to cover all hotkeys.

if i get chance tonite ill create a script that will remove all the registered hotkeys using regex

I just realized that the script actually didn't help. It still allows me to register up to 10 hotkeys and then starts reusing the indexes. How would the regex version differ from just trying to unregister them all?
DrBullwinkle wrote:

init.community.config.xml?

At least I think I know what had hit me Smile This script apparently has some code to unregister its hotkey when the hotkey manager is either installed or removed.


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
apricotslice





Joined: 16 May 2004
Posts: 13376 on topic
Location: Mapping beyond the Unknown Regions.
Thank you for registering your game
PostPosted: Fri, 6. Jul 12, 01:55    Post subject: Reply with quote Print

DrBullwinkle wrote:

The only issue is with *removing* hotkeys.


The hotkey manager has code to remove them, but I cant determine why it would be used. Not knowing the logic, I'm not game to simply remove the call.

This is why I want Cycrow to fix it. He knows the logic structure for the group of scripts.

And btw, I've NOT removed any hotkeys. I get the problem when I ADD a hotkey and start a new game. There is no reason at all why the scripts should be trying to delete hotkeys at all ! Hence my not understanding the logic of it.


_________________
Apricot Mapping Services HQ

CLICK HERE for : X3R/TC Handbook; X3R, TC and AP Guides, Mods, & Scripts; X3R, TC and AP Downloads

Apricot X3 Forum
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kurush



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3856 on topic

Thank you for registering your game
PostPosted: Fri, 6. Jul 12, 03:43    Post subject: Reply with quote Print

apricotslice wrote:

The hotkey manager has code to remove them, but I cant determine why it would be used. Not knowing the logic, I'm not game to simply remove the call.

Hotkey manager unregister logic does not kick in, so there is no need to remove anything from there. There are other script that can use the unregister function.


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
apricotslice





Joined: 16 May 2004
Posts: 13376 on topic
Location: Mapping beyond the Unknown Regions.
Thank you for registering your game
PostPosted: Fri, 6. Jul 12, 03:50    Post subject: Reply with quote Print

kurush wrote:
apricotslice wrote:

The hotkey manager has code to remove them, but I cant determine why it would be used. Not knowing the logic, I'm not game to simply remove the call.

Hotkey manager unregister logic does not kick in, so there is no need to remove anything from there. There are other script that can use the unregister function.


If thats the case, then the problem is NOT in the unregister code, because I've never removed any hotkeys.

The only way the unregister code can be the problem is if the logic uses that function generally. eg. in order to add a new hotkey, it first deletes all of them, and then adds them all back in. That kind of thing is the sort of logic I was refering to, as its the only way I can see the unregister code being used in my game. If that isnt the case, then unregistering hotkeys has nothing at all to do with the problem !


_________________
Apricot Mapping Services HQ

CLICK HERE for : X3R/TC Handbook; X3R, TC and AP Guides, Mods, & Scripts; X3R, TC and AP Downloads

Apricot X3 Forum
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kurush



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3856 on topic

Thank you for registering your game
PostPosted: Fri, 6. Jul 12, 08:22    Post subject: Reply with quote Print

apricotslice wrote:

If thats the case, then the problem is NOT in the unregister code, because I've never removed any hotkeys.

You have to read all setup and init scripts to be able to say that. For example, I figured that my hotkey likely got unregistered by init.community.plugin.xml that can unregister the hotkey for Plugin Configurations under certain circumstances. You don't have to uninstall anything to trigger that. Ironically, all you have to do is install the hotkey manager when plugin manager is already there and has its hotkey registered.


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
apricotslice





Joined: 16 May 2004
Posts: 13376 on topic
Location: Mapping beyond the Unknown Regions.
Thank you for registering your game
PostPosted: Fri, 6. Jul 12, 08:35    Post subject: Reply with quote Print

kurush wrote:
apricotslice wrote:

If thats the case, then the problem is NOT in the unregister code, because I've never removed any hotkeys.

You have to read all setup and init scripts to be able to say that. For example, I figured that my hotkey likely got unregistered by init.community.plugin.xml that can unregister the hotkey for Plugin Configurations under certain circumstances. You don't have to uninstall anything to trigger that. Ironically, all you have to do is install the hotkey manager when plugin manager is already there and has its hotkey registered.


Well then, that would appear to be the problem. Why cant that circumstance be fixed by Cycrow and released as a hotkey manager update ?

However, if it was that, why hasnt it already been fixed and released as a script update ?


_________________
Apricot Mapping Services HQ

CLICK HERE for : X3R/TC Handbook; X3R, TC and AP Guides, Mods, & Scripts; X3R, TC and AP Downloads

Apricot X3 Forum
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 19893 on topic
Location: London
Thank you for registering your game
PostPosted: Sun, 8. Jul 12, 20:07    Post subject: Reply with quote Print

apricotslice wrote:

Well then, that would appear to be the problem. Why cant that circumstance be fixed by Cycrow and released as a hotkey manager update ?


because its not actually a problem with the hotkey manager
the scripts were designed to work with or without the hotkey manager.
without it, it manages its own hotkey.

but when you start using the hotkey manager, the script will remove its own version and use the hotkey manager.

so no changes to the hotkey manager will help with this.

the scripts that do this will need to be altered. And it isn't just the Config plugin that does this, there are many others


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic Reply to topic Goto page Previous  1, 2, 3, 4, 5  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Wed, 19. Jun 13, 17:49

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2009
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.47820 seconds, sql queries = 74