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

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

Post Reply
User avatar
soulmata
Posts: 154
Joined: Thu, 15. Nov 12, 10:34
x4

Post by soulmata » Wed, 21. Jun 17, 22:35

DrBullwinkle wrote:MRT should fully train the marines in the normally trainable skills, so 3x100 is expected. That is the same as an Engineering Dock.

Unless you specifically enabled Fight Training in your text file (it is "off" by default), Boot Camp will max out fight training at 40%, or two stars. To get full fight training, your marines should have to do some boarding ops.

So... are you reporting a different experience than the above?
Ah, OK, that makes sense. In that case, that is exactly what I am experiencing, and in that case is WAD. Thank you for clearing that up. Personally, I really like that, because individually training piles of marines at 10 outposts at a time is dreadfully tedious.

On a side note... repair cost can currently be offset by local resources like hull plating.

Would it be feasible to /also/ use resources in local stockpiles that you are docked to? For instance, if you are docked to a player ED that has hull plating, might the script take those resources?

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

Post by DrBullwinkle » Tue, 27. Jun 17, 13:54

Well, it is certainly possible that we could consume resources from a dock, but there is no precedent for that in the X 'verse. I suspect that what you gain in convenience might be overshadowed by what you would sacrifice in control.

A more direct way is to use a CLS2 transport (Bonus Pack) to collect resources and deliver it to your marines.

A way to streamline that effort would be to use UT's to hunt and buy resources throughout the 'verse and sell them to your mining complex (by setting the price at your complex slightly above average). Then your CLS2 pilot will have a single location from which to collect all repair resources.

User avatar
soulmata
Posts: 154
Joined: Thu, 15. Nov 12, 10:34
x4

Post by soulmata » Sun, 2. Jul 17, 22:41

Cool. Thank you for the info.

I have another question, regarding "resource only mode" - what do the values for the given resources signify? For instance, hull plating receives a value of 20kish, which in the t file is listed as coming from 4k * 5. Does that number represent hull points repaired, the equivalent credit worth, something else?

And, if I'm in resource-only mode, how that does affect marines repairing stations?

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

Post by DrBullwinkle » Mon, 3. Jul 17, 00:03

soulmata wrote:regarding "resource only mode" - what do the values for the given resources signify?
It is an adjustment used by the script to attempt to make resource usage practical by balancing the value of the ware with it's cargo space (volume). You can quickly fill a ship's cargo with Hull Plating, but it won't have much value in credits, so we try to find a more "fair" value to our marines by multiplying the cost times the volume.

This is obviously a simple approach and is easy to exploit, so you may want to fine-tune the adjustments.

For example, Hull Plating costs a maximum of 268 credits, with a volume of 10. So 268*10 = 2680 (The document file, 8501-L089, erroneously says "26800" here, but the REAL file, 8501-L044.xml, has the correct value of 2680.)

Similarly, Microchips have a high value close to 15200, with a volume of 2, so our adjustment value is 15200*2.

If you wanted to exploit this system, then you could send CLS2 pilots to buy all the Hull Plating that they can find, and use that for your repairs. You would then get repairs done for approximately one-tenth of the cost of repairing at an Equipment Dock.

On the other hand, Hull Plating is relatively rare, so you could think of the multiplier as a bonus for making the effort of collecting Hull Plating.

If you are serious about making a resource-based game, then you may want to adjust the values in the t file to make them more "fair" by your own standards. You might, for example, want to consider rarity of the resource as part of your adjustment.



Regarding repairing stations, you would have to test it, but my guess is that resources or credits would make no difference to the known bug that you reported earlier.

User avatar
soulmata
Posts: 154
Joined: Thu, 15. Nov 12, 10:34
x4

Post by soulmata » Mon, 3. Jul 17, 00:16

Interesting. Thanks for the details.

Since in AP I can build hull plating factories (might be from the TRP), I was considering the feasibility of having all repairs be resource-only, and reflect the "relative" ease of acquiring the resources vs having them repaired at a shipyard. I like the flavor of a ship, once damaged, has to be taken out of combat for repairs for a lengthy period, particularly capital ships.

