[SCRIPT] Player Workshops V2.0 [28.07.2009]

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

NovaStark
Posts: 12
Joined: Tue, 5. Jun 12, 03:47
x3tc

Post by NovaStark »

ohhhhhh... I had forgotten about this little beauty of a script. Equipping new ships with tunings and software is the bane of my existence. So setting this up asap.

@Andyrids I'm not a scripting wiz when it comes to X3 but if you have it working on existing ships than maybe what is missing is a variable being set on new ships? As in there's a script that runs in the background searching for new player ships at a certain interval (or uses an event/callback) to set this variable based on the criteria you've been modifying?

Anyhow this is just a guess as it would seem simple to check for a variable as each ship docked rather than run it against an array of allowed ships at every single docking.

To put it simply check once and never again. Ships don't usually change classes once created :P

*edit*
@jiunejai - Thanks for posting your changes! Saved me some time and headache. Just made them myself and it seems to work beautifully. Just a note to anyone else you may have to save/quit/reload to get everything in sync. Before I did I was able to add Mars to a install set but adding the set didn't install Mars and Mars didn't show up in the regular equipment list.

*edit2*
Andyrids wrote:Still struggling to get this to work properly, I have been studying <sval> types and values in other scripts that deal with player ships and see similarities but blindly changing the values as one would expect has random catastrophic results at times...

A few pointers / help would be much appreciated guys please :)
I'm not sure what file you were looking in or what exactly you're trying to accomplish. I didn't see anything that would block the use of the workshop command on any class of ship. The only thing I can figure is that your trying to get the auto equip to work with a certain class?

/shrug. If this is still something you're trying to do I could look at it more, but I kinda doubt it considering the age of your post.

Is the Hyperion even in X3TC?
Andyrids
Posts: 248
Joined: Sat, 16. Aug 08, 19:45
x3tc

Post by Andyrids »

Hi NovaStark.... Yes the Hyperion is in TC and the plan was to get this script to work with that ship and also the Griffin... But since I could only get it working with existing ships I decided to delete my version of the script, revert back to the original one and just change ship class to M2 for those two ships...

But you are correct it is just some variable / flag that I am missing upon a new ship of the above mentioned spawning.
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Andyrids wrote:But you are correct it is just some variable / flag that I am missing upon a new ship of the above mentioned spawning.
After three months... are you *still* trying to edit scripts without using the Script Editor or Exscriptor?

That's like spitting into the wind. ;)
Andyrids
Posts: 248
Joined: Sat, 16. Aug 08, 19:45
x3tc

Post by Andyrids »

DrBullwinkle wrote:
Andyrids wrote:But you are correct it is just some variable / flag that I am missing upon a new ship of the above mentioned spawning.
After three months... are you *still* trying to edit scripts without using the Script Editor or Exscriptor?

That's like spitting into the wind. ;)
With all due respect DrB I do not have the time to learn complex editors especially for what would appear to be quite a simple task... Obviously a task that my mind is to "simple" to complete successfully...

Just as a side note I spent many years building and helping others build UI's for a game called Everquest and do believe even after all this time mine are still in the top 10 most downloaded and used, probably updated now by some of the guys I taught in the past... I have no desire to take that path / steep learning curve again and rather hoped for the good nature of some members here to give me a pointer as to where my mistake lies.... or maybe that was my mistake ? :roll:
User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 25130
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus »

I have no desire to take that path / steep learning curve again and rather hoped for the good nature of some members here to give me a pointer as to where my mistake lies.... or maybe that was my mistake ?
Well, your mistake is that you want to directly edit the script file and the helpful pointer by DrBullwinkle is to use one of the editors.

The Script Editor is even built into the game, so you don't have to download anything. It just needs to be activated.
The Script Editor is designed that way that commands have clear names, often saying what they do, and clear input fields, which can be selected with the mouse and/or arrow keys and Enter.

I would never suggest editing the script files directly in a text/xml-editor to anyone, be it a beginner in MSCI scripting or an experienced scripter.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Andyrids
Posts: 248
Joined: Sat, 16. Aug 08, 19:45
x3tc

