Marine Repairs and Training [TC][AP][ALP]

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

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

Post Reply
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 14. Oct 12, 07:11

JoelR wrote:If I leave this line as "no" will it consume the hull plating/microchips as well as credits?

Code: Select all

<!-- Consume resources ONLY (do not use cash). Default = no. -->
Yes. It will always consume Microchips and/or Hull Plating, if they are available.

Therefore, if you are transporting valuable Microchips in your TL with marines on board, then try not to take any hull damage, because the marines will raid your cargo bay before they spend your money.

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Sun, 14. Oct 12, 07:20

Excellent. Thanks. This is exactly what ive been looking for for a long time.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 14. Oct 12, 23:40

.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Mon, 15. Oct 12, 08:12

Update v2.03a Bug Fix

Marine Repairs v2
[ external image ]
[ external image ]


New Features
  • :arrow: Bug Fix Fixed bug that caused repairs to be done too quickly.
    :arrow: Added Nividium If Nividium, Microchips or Hull Plating are available, then they will be consumed first; before credits. Optionally, resource-only mode (no credits) can be set in the t file.

    v2.03a (2012-10-14)
    - Turned off unnecessary debug code.

    v2.03 (2012-10-14)
    - Fixed bug that inadvertently increased repair speed.
    - Added Nividium as optional resource.
    - Added ability to modify resource values (prices) in t file.
    - Increased relative value of Hull Plating because of its large volume. Less Hull Plating; more repairs. (You can change it in the t file now).

    v2.02 (2012-10-13)
    - Added Optional resource consumption for ships. Configurable in t file. (Microchips or Hull Plating) (Troubleshooter11, JoelR)
    - Fixed bug that continued to charge for training after training was complete. (Xannn)
    - Fixed bug that prevented cost calculation from running on single ships.
    - Subtitle and tone signals player when repairs complete. (Vayde)
    - Improved training cost calculation for more accurate results.
Last edited by DrBullwinkle on Tue, 16. Oct 12, 08:12, edited 2 times in total.

Probe1
Posts: 701
Joined: Sat, 7. Jan 12, 01:37
x3ap

Post by Probe1 » Mon, 15. Oct 12, 10:09

It was glorious letting my M2s be eaten to 50% hull while it lasted.
Back to that resulting in a 30 minute repair job I guess.

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Wed, 17. Oct 12, 20:59

Drbullwinkle. It doesnt look like resources are being consumed. I just had a damaged nova raider docked at my tern and received a message that repairs were finished. I have "dont use credits" set to yes. Anyhow I had 100 microchips in the hold of my Teen and after the nova was repaired I still have 100.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Wed, 17. Oct 12, 21:14

A docked ship looks for resource both in its own cargo and in the mothership cargo. Do you have a save before the repair? Can you check to see whether the resources were consumed from the mothership?

(However, it should consume resources from the cargo hold before the mothership.)

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Wed, 17. Oct 12, 22:05

DrBullwinkle wrote:A docked ship looks for resource both in its own cargo and in the mothership cargo. Do you have a save before the repair? Can you check to see whether the resources were consumed from the mothership?

(However, it should consume resources from the cargo hold before the mothership.)
I had no resources in the ship that was being repaired. All wares were in the hold of the mothership. Nova was healed but wares were not consumed (with the no credits option active).

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Wed, 17. Oct 12, 22:19

Yeah, the marines are very gung-ho. They dive in and do the repairs, then the bookkeepers do the billing. So, even if the customer is a dead-beat, the repairs are already done.

Probably I should have the marines place a "mechanic's lien" on the ship and withhold it (at gunpoint, if necessary) until the customer pays up.

If the customer is piloting the ship, then the marines can eject him and fly off. If the customer pays before he runs out of air, then the marines can come back and pick him up. Sound good? ;)
  • Or, alternatively, maybe I can have the bookkeepers do the billing first; before doing the repairs. :)

    (And, of course, it should have consumed resources from the mothership. I will see what I can do.)

senor135
Posts: 69
Joined: Sun, 27. Nov 05, 15:53
x3

Post by senor135 » Sun, 18. Nov 12, 04:11

this might be documented somewhere in this thread that i didnt see, i skimmed through a bit.

does the marine repair rate still take into account their levels in Mechanical and Engineering like Tataku's original?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 18. Nov 12, 04:17

Yes.

Marines with higher skill levels in Mechanical and Engineering do repairs more quickly.

Marines with lesser skill levels will earn training by doing repairs. If the same marines do many repairs, then they will, over time, become faster at doing repairs.

Updated "Features" list in first post.

senor135
Posts: 69
Joined: Sun, 27. Nov 05, 15:53
x3

Post by senor135 » Sun, 18. Nov 12, 04:57

awesome! i had just started hiring some cheap, blank marines (no fighting or hacking skill) to use just as repair crew on ships. Then i realized i had better double check to see if my theory was correct haha :)

thanks for the quick reply!

EDIT: on second thought... what are the chances you would want to try and add a shield recharge for these marines, i think only when the ship is out of combat. maybe using the hacking skill for that? we could pretend it's "electronics" skill. i dont look forward to getting my first M2/M1 and having to wait up to 20 mins for shields to recharge.

and maybe as a future addition, (i think someone else suggested this already) marines could repair/replace damaged equipment on ships?
Last edited by senor135 on Sun, 18. Nov 12, 05:06, edited 1 time in total.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 18. Nov 12, 05:03

senor135 wrote:awesome! i had just started hiring some cheap, blank marines (no fighting or hacking skill) to use just as repair crew on ships.
Yes, that will work fine. They will be slower, at first, but will speed up with experience (similar to real life).