Now once a complex is self-sustaining, that obviously means you're getting endless "free repairs", where the actual cost is the time a ship spends out of service and the infrastructure needed to support the factories. Hmm, pay 10,000,000 credits for an instant repair when I have 300M in the bank, or my very expensive M2 doing nothing for a while? I think the latter hurts more in the long run, since a ship in dock for repair is a ship not killing things for you!

Toward the midgame, the cost of repairs at a shipyard never bothered me, but the fact a ship went from 20% hull to 100% instantly seemed a little weird. With MRT, I noticed an Osaka that had something like 70% hull took quite a while to repair, so while it was repairing I had it docked elsewhere. That seemed a lot more "realistic" for a game in which spaceships barely travel faster than passenger cars, but also gave me a reason to own multiple M2s and try not to get them damaged in the first place.

Perhaps I can tweak MRT to require both resources /and/ regular wages for the marines.

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

Post by DrBullwinkle » Mon, 3. Jul 17, 01:37

Sure, using repair time as your major cost factor works. Especially on large ships in a mature game.

If time is going to be your major cost factor, you can slow down MRT by increasing the Time Step (id 412). The Time Step is the number of seconds that the Artificial Life script pauses between repair checks. If you double the Time Step, then you double the amount of time between repairs.

(Don't make the Time Step much lower than the default of 15 for performance reasons.)

(Increasing the Total Effectiveness Divisor (ID 411) will do something similar.)


MRT will automagically consume both resources and credits if you supply some resources (but not enough to complete the repair job). So, if you supplied enough resources to do half of the repairs on your Osaka, then the marines will consume the resources first, then charge your account for the rest of the costs. It's not exactly the same as charging BOTH resources and credits on each Time Step, but it doesn't take any development work, either. :)


If you are getting resources for cheap, then you could increase the overall costs of doing repairs (ID 4). The default of 4 means that MRT charges very approximately 40% of the cost of shipyard repairs. Changing that to 10 would make MRT charge the same as shipyard. Changing to 20 would double the cost of MRT repairs vs shipyard, which might make sense to some players.

IDs 3001 and 3002 work similarly for spacewalk repairs. In this case, the numbers work as a ratio. The default values of 33 and 100 mean that spacewalk repairs cost 33/100 (33%) of the cost of shipyard repairs.


As you can see, there is quite a bit of flexibility built into the t file, without requiring any code changes.


I know that some players like salaries. If millions of credits in training and repair costs are not enough for you, then, sure, knock yourself out. But the easy path is to adjust the repair costs to suit your game.


One other thought for you: An alternative to docking at a station would be docking at a "Repair Aran". You probably know that you can get an Aran by hunting in Undefined Space (with an Unfocused Jump Drive, UFJD). Arans are the only ship in the game that have a mammoth capital ship docking port, so you can dock any other ship to it. (You may want to be in another ship when you dock them to avoid collision damage.)

You could then keep a crew of marines and a stock of resources in the Aran for doing repairs.

Arans don't move very fast, so I think of mine as a "station that can jump". That might be handy for post-battle cleanups. You could repair captured ships without needing to give them jump drives. (Of course, you will have to defend your Aran because it has no weapons and is a giant target.)

User avatar
soulmata
Posts: 154
Joined: Thu, 15. Nov 12, 10:34
x4

Post by soulmata » Mon, 3. Jul 17, 02:13

Thanks a lot for all your input. It's quite flexible as-is, and that's really nice.

Looking at your code, it looks like you made it pretty easy to adjust. It seems you have all the logic on what a repair should cost in 'al.Bw.MarineRepairsAndTraining.cost', which, if consuming wares, ends early before deducting credits:

Code: Select all

* If t file says "Resources Only", then we are done.
if $c.consume.resources.only == 'yes'
return $ware.consumed
end




