[Script Question] .xml or .pck?

The place to discuss scripting and game modifications for X³: Reunion.

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

(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

[Script Question] .xml or .pck?

Post by (----____JEFF____----) »

Well I've written a script, a few edits of standard scripts. Now they are normally .pck files in the scripts folder, so I unpacked them to .xml
My question is if someone would install the .xml files would X3 use them or the old .pck files? Or do I have to pack my script files and overwrite the old files?
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

generally, its better to use xml files.

if thefile your editing was an existing pck file, then its best to use a pck file.

the game favours pck files over xml files. So if a pck existis then that will take priority
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

pcks have a higher priority than xmls so you have to pack them to the pck-format or as alternative you can 'replace' them with another method
(for example changing the default behavior of the AI-Ships to your new Scripts, which have another name than the EGO-Scripts and/or change the Script assigned to the Command Slots)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) »

Alright thanks Cycrow and Unitrader. Is there a way to reassign a command slot then? without causing a conflict? I always thought that I could only add more commands, not replace ones taken already?
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

You can change the allocation of a command slot - even on the fly in game.

Apparently you can not remove/overwrite an allocated command button checkscript but few use these. (or know what that is =)

Your "regular" setup runs after the ES scripts so if you reallocate the command slot to your script, you effectively replace the ES command without overwriting the files.

Flat out overwriting ES scripts is usually a bad idea because many other scripts call these and wouldn't know what to do with your changed version.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

addition to Gazz: you have to make sure that the Scripts which are re-assigning the Command slots are executed after the other Setup-Scripts, not before... one idea is to make an al.plugin because this Script type is executed after the normal setups
or you use a normal Setup, start a new Global Script there which contains a wait of eg. 10 seconds and then re-assigns the Command-Slots ;) (no re-assingnmant of the slots in the setup itself)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) »

Thank again ;) UniTrader why do I have to reassign outside the setup script? I can just wait and after that assign the slots?
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader »

no, the START of another script is unavoidable because the setup-scripts are executed in serial, so when you have a wait in a setup-script the following setups are executed after this setup is finished.. (thats the reason for not using waits in setups - it is simply a bad idea ;) and infinite loops even with a wait in a setup are even worse...)

PS the small text has nothing to do with the Topic itself..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
(----____JEFF____----)
Posts: 269
Joined: Sat, 20. May 06, 14:55
x3tc

Post by (----____JEFF____----) »

I understand it then ;) Learned a lot here about the setups of scripts and other stuff Thanks everyone :D
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

UniTrader wrote:no, the START of another script is unavoidable because the setup-scripts are executed in serial, so when you have a wait in a setup-script the following setups are executed after this setup is finished.. (thats the reason for not using waits in setups - it is simply a bad idea ;) and infinite loops even with a wait in a setup are even worse...)
I have several setup scripts that run about 1-3 sec after all other setups are finished.
Basically the setup script is STARTing itself like a library.
Easy to tell in the script because then it's started with an argument...
It's a bit of a whacky concept but works like a charm.

That way *I* avoid most conflict issues. Dunno about other scripts. =P

That's very useful for starting a new game with mods.
Apparently there are timing issues with referencing mod data before it is "in the game".
If I delay the setup a bit, all the modded objects can "settle" in the game and can be referenced without a problem.

I never found out why... but it works. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Return to “X³: Reunion - Scripts and Modding”