X4: Foundations

X4: Foundations

SirNukes Hotkey Collection
47 Comments
GameBurrow Jun 2, 2024 @ 6:07am 
So it seems this is finally broken with 7.00 update. Either it prevents editing any hotkeys at all or just doesn't add new ones.
Omega Jul 19, 2023 @ 12:22pm 
Ill delete this if asked. But I fixed the zoom by making it a toggle per zoom level and making the levels 1/2/5.

{LINK REMOVED}

A core issue was that the zoom level of 4 was resulting in a fov of 0.25, which was then rounded to 0.2 or 0.3. Somehow how that resulted in the return/original zoom not being 1.
Darth Ginger May 30, 2023 @ 11:15am 
any potential to see a hotkey for "claim" on abandoned ships? I have been trying to figure it out myself but brain no worky at the moment with 2 small kids
Godis May 14, 2023 @ 3:30pm 
To avoid confusion: This works totally fine on every version of the game!
If it doesn't for you, for example make sure to add the server eexe to your security software's whitelist, so it's not blocked or affected by some sort of auto-containment. Also sometimes you need to run it as admin. Check the extension options -> Named Pipes API to see if it works.
Waterborne Apr 22, 2023 @ 9:52am 
Any alternatives?
SCARRIOR Mar 28, 2023 @ 8:30pm 
This mod does not work unfortunately. It seems like it's use would be very well deserved in my game
SirNukes  [author] Sep 20, 2022 @ 11:41pm 
Yes, it is safe to remove this mod.
PapaTango Sep 15, 2022 @ 6:14am 
Saved me a lot of time for the Yaki Amplifier mission, which I completed with the Laser Tower tactic, thank you for this.