what are the chances you would want to try and add a shield recharge for these marines, i think only when the ship is out of combat.


Interesting idea, Señor. A Xenon K can take 40 minutes to fully charge its shields... that just isn't right. As you say, shield repair should happen only when there are no enemies in the sector. I will put that on the list for a future version.


and maybe as a future addition ... marines could repair/replace damaged equipment on ships?


I was thinking about that recently. Yes, it is an excellent idea. However... how will the marines know which equipment the ship previously had? And how will they know the difference between destroyed equipment and equipment that was intentionally removed?

One idea that comes to mind would be to save the equipment list every few minutes. Before doing the save, we check to see whether the list has changed from the previous list. If it has, then we let the marines repair the equipment over time.

However, if you intentionally remove equipment, then you will have to *manually* save the equipment list. That could be confusing to players who do not expect it. Or to those who forgot that they turned the feature "on" a year ago.

Also, Marine Repairs does not have a menu, so I would have to add one just for that feature. Or maybe I could update all lists when the AL Plugin is toggled Off then On again.

So... maybe. I might add that to a future version. Someday.

MAYBE. :)

In any case, thanks for the idea.

In the meantime, Upgrade Kits for TC/AP, with Equipment Packs or Player Workshops allow you to save equipment configurations for easy replacement of destroyed equipment. I use Upgrade Kits for doing field repairs, and Player Workshops to automatically check my AI ships when they dock at my PHQ.

senor135
Posts: 69
Joined: Sun, 27. Nov 05, 15:53
x3

Post by senor135 » Sun, 18. Nov 12, 08:54

i agree, the equipment repair could be tricky. i dont personally have any scripting or programming experience, but i have noticed the AI / Announcer / Narrator lady is aware of which pieces of equipment are being destroyed.

would there be a way to tell the marine repair script what equipment is destroyed by either keeping track of what components she announces (or tries to announce, as audio announcements seem to often cut each other off) or keep track of whatever trigger the game uses to determine which announcement to play in the first place?

hope i described coherently, and thanks for all the work on this script so far by the way. as the old saying goes "if you give a mouse (us) a cookie (a sweet marine repair script) he's gonna want some milk (more features)"

:D

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 18. Nov 12, 09:06

senor135 wrote:the AI / Announcer / Narrator lady is aware of which pieces of equipment are being destroyed.
Yes, Betty does announce when equipment is destroyed. However, she is an extremely busy woman, so I feel shy about asking her to keep a *list* of everything that she announces!

I do not think that she writes down a note that I can read when equipment is destroyed. I am pretty sure that she just says it and moves on (in other words, I think the call to the announcement is hardcoded, so that I cannot hook it in a script).

But thanks for the suggestion. If I figure out a good way to do it, then I might add it. In the meantime, use Upgrade Kits and/or Player Workshop.

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Sun, 18. Nov 12, 18:28

DrBullwinkle wrote:... If I figure out a good way to do it, then I might add it. In the meantime, use Upgrade Kits and/or Player Workshop.
Couldn't it be done by getting an array of all equippment installed? When a ship enters combat, this array could be constantly surveyed. When one item gets destroyed, this could be registered. Am I wrong?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 18. Nov 12, 20:46

We cannot check frequently because the player may have many ships with marines (performance concern). So how do we differentiate between "destroyed" equipment and "intentionally removed" equipment?

Also, I do not know a reliable way to detect the end of combat. SIGNAL_ATTACKED *might* work to detect the beginning of combat, although a single missile strike (or accidental collision) may not be detected in time.

So I do not see a reliable way for the script to know what equipment should be on the ship. Not without requiring the player to save updates, which could be confusing (and easy to forget).

A5PECT
Posts: 6143
Joined: Sun, 3. Sep 06, 02:31
x4

Post by A5PECT » Sun, 18. Nov 12, 20:58

DrBullwinkle wrote:So I do not see a reliable way for the script to know what equipment should be on the ship. Not without requiring the player to save updates, which could be confusing (and easy to forget).
Just spitballing here...

What if the script saves a list of all of installed equipment on a particular ship when it docks/undocks, then makes a "restoration check" against that list periodically and if it finds any missing equipment any onboard marines will restore it. That would help in terms of performance. You could limit the restoration check to when the ship lands again, to further improve performance and create a sort of balancing mechanic.

The issue of destroyed vs. ejected is still present, though. Maybe charge players the price of the ware when it's restored? That would preempt exploiting equipment repairs; you'd still get marines "restoring" ejected equipment. But it'd save players from the hassle of buying replacement parts manually.
Last edited by A5PECT on Sun, 18. Nov 12, 21:05, edited 2 times in total.
Admitting you have a problem is the first step in figuring out how to make it worse.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 18. Nov 12, 21:01

KloHunt3r wrote:The issue of destroyed vs. ejected is still present, though. Maybe charge players the price of the ware when it's restored?
Yes, that is the problem.

Price is not the important concern. The important part is that it would become impossible for the player to intentionally remove equipment.
Last edited by DrBullwinkle on Mon, 19. Nov 12, 05:20, edited 1 time in total.

senor135
Posts: 69
Joined: Sun, 27. Nov 05, 15:53
x3

Post by senor135 » Mon, 19. Nov 12, 05:16

for the purposes of shield regen, could exiting combat be triggered somehow in relation to the music change, or whatever trigger determines the music change?

or perhaps that is also hardcoded out of scripting's reach?

Post Reply

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