Creating a "Default Behavior" script

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

wwf4668
Posts: 23
Joined: Sat, 27. Mar 04, 18:48
x2

Creating a "Default Behavior" script

Post by wwf4668 »

Hi, did some working scripts back then in X3, but fail with X4 so far. So I asked chatgpt for help.

I want to create a new "default Behaviour" command. Chatgpt came - after some discussion - up with this structure:
extensions\mod_dir\content.xml
extensions\mod_dir\scripts\doesstuff.lua
extensions\mod_dir\ui\addons\commands.xml
extensions\mod_dir\ui\addons\defaultbehaviours.xml
extensions\mod_dir\ui\addons\orders.xml

The script that actually does things is the .lua file. The others are mostly repetitive for the definition of the command.
The extension now shows up in the settings menu in game, but I do not see any new default command. I also don't see any errors or printouts from the script in the logfiles.
My question is:
Is this structure in principle the correct way to go? Can somebody point me to some forum or tutorials, where I could get more detailed help?

Thanks a lot for any hints!!
DeadAirRT
Posts: 1124
Joined: Fri, 25. Jan 19, 03:26
x4

Re: Creating a "Default Behavior" script

Post by DeadAirRT »

Recommendation is to not use chatgpt and look in the folders after you extract the files.
wwf4668
Posts: 23
Joined: Sat, 27. Mar 04, 18:48
x2

Re: Creating a "Default Behavior" script

Post by wwf4668 »

DeadAirRT wrote: Sun, 23. Feb 25, 02:32 Recommendation is to not use chatgpt and look in the folders after you extract the files.
Hmm, that's a pity. For other language coding chatgpt is quite helpful. So looking through the folders now. Had a look at about 20 xml-files not finding what I'm looking for, so only another 5340 and a couple of lua files to go. scriptproperties.html also does not seem to run in any current browser. But thanks for taking the time to reply.

Does anybody know which files handle global alerts?

Return to “X4: Foundations - Scripts and Modding”