2 things though:
- Is it safe to remove during playthrough?
- I believe there is a way to have the Py server launched when the game starts, possibly with some arguments in the Steam properties of the game, mind in giving the details in the description? (On the API's page that is, here is a technique, https://www.reddit.com/r/Steam/comments/enrddy/is_there_any_way_to_launch_another_program/)

Cheers!
Insigar Kayen Jul 11, 2021 @ 9:22am 
Ok, had the random idea of creating a new local user and testing it there. And for some reason it works perfectly. Don't know what happened, don't know how I messed up the previous user account but it definitely wasn't the pipe server's fault. Thanks for your time and sorry for causing the problem in the first place :D
SirNukes  [author] Jul 10, 2021 @ 10:21pm 
If the pipe connected but keys dont work, try running the pipe server as admin. If X4 is running as an elevated process for you, and the pipe server is not elevated, then it won't be able to listen to X4 key presses (due to windows security stuff).
Insigar Kayen Jul 10, 2021 @ 4:58pm 
Just gonna put this here in case it helps. So in the Pipe.py if perms_set = False it connects to the client but the hotkeys don't work. If perms_set = True it doesn't connect.
Insigar Kayen Jul 8, 2021 @ 3:49am 
Might take a while but I'll try. Thanks
SirNukes  [author] Jul 7, 2021 @ 12:03pm 
Well, I can't effectively debug an issue like this remotely. You are welcome to set up python, run the pipe server source directly, and play around with the account permissions code to figure out whats going on.
Insigar Kayen Jul 7, 2021 @ 4:42am 
Unfortunately nothing changed.
SirNukes  [author] Jul 6, 2021 @ 11:08pm 
That suggests the account name lookup failed for some reason. 1.4.2 might help.
Insigar Kayen Jul 6, 2021 @ 5:43am 
All it says is "Setting pipe read/write permission for account".
SirNukes  [author] Jul 5, 2021 @ 5:20pm 
Someone else had a similar permissions error a couple months ago, but I never heard back if they found a fix. Pipe server 1.4.1 has a "-v" command line arg you can add which will print the status of its attempts to give pipe read/write perms to your windows account.
Insigar Kayen Jul 3, 2021 @ 1:24pm 
I downloaded the pipe server 1.4, started it, started X4, loaded my save but in the extensions options menu it says the apis are disconnected. Cheked the debug log and there was this line:

x4_python_host; winpipe.open_pipe error reason: access denied by OS

Any ideas?
scav Jun 29, 2021 @ 2:15am 
Sir, we need a hotkey to access ship behaviour tab, please.
Trajan von Olb Apr 22, 2021 @ 3:17pm 
thx
SirNukes  [author] Apr 21, 2021 @ 9:47pm 
The latest mod api update should address the problem.
Trajan von Olb Apr 21, 2021 @ 2:23pm 
Ok, now I know more. It's not the zoom function. My zoom key was the "Z" on a German keyboard. I assigned another key, the "P", as a test and now it works without problems. However, reassigning the "Z" was again not functional.
Your hint about the English keyboard prompted me to experiment with the Z and Y keys, which are reversed on German keyboards. And YES, there is a problem: Obviously, the keystroke is interpreted differently in the keyboard settings than in the game. Because:
If I set Z there (German keyboard, Z pressed between T and U), then "Z" is also displayed there. But the game does not react to Z. But it does react to Y (to the left of X). This is doubly problematic because, for example, Y was already occupied in my case, but this is not immediately noticeable... By the way, it was exactly the same the other way round, if I press "Y" in the settings, then Y is also displayed there, but the game reacts to Z.
Hope this helps...

Greetings Trajan
SirNukes  [author] Apr 19, 2021 @ 1:45pm 
There were changes in the key detection backend to work around some issues with detecting non-alphanumeric keys, but that was only tested on a 102-key english keyboard, and could have a mistake somewhere. Which key are you using for zoom?
Trajan von Olb Apr 19, 2021 @ 12:37pm 
Thanks for the answer... "<fov>10.0</fov>" This entry?
Unfortunately, it's already set to 10, so is there any point in changing it? And what else can I do?

Greetings Trajan from Olb
SirNukes  [author] Apr 18, 2021 @ 5:13pm 
Go to the x4 documents folder, find config.xml, and check the fov entry. If that is 0, change it to something larger like 10.0. X4 has oddities with fov settings, where it sometimes recalibrates how the fov value (in config) maps to the actual camera angle. (This is why I won't release a general FoV slider mod, and why the hotkey is limited to 2x and 4x zoom, since only those multipliers can be reversed without always drifting.) Sometimes the recalibration happens when using the hotkey zoom, and eventually the fov number can drift down to 0 and the zoom function will stop working. I am not sure on the reason, but I suspect it drifts when changing the camera viewpoint when still zoomed in, or else when closing the game while zoomed.
Trajan von Olb Apr 18, 2021 @ 1:39pm 
Hi, as always first: MANY THANKS for the MOD, especially the hotkeys.
The problem: A few days ago, the zoom worked perfectly. I really got used to it, very nice!
Then suddenly - probably after the last update - nothing works anymore. The hotkey is set (I also deleted it for testing and assigned a new one), pipe and hotkeys are green, but the zoom just doesn't work any more, NOTHING happens when the key is pressed. Any ideas? Thank you. Trajan von Olb

Translated with www.DeepL.com/Translator (free version)
Arcimbaldo Mar 25, 2021 @ 7:01pm 
Aha. Tried running it in administrator mode and it seems to be working now. Thanks!
SirNukes  [author] Mar 24, 2021 @ 4:35pm 
If X4 is run with admin rights and the pipe server is not, that may also prevent it from seeing key presses. You could also try editing the python_send_keys.txt file, line 66, changing verbosity from 1 to 2. That will make it print all key presses seen, not just when they match an x4 hotkey.
Arcimbaldo Mar 24, 2021 @ 5:43am 
Yeah, it does say "Starting/Stopped keyboard listener" every time I alt tab back and forth from X4. And no, nothing unusual with my keyboard setup that I'm aware of.
SirNukes  [author] Mar 23, 2021 @ 8:45pm 
Does the exe output have a "Starting keyboard listener" message? It is set to only listen to key presses while a window titled "X4" has focus, as reported by Windows, and will print the above message when seeing X4 gain (or already have) focus. Otherwise, is there anything unusual with the keyboard setup, eg. using other key remapping software?
Arcimbaldo Mar 22, 2021 @ 2:35pm 
Having some difficulty getting this working.

have got the Pipe Server running now and the menu showing up in-game (the documentation could have been clearer - it's very simple to set up, but not signposted very well), and i can now set the new keys in the menu, but pressing them doesn't seem to do anything.

the python exe log updates when I set the hotkey, but there's no evidence it's even registering the hotkey subsequently being pressed
Trajan von Olb Mar 6, 2021 @ 5:21pm 
(Continuation of the previous post):

Specifically, it's about the following:
- Hotkeys for better target switching, e.g. direct switching of own carriers in the sector, of enemy capital ships and fighters (separately), switching of enemy missiles, the next goods flying around, jump gates, factories, etc. (there was once a MOD for X3 by X3-Freak-Cartman) Only: How can I actually unlock any target via mod? Do I have to use Lua or is it possible via in-game commands?
- Hotkeys for the fleet attack (wingman), attack first, retreat and land on your own carrier (player ship) or something like that.
- Direct access to various menu items on the map (with a check to see if the menu is already open, so you don't close it by mistake)
- Opening the map with your own ship selected

So, do you have ANY ideas? Feel free to choose something, I have to start somewhere...

Greetings Trajan
Trajan von Olb Mar 6, 2021 @ 5:20pm 
Hey SirNukes,

first of all, THANK YOU for this great opportunity with the hotkeys. Unfortunately, it seems that the project has not been expanded for almost a year. But I think it could really be interesting for many!
That's why I wanted to get involved with my own MOD, which, as a larger project, provides several sections of the game with hotkeys and thereby increases the functionality. Or help you to integrate this into your mod. However, I don't get any support in the English forum, which is why I'm asking you here if you could help me with possible solutions (or even know people who have already worked on this).

(To be continued in the next post because of the character limit).
TSM [EGC] Jun 20, 2020 @ 7:04am 
very useful indeed is it possible to bind Eject/spacesuit ?
Liability May 17, 2020 @ 2:49am 
I'm somewhat amazed these hotkeys didn't make it into Vanilla
SirNukes  [author] May 17, 2020 @ 1:28am 
@Mycu Unfortunately I didn't see any errors related to my stuff in there. In the extension options menu (should be available with the mod support apis), there are toggles for extra pipe and hotkey debug messages. (If the "extension options" is missing, the problem is with the apis.) Turning those on and doing a /reloadai in the chat window should give more details. feel free to hop on the egosoft discord for easier conversation.
Mycu May 17, 2020 @ 12:46am 
@SirNukes, thanks for your answer.
Waited 10 minutes, tried starting Pipe Server before X4 loads, tried starting with X4 loaded, tried with exe in game executable folder - all of that without any luck.
So I started game with log enabled (also enabled writing to log from hotkeys) and left game for few minutes.
Generated log is quite big (~2MB) - but most of errors came from mod's singature problems.
https://filebin.net/2rdprkmx1bm0ruc4/x4.log?t=va8vfyjm
SirNukes  [author] May 16, 2020 @ 7:02pm 
It is odd that the server location matters; it should be able to connect to x4 from anywhere. but glad it's working.
Dreadarm May 16, 2020 @ 7:00pm 
@SirNukes I have solved the issue. I placed the pipe server.exe into my X4 main directory and now it works just fine.

@Mycu try this!
Dreadarm May 16, 2020 @ 6:54pm 
@SirNukes I installed Python 3.8 and tried to run your .py init and main file and I get this

File "c:\...\sn_x4_python_pipe_server_py\__init__.py", line 22, in <module>
from .Classes import Pipe_Server, Pipe_Client
ImportError: attempted relative import with no known parent package
Dreadarm May 16, 2020 @ 6:37pm 
@SirNukes I suppose I should give more info. I am using the EXE rather than the .py as I didn't want to install python for windows. I also tried disabling windows firewall and Malwarebytes, the only two antivirus that I run. I even, for the sake of argument, changed my wifi from pub to private.
Dreadarm May 16, 2020 @ 6:29pm 
@SirNukes I have the same issue. Everything is running but it is not connecting.
SirNukes  [author] May 16, 2020 @ 1:58pm 
Mycu, it may take a moment for the server to connect if you loaded the save before starting the server (the x4-side extension checks every 10 seconds), and you may need to be unpaused (sometimes x4 stops calling update scripts during a pause). the hotkey menu updates once a connection is made. if there is some other problem, I would have to see the x4 debug log to figure it out.
Mycu May 16, 2020 @ 2:49am 
I'm stating Python Pipe Server ( https://i.imgur.com/UVO5jNv.png ) , running X4 - but no hotkeys section appears in game controls menu.
Named Pipes API in game shows disconnected in x4_keys and x4_python_host sections: https://i.imgur.com/EnUyZB3.png

Is there anything else to do to make it working?
Dreadarm Apr 22, 2020 @ 6:48pm 
Is there any way you could look at adding hotkeys for wing commands, Attack, defend, docked, launched ect.
SirNukes  [author] Apr 6, 2020 @ 10:04am 
Yes, would need the pipe host program running (link over in the api extension description).
Mo¡stDreams Apr 6, 2020 @ 4:10am 
This is cool man
So I just need to setup and run Python server as a system enviorment to get this working right and use your API support mod.