[Question] Is it possible to alter stats depending on crew skill?

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

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

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

[Question] Is it possible to alter stats depending on crew skill?

Post by Max Bain »

I would like to know, if it would be possible to make for example ship hull depending on crew level. So for example +10% ship hull per star of the crew in engineering. And piloting skill would increase top speed and acceleration by +10%.
If yes, can someone please give me an example how it could be done?
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [Question] Is it possible to alter stats depending on crew skill?

Post by BlackRain »

Max Bain wrote: Thu, 4. Mar 21, 23:17 I would like to know, if it would be possible to make for example ship hull depending on crew level. So for example +10% ship hull per star of the crew in engineering. And piloting skill would increase top speed and acceleration by +10%.
If yes, can someone please give me an example how it could be done?
Hull, speed, and such are all defined in assets. I do not think it would be possible to alter the maximum more than what is defined in assets. However, I have another idea for you. It might be possible to limit it below the maximum. As in, you might be able to keep it below the maximum dependent on skill level. You could change the values in assets to a bit higher than what they are and then limit it below that through code maybe. I remember there is a mod that has hull be repaired based on engineering skill level and such. So, it could work something like that, except it would keep it at a certain hull level. Basically you would be lowering the hull with a script to a certain percentage of the max. Even when repairing, the script could lower it back again, but this would be a bit of an annoyance as it would mess with repair costs but maybe that is fine. As for speed, again you might be able to limit the speed and acceleration but I don't see being able to use code to go over what is defined in assets. This is just some thoughts of mine, not sure if it would work.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [Question] Is it possible to alter stats depending on crew skill?

Post by Max Bain »

BlackRain wrote: Thu, 4. Mar 21, 23:23
Max Bain wrote: Thu, 4. Mar 21, 23:17 I would like to know, if it would be possible to make for example ship hull depending on crew level. So for example +10% ship hull per star of the crew in engineering. And piloting skill would increase top speed and acceleration by +10%.
If yes, can someone please give me an example how it could be done?
Hull, speed, and such are all defined in assets. I do not think it would be possible to alter the maximum more than what is defined in assets. However, I have another idea for you. It might be possible to limit it below the maximum. As in, you might be able to keep it below the maximum dependent on skill level. You could change the values in assets to a bit higher than what they are and then limit it below that through code maybe. I remember there is a mod that has hull be repaired based on engineering skill level and such. So, it could work something like that, except it would keep it at a certain hull level. Basically you would be lowering the hull with a script to a certain percentage of the max. Even when repairing, the script could lower it back again, but this would be a bit of an annoyance as it would mess with repair costs but maybe that is fine. As for speed, again you might be able to limit the speed and acceleration but I don't see being able to use code to go over what is defined in assets. This is just some thoughts of mine, not sure if it would work.
But there are modules that increase ship hull and speed and all other values by ship modifications. These values are totally random, so I am sure it is possible, maybe not for modders but hardcoded, but thats what I want to know and if possible, how :).

I have an idea: If a certain crew level is reached, I could add a ship modification to the ship. But the problem here is that it needs to be treated different to the standard ship mod, so for example it must not be removable and you still must be able to put a real modification to the ship. Anyone has an idea how to do this? :)
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7465
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [Question] Is it possible to alter stats depending on crew skill?

Post by BlackRain »

Max Bain wrote: Fri, 5. Mar 21, 09:19
BlackRain wrote: Thu, 4. Mar 21, 23:23
Max Bain wrote: Thu, 4. Mar 21, 23:17 I would like to know, if it would be possible to make for example ship hull depending on crew level. So for example +10% ship hull per star of the crew in engineering. And piloting skill would increase top speed and acceleration by +10%.
If yes, can someone please give me an example how it could be done?
Hull, speed, and such are all defined in assets. I do not think it would be possible to alter the maximum more than what is defined in assets. However, I have another idea for you. It might be possible to limit it below the maximum. As in, you might be able to keep it below the maximum dependent on skill level. You could change the values in assets to a bit higher than what they are and then limit it below that through code maybe. I remember there is a mod that has hull be repaired based on engineering skill level and such. So, it could work something like that, except it would keep it at a certain hull level. Basically you would be lowering the hull with a script to a certain percentage of the max. Even when repairing, the script could lower it back again, but this would be a bit of an annoyance as it would mess with repair costs but maybe that is fine. As for speed, again you might be able to limit the speed and acceleration but I don't see being able to use code to go over what is defined in assets. This is just some thoughts of mine, not sure if it would work.
But there are modules that increase ship hull and speed and all other values by ship modifications. These values are totally random, so I am sure it is possible, maybe not for modders but hardcoded, but thats what I want to know and if possible, how :).

I have an idea: If a certain crew level is reached, I could add a ship modification to the ship. But the problem here is that it needs to be treated different to the standard ship mod, so for example it must not be removable and you still must be able to put a real modification to the ship. Anyone has an idea how to do this? :)
I don't know much about the ship mods honestly because I never craft ship mods and attach them to my ships. Haven't looked into them, are they also assets or what?
kuertee
EGOSOFT
EGOSOFT
Posts: 818
Joined: Sun, 14. Dec 03, 13:05
x4

Re: [Question] Is it possible to alter stats depending on crew skill?

Post by kuertee »

via ship mods is a plan of mine to affect ship modifications for my ship proficiencies portion of my mod Professions: viewtopic.php?f=181&t=432264.
additionally, the specific mods are removed every time you look at it via the equipment dock menu.
then the mods are reinstalled.
but I've not got to that part yet.

Return to “X4: Foundations - Scripts and Modding”