... and if consuming wares, modify the repair cost by adding a negative value based on the value of the ware:

Code: Select all

"$repair.cost = $repair.cost + ($amount.ware * $cost.ware)"
So, I think, that if I removed the "+ ($amount.ware * $cost.ware)", and didn't allow it to exit early if we'd consumed a ware, the effect would be we both consume a ware and charge credits for the repair. I could keep the relative amount of resources used low, merely enforcing that some of them are used. Does that sound right?

Or, alternatively, put logic in the condition of having wares consumed also deduct credits at that point. In fact I think that might work better.




edit: I think rewriting the above statement like so should do it:

Code: Select all

* If t file says "Resources Only", then we are done.
if $c.consume.resources.only == 'yes'
if $ware.consumed
$player.money = get player money
$amount.to.deduct = 0 - $repair.cost
add money to player: $amount.to.deduct
end
return $ware.consumed
end
The logic flow is unchanged, the only difference is that before we exit, we still charge the player if we have previously consumed resources. Doesn't check to see if the player has enough credits though, so I'd want to refine it first.


The first time I ever capped the Aran, I was in a Kyoto. So then I docked the Kyoto to it. and the Kyoto was physically larger than the Aran, which looked especially hilarious.

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

Post by DrBullwinkle » Mon, 3. Jul 17, 04:23

soulmata wrote:Thanks a lot for all your input. It's quite flexible as-is, and that's really nice.

Looking at your code, it looks like you made it pretty easy to adjust.

Thanks. I did try to make the code easy to maintain.

DrBullwinkle's First Law of Good Software Development:
Assume that somebody else will maintain your code. Make it easy for them.



That said...

* If t file says "Resources Only", then we are done.

"Resources ONLY" means exactly that. Resources only. No credits. So your approach would break the intention of that flag in the t file.

I think that you want to insert your changes elsewhere.

This would be easier over Skype. I emailed you my address in case you misplaced it.

Bitchmoon
Posts: 1
Joined: Thu, 10. Aug 17, 15:41

Post by Bitchmoon » Thu, 10. Aug 17, 15:49

Hi there,

Downloaded your mod because I was looking for a way to repair my 25% health complex.

Transferred a few (5stars in all except combat) marines from an M7 to 3 M6es (8/8, 8/8, 4/8). Then docked those 3 M6 at the complex.

I was then deducted 800 000 000 credits (okay? fair I guess), though the complex hull is still sitting at 25% as it was.

What should I do now? Keep the M6es docked while waiting for it to repair? Did I **** up somewhere? Do the marines only repair if on a TS? What do, please advise.

Cheers.

bergi9
Posts: 27
Joined: Thu, 5. Feb 09, 14:24
x3tc

Post by bergi9 » Thu, 31. May 18, 21:24

A modified version by me (from v2.14).
I'm playing X3LU-Mayhem, it makes TP more useful as TP can dock at any station and repair it.

