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
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Sun, 18. Jun 17, 04:23

MisterHalt wrote:I was trying to restart the repairs to get some of the lazy jarheads to AIM at the ship, by pressing the repair button a couple more times than was probably necessary.
Yeah, that could confuse the script. Pressing the hotkey a second time cancels the repair and orders the marines to return to the ship.

It takes a few seconds for the marines to go and perform the repairs, and it takes time for them to return home. The marines are not 100% about lining up perfectly, but they will get the job done if you are patient. All of the marines in the squad will get training credit.

Pressing the key several times over a few seconds... um... not sure what havoc that might create. My advice: Don't do that. ;)


Don't worry about the null prices. They aren't really mission critical, and I have plans to rewrite the fee calculation module anyway. I will watch for your reported problem when I do that.

Thanks for the reports, MisterHalt

MisterHalt
Posts: 3
Joined: Tue, 13. Jun 17, 15:21
x4

Post by MisterHalt » Sun, 18. Jun 17, 04:38

DrBullwinkle wrote:Don't worry about the null prices. They aren't really mission critical, and I have plans to rewrite the fee calculation module anyway. I will watch for your reported problem when I do that.

Thanks for the reports, MisterHalt
It seems that it's just the message itself having problems. I repaired another ship and kept an eye on my account. Money was deducted when the repair was complete, so that bit is functioning fine.

I hate that my first step into this forum is 'hey this thing isn't working'. Makes me feel skeezy.

Also why the heck is there a digitised Wilhelm Scream as one of the random repair noises?!

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

Post by DrBullwinkle » Sun, 18. Jun 17, 05:48

The first thing that you said was how much you liked the script. So you're all good. :)

My first question on the forum was, "How do I make combat more challenging so that the game will be more fun?". That led to Combat Tricks, which led to the rest of my scripts. We all have to start somewhere. :)


MisterHalt wrote:Also why the heck is there a digitised Wilhelm Scream as one of the random repair noises?!
Probably for the same reason that it appears in so many movies and other works over the years: It's free.

There were not a lot of built-in sounds for me to choose from, and the scream was just part of the other racket. I could add sounds, but implementation is troublesome and they can interfere with other mods, so the built-in sounds seemed like the best choice.

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

Post by soulmata » Wed, 21. Jun 17, 07:02

As I've said before, I consider this a critical must-have for any X3 experience. I've been using it for years now and won't look back. Really fantastic work.

I am starting a new X3 game soon, and some things I noticed from last time I wonder if you are aware of:

* My marines seem to always train up to full 5 stars. They must be really bored, because I will get newbie marines, they stay parked somewhere for a few game days, I come back and they are all 5-stars. What a bargain.

* Does this script explicitly check for the marines being on ships owned by the player? I also have a mod that puts marines on NPC ships to make them harder to board - and those marines always seem to have 4 or 5 star everything. I would hate to think I am also paying for their training and repairs too! That could just be the other mod though.

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

Post by DrBullwinkle » Wed, 21. Jun 17, 15:24

Thanks for the kind words, Soulmata.

"Five stars" is not the same as 4x100. Mount a bio scanner on your ship to see the exact stats.

Here is how it SHOULD work:

MRT should fully train the marines in the normally trainable skills, so 3x100 is expected. That is the same as an Equipment 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?


Yes, MRT trains only player-owned marines. Cycrow's script to add marines to NPC ships already trains those marines pretty well (as you have experienced). That is probably by design; in order to make NPC boarding parties more of a challenge.
Last edited by DrBullwinkle on Wed, 21. Jun 17, 22:37, edited 1 time in total.

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?

Post Reply

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