|
|
 |
View previous topic :: View next topic |
 |
|
|
|
|
Author |
Message |
|
|
|
|
|
kurush
 
Joined: 07 Nov 2005 Posts: 3856 on topic

|
Posted: Thu, 5. Jul 12, 07:55 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
DrBullwinkle

Joined: 17 Dec 2011 Posts: 3754 on topic Location: Boston, USA

 |
Posted: Thu, 5. Jul 12, 08:37 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
kurush
 
Joined: 07 Nov 2005 Posts: 3856 on topic

|
Posted: Thu, 5. Jul 12, 08:42 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
DrBullwinkle

Joined: 17 Dec 2011 Posts: 3754 on topic Location: Boston, USA

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
Cycrow Moderator (Script&Mod)


Joined: 15 Nov 2004 Posts: 19893 on topic Location: London

|
Posted: Thu, 5. Jul 12, 10:06 Post subject: |
|
|
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 |
|
|
|
 |
|
|
|
|
|
Charon_A

Joined: 06 Nov 2002
Location: Argon Prime
|
Posted: Thu, 5. Jul 12, 10:38 Post subject: |
|
|
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
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 |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 13376 on topic Location: Mapping beyond the Unknown Regions.

|
Posted: Thu, 5. Jul 12, 13:46 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
DrBullwinkle

Joined: 17 Dec 2011 Posts: 3754 on topic Location: Boston, USA

|
|
|
|
|
|
|
Back to top |
|
|
|
 |
|
|
|
|
|
kurush
 
Joined: 07 Nov 2005 Posts: 3856 on topic

|
Posted: Thu, 5. Jul 12, 18:25 Post subject: |
|
|
| 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 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 |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 13376 on topic Location: Mapping beyond the Unknown Regions.

|
Posted: Fri, 6. Jul 12, 01:55 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
kurush
 
Joined: 07 Nov 2005 Posts: 3856 on topic

|
Posted: Fri, 6. Jul 12, 03:43 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 13376 on topic Location: Mapping beyond the Unknown Regions.

|
Posted: Fri, 6. Jul 12, 03:50 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
kurush
 
Joined: 07 Nov 2005 Posts: 3856 on topic

|
Posted: Fri, 6. Jul 12, 08:22 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
apricotslice
Joined: 16 May 2004 Posts: 13376 on topic Location: Mapping beyond the Unknown Regions.

|
Posted: Fri, 6. Jul 12, 08:35 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
Cycrow Moderator (Script&Mod)


Joined: 15 Nov 2004 Posts: 19893 on topic Location: London

|
Posted: Sun, 8. Jul 12, 20:07 Post subject: |
|
|
| 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 |
|
|
|
 |
|
|
|
|
|
|
|
 |
|
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
|
 |
|
|
|
|
|