Post by Andyrids »

X2-Illuminatus wrote:
I have no desire to take that path / steep learning curve again and rather hoped for the good nature of some members here to give me a pointer as to where my mistake lies.... or maybe that was my mistake ?
Well, your mistake is that you want to directly edit the script file and the helpful pointer by DrBullwinkle is to use one of the editors.

The Script Editor is even built into the game, so you don't have to download anything. It just needs to be activated.
The Script Editor is designed that way that commands have clear names, often saying what they do, and clear input fields, which can be selected with the mouse and/or arrow keys and Enter.

I would never suggest editing the script files directly in a text/xml-editor to anyone, be it a beginner in MSCI scripting or an experienced scripter.
Again with all due respect... Im old school and do not need a script editor notepad2 works just fine.... so to an extent this is just a simple scripting problem.. and as I have stated I do not wish to get into hours of learning just for the sake of a simple mod to an existing mod ? (yes yes yes I know about file types and conversions and how they get messed up and whatever and know the work arounds)

Its quite simple really all I am asking for is with help with the script itself and flags whatever blah blah... I guess I have done most of it.. but since its such a big problem I also guess you rocket scientists do not know how to do it either.. that makes me feel good Im not such a dumass after all...

Its ok guys just go back to whatever it is that you do best and I wish you all well forget my silly problem :)
User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 25130
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus »

It somehow amuses me that someone, who built UIs himself, refuses to use one with the explanation that using it would require "hours of learning". But hey, it's your decision. If you want to take the hardest way, feel free to do so. But then, please don't complain that it's difficult or that no one wants to help you.

Anyway, being a rocket scientist myself - thanks for noticing it - I was able to complete this task (allowing M6 ships to be used with this script) by simply doing, what you did, just in the Script Editor.

In case you're still interested in it: Download of plugin.pelador.player.dock.chk.xml over file-upload.net. Download and copy it to the "scripts"-folder of your game directory, so it replaces the existing file. Start the game/load a save and "Allow workshops to be used on ships" in the config menu.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
Andyrids
Posts: 248
Joined: Sat, 16. Aug 08, 19:45
x3tc

Post by Andyrids »

X2-Illuminatus wrote:It somehow amuses me that someone, who built UIs himself, refuses to use one with the explanation that using it would require "hours of learning".

Anyway, being a rocket scientist myself - thanks for noticing it -
My old on-line name is Laffs ... anyway yes they are very complicated as you stated you find it funny that's kool ....

Besides you made me the script anyway ! a bit of reverse psychology does work at times :) ... Thank you so much for doing so, Much appreciated :)
NovaStark
Posts: 12
Joined: Tue, 5. Jun 12, 03:47
x3tc

Post by NovaStark »

Well, I can kinda understand where he's coming from a bit. When it comes to editing traditional code/html/etc I too prefer to use a text editor (like notepad++). But seeing as X3 has it's own scripting language and encodes the resulting files as XML it's much easier imo to just use the builtin editor.

Maybe if I was *very* familiar with all the commands and syntax I would use a text editor too, but as I'm a noob I wouldn't dare. Besides, even when coding in a traditional language it's sometimes nice to jump into an IDE to handle large projects or debugging. I guess it boils down to choosing the right tool for the job really.
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

NovaStark wrote:Maybe if I was *very* familiar with all the commands and syntax I would use a text editor too
No, no, no.

It has nothing to do with your experience with other editors. X3 uses xml like a database; it stores ID's rather than text strings. The readable text in scripts is just comments -- it is not the actual code. The real code is numeric ID's, which are, more or less, not human readable.

It is not a matter of which editor you prefer, as in other languages. You really must use an editor made for the job (if you want your scripts to work).

Otherwise, you are just spitting into the wind. ;)
NovaStark
Posts: 12
Joined: Tue, 5. Jun 12, 03:47
x3tc

Post by NovaStark »