- Doesn't random consume ware, strict order of ware consuming
- Only consume ware from ships with marines
- Remove stacking the efficiveness from docked ships (can cause calculated twice if docked ships has marines too)
- Ships with marines docked at station will repair other docked ships too
- reorder the repair steps (itself, docked ships, station, station's docked ships, stations in complex)

https://bergi9.de/Marine_Repairs_and_Training.zip

dispostableatheist
Posts: 193
Joined: Sun, 23. Jan 11, 13:28

Post by dispostableatheist » Mon, 10. Sep 18, 22:23

the onboard bootcamp, how do I use it?

swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

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

Post by swatti » Sat, 27. Oct 18, 18:15

I seem to be doing something wrong. Can someone link me a modiefied version of the mod that does not consume any materials or credits but repairs at about half-speed. Bootcamp on is ok.

delray
Posts: 4442
Joined: Thu, 23. Oct 08, 10:27
x3tc

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

Post by delray » Thu, 25. Feb 21, 20:16

I have 2.14 version of the script and a TP with 40 good marines docked at my Corporate HQ (reward from Corporation Troubles plot, Split variant). Station is damaged - yet marines aren't repairing it. I have a Steam version, fully updated, installation verified. Am I forgetting to enable something here to make marines repair the station?
Where is it?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

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

Post by X2-Illuminatus » Sat, 27. Feb 21, 10:36

Have you turned on the Artificial Life Plugin?
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!

delray
Posts: 4442
Joined: Thu, 23. Oct 08, 10:27
x3tc

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

Post by delray » Sat, 27. Feb 21, 13:47

X2-Illuminatus wrote:
Sat, 27. Feb 21, 10:36
Have you turned on the Artificial Life Plugin?
I think so, yes?

Image

I also have cheats enabled (Thereshallbewings), script editor and mission editor are accessible. Marines repair damaged ships just fine while on board of them and they train their skills while doing so. But they refuse to repair my (Terran) HQ and Corporate HQ.

When I try to repair the station using Marine Repair Hotkey (as opposed to being docked with marines at the station), it launches marines at the target, sounds of tools/repair are playing in the background and marines fly around shooting their lasers at the Corporate HQ, but no hull damage is being repaired. Message at the bottom of the screen says that repair cost is 0 (it should be millions). My own repair laser does little repairs every time I fly close to the same station and shoot at it a little.
Where is it?

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

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

Post by alexalsp » Tue, 7. Sep 21, 21:40

The site is down, there is no access. Someone said that the site has moved, you can upload the mod to the cloud or a link to the new site address please.

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24949
Joined: Sun, 2. Apr 06, 16:38
x4

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

Post by X2-Illuminatus » Sat, 11. Sep 21, 18:05

Maybe just a temporary outage? The xdownloads link in the opening post works fine for me. Here's the respective Onedrive mirror link just in case.
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!

X3bestone
Posts: 1
Joined: Thu, 21. Jul 22, 16:32

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

Post by X3bestone » Thu, 21. Jul 22, 16:50

I'm wondering about the repair cost when using 'single repair ship'. I have a M3 with a 19K hull and it's 85% undamaged.
When trying to repair that 15% dmg, it says i need more than 97K... is this correct?
I thought with a default repair cost of 4, it should be much lower? Like 11K?

Scoob
Posts: 9920
Joined: Thu, 27. Feb 03, 22:28
x4

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

Post by Scoob » Fri, 19. Aug 22, 19:06

Hi, I have a query:

I set Training Cost per point of training to zero, as well as Repair cost per hull point to zero. However, a short while later I've lost over 3m credits from my account. I can see that the four Marines (all I have) on one of my ships are levelling up and I assume they're repairing some of the damaged ships I have at the same station.

Basically, my credits are being drained quite rapidly, but not regularly, I see a few 100k cr vanish every few minutes and I'm not sure what's happening. What settings are needed for fully free (credits and Materials) repairs?

Cheers.

Edit: It looks like the "boot camp" option was to blame, with a Training Cost being taken regardless of the value being zeroed. With Boot camp Off, I didn't lose money, nor did any of my four Marines gain rank, which is fine. I'd rather they train on the job. Note: they were NOT repairing other docked ships of mine on the same station the Marine (TP) is docked at.

Edit 2: I notice that while my Marines now repair for free as desired - exactly how I had it configured in AP years ago - they do not gain experience from performing repairs as before. This might be some new (for me) quirk in the script, or some weird FL-related issue. Regardless, with Boot Camp (training for low-level Marines) enabled they (I just had four Marines) drain cash at an alarming rate, despite setting cost to zero. So, this had to be turned off entirely. Actually, when I last used this script I don't think the Boot Camp stuff even existed.

Dunno how many people are still playing X3TC/AP/FL but thought I'd share my initially findings here.

KRM398
Posts: 1556
Joined: Wed, 6. Nov 02, 20:31
xr

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

Post by KRM398 » Wed, 28. Sep 22, 19:43

site and downloads are all dead, it appears time moves on and this mod has died.

Post Reply

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