Ah, my bad. I honestly had never looked at the xml itself very hard. I suppose it is a lot easier to read in the id's than parse a bunch of text. ;) I've done enough of that to last a life time when trying to convert third party data into your own system. Even if there is documentation to the format there's invariably differences in the actual implementation that you just have to account for through trial and error. Industry specific file formats... bleh.. talk about haphazard hacks with no consistency.
Andyrids
Posts: 248
Joined: Sat, 16. Aug 08, 19:45
x3tc

Post by Andyrids »

DrBullwinkle wrote:
NovaStark wrote:Maybe if I was *very* familiar with all the commands and syntax I would use a text editor too
No, no, no.

It has nothing to do with your experience with other editors. X3 uses xml like a database; it stores ID's rather than text strings. The readable text in scripts is just comments -- it is not the actual code. The real code is numeric ID's, which are, more or less, not human readable.

It is not a matter of which editor you prefer, as in other languages. You really must use an editor made for the job (if you want your scripts to work).

Otherwise, you are just spitting into the wind. ;)
Now that was useful info and interesting to know :) ... XML is a very flexible programming lang and can be built to your own needs its much like the old "Forth" in a way where you used to build routines and then break them down into a single command... anyway thank you guys for the help and advice no disrespect meant :)
User avatar
Nibel
Posts: 208
Joined: Sat, 29. Apr 06, 16:53
x3ap

Post by Nibel »

any problems with AP ?
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Nibel wrote:any problems with AP ?
OK, that's at least three. ;)

You can stop asking the question, Nibel. The answer is always going to be: "scripts for TC work fine for AP, unless otherwise noted."

Mods are more variable but most of those, too, are clearly marked if they do not work in AP.
User avatar
Nibel
Posts: 208
Joined: Sat, 29. Apr 06, 16:53
x3ap

Post by Nibel »

DrBullwinkle wrote:
Nibel wrote:any problems with AP ?
OK, that's at least three. ;)

You can stop asking the question, Nibel. The answer is always going to be: "scripts for TC work fine for AP, unless otherwise noted."

Mods are more variable but most of those, too, are clearly marked if they do not work in AP.
some mods so old,that they are were created b4 univerese was in god's plan,so there is a chance,that author/mods didn't stated,that this mod not working or working properly,plus i've noticed,that some users report problems(example:not all hotkeys are working) with mods,so asking same question for each mod is normal.
i better be sure than sorry.
Koritnaciino
Posts: 319
Joined: Sun, 26. Feb 06, 10:57
x4

Post by Koritnaciino »

After instalation in AP first save and next load I missing ships in 2 shypyards.
Informations about products still there but if I click trade with shipyard inc emptu list. I have Xtra ship pack instaled and problem is exactly with 2 of them. Teladi and Boron. I goiing uninstal and will see.
Edit: after uninstalation everything ok so probably not working well with AP or with Xtra.
User avatar
Yacek
Posts: 3157
Joined: Wed, 18. Jul 07, 11:44
x3tc

Post by Yacek »

Koritnaciino wrote:After instalation in AP first save and next load I missing ships in 2 shypyards.
Informations about products still there but if I click trade with shipyard inc emptu list. I have Xtra ship pack instaled and problem is exactly with 2 of them. Teladi and Boron. I goiing uninstal and will see.
Edit: after uninstalation everything ok so probably not working well with AP or with Xtra.
I've never had problems with this script.
X3:AP 3.1+XRM 1.30d+MSP 1.7+LoCo 2.01+IR 2.0
Zapraszamy wszystkich chętnych na forum XUDB, gdzie znajdziesz FAQ, opisy skryptów, modów i fabuł, oraz Mamut HQ.
[ external image ]
Koritnaciino
Posts: 319
Joined: Sun, 26. Feb 06, 10:57
x4

Post by Koritnaciino »

I not going say that because of script. I have around 10 addons instaled so can be combinations or something. Also I tryied with save game not with new start.
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

It's probably something else, Koritnaciino.
krowser07
Posts: 3
Joined: Wed, 1. Oct 14, 10:19

Post by krowser07 »

hey i installed this and set a hotkey for the config menu. everything seems to be working fine but for some reason i dont see any option to buy ship upgrades. im using phq. any ideas ?

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”