[MOD] Mobile Ship Repairs - v1.6

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
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

[MOD] Mobile Ship Repairs - v1.6

Post by Krewzur » Sat, 1. Nov 08, 01:47

..
Last edited by Krewzur on Thu, 26. Feb 09, 18:52, edited 2 times in total.

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

[MOD] Mobile Ship Repairs - v1.7 - Nov 6, 2008

Post by Graxster » Sat, 1. Nov 08, 01:54

Mobile Ship Repairs

What it does:

:arrow: Adds two Repair Laser Factories (Omicron Lyrae and Three Worlds).
:arrow: Adds Repair Lasers as a trading item at the Trading Stations in Kingdom End and Nyana's Hideout.
:arrow: Adds a ship command under Special: Repair Ship
:arrow: Adds a ship command under Special: Repair Ships in Sector...
:arrow: Allows you to command a ship equipped with Repair Lasers to repair any other ship.

How it works and how to use it:

1. First, get yourself any ship that can use Repair Lasers, this is most likely anything that can use Tractor Beams. (Paranid Nemesis, Terran Vidar, etc).

2. REQUIRED: Install Navigation Command Software MK1 and Special Command Software MK1. A Jumpdrive is also required if you plan on sending your repair ship to another sector (other than the one it's doing the repairs in).

3. Put Energy Cells in the repair ship's cargo hold. If you do not, the repair ship will fly to the target sector.

4. There are 4 different ways that repairs are done:
  • If the damaged ship is not moving and no enemies are around (best and quickest way).
  • If the damaged ship is moving and no enemies are around, the repair ship will follow and attempt repairs. If the damaged ship is faster than the repair ship, it will abort repairs and send you a message.
  • If there are enemies in the sector, the repair ship will go into "attack run" mode and attempt repairs while it's moving around. Note that in some cases the "moving around" won't be much.
  • Choose "Repair Ships in Sector..." and the repair ship will repair all damaged ships in that sector. It will then go into standby mode (this is exactly the same as the command, "Collect Wares in Sector...") and wait around until another damaged ship arrives.
6. There are numerous checks built in that will send you incoming messages if there's any kind of problem. You can also repair ships that are neutral to you (blue). Note that in rare cases, the repair ship will not use the jumpdrive if the damaged ship is in the next sector over. In that case, the pilot just flies there.

7. There are two Repair Laser Factories in the game, located in Omicron Lyrae and Three Worlds. It's up to you to make sure they are stocked with wares. NPC traders WILL sell to them, but maybe they won't find all the needed resources? Note that it takes just over 9 hours for a factory to produce 2 Repair Lasers, so before you post in the forums that the factory is "broken", be aware of that. :)

8. The Free Argon Trading Station in Nyana's Hideout trades in Repair Lasers, but will not have any stock until a trader sells lasers from the factory. Same goes for the Royal Boron Trading Station in Kingdom End.

9. You'll find the price is quite high for a Repair Laser. This is intentional. They are a powerful tool that saves millions in credits over the life of your game. If you don't like the price, or the slow production, download the "Easy" (script-only) version.

HIGHLY RECOMMENDED: A ship with the ability to mount 6 or 8 repair lasers in the MAIN gun slots (not turrets). 2nd choice: Something like the Magnetar that has a FRONT turret.
------------------------------------------------------------------------------------
KNOWN ISSUES:

Equipping a Big Ship or Huge Ship with repair lasers and attempting to order them to do repairs will not work. The scripting for these size ships has an "avoid" parameter that prevents them from flying too close to other ships. Repair Lasers are short-range. Besides, why waste a Capital Ship as a repair boat?

It's possible that some ships that only have REAR turrets will not be able to effect repairs.

If your repair ship is trying to repair a HUGE ship and approaches it from the nose or tail (as opposed to the side), it may have difficulty getting close enough to use the repair lasers. In this case, it may go through several cycles of "Action: avoiding" before the autopilot can get a good angle on the damaged ship.
-----------------------------------------------------------

Enjoy!

-Grax

-----------------------------------------------------------

UPDATE Nov 3, 08

1. The main Mobile Ship Repairs project is now a MOD package.
2. Ships that only have turrets and no front (main) weapon slots can now use the Repair command.
3. Many tweaks to the Repair Ship script.
4. Using the Repair command now requires both Navigation Command Software MK1 and Special Command Software.
5. The Scripted version will no longer be supported.
-----------------------------------------------------------

UPDATE Nov 3, 08 3:24Am Eastern Standard Time

If you downloaded the MOD before this time, you don't have a Repair Laser Factory in Omicron Lyrae, sorry. Please re-download and re-install.

Added a 2nd Repair Laser Factory to Three Worlds.

------------------------------------------------------------

UPDATE Nov 3, 08 11:38Am Eastern Standard Time

Update notes for v1.6:

Removed all code dealing with "automagically" adding energy cells needed for a jump.
Removed all code that told the repair ship to go purchase energy cells when repairs were completed.
Removed "fly to homebase" when repairs were completed.

Just set the Auto Jump and Fuel Resupply options in the ships command console.

------------------------------------------------------------

UPDATE Nov 6, 08 5:00PM Eastern Standard Time

Update notes for v1.7

Cleaned up/changed some of the scripting for "Repair Ship".
Added Repair Lasers as a tradeable item in the Royal Boron Trading Station in Kingdom End.
Added the "Repair Ships in Sector" command.
Changed text file from 8000-L044.xml to 3441-L044.xml to remove conflict with Commercial Agent script.

-----------------------------------------------------------

Note: Be sure to uninstall before installing new version (don't just install on top of it), as I have changed the text file number from 8000 to 3441.


Mobile Ship Repairs MOD package

SPK v1.7
[ external image ]

RAR Archive v1.7
[ external image ]

-----------------------------------------------------------

Script Only Version

NOTE: In this version there is no Repair Laser factory. Repair Lasers are added to all Trading Stations in the game, at a very cheap price (36cr, IIRC), and about 5,000 of them at each Station. This version will no longer be updated or supported after Nov 3, 2008.

SPK
[ external image ]

-----------------------------------------------------------

Uninstall file

NOTE: If you have a previous version that has Repair Lasers at every Trading Station, you'll need to download this file and follow the removal instructions.

[ external image ]

NOTE: If you have a bug where Repair Lasers are showing up in Equipment Docks, download this file and follow the included instructions. I have no idea at this time why this would happen.

[ external image ]

-----------------------------------------------------------

COMPLETE UNINSTALL

NOTE: Removes repair lasers from the game, removes repair laser factories.

[ external image ]
Last edited by Graxster on Sun, 16. Nov 08, 17:35, edited 18 times in total.

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Sat, 1. Nov 08, 02:17

hay, that was fast man, did you read the thread i made about 7minutes ago? did you make this script just now or did you have it all this time?

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Sat, 1. Nov 08, 02:32

did you increase the price of the repair lasers? i did in my game, up to the same price as the PPC. that way it won't be cheating.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 1. Nov 08, 02:43

Awesome. However, I'm dubious about automagically adding ecells. I would prefer if that feature wasn't there, or at least there was a config option to turn it off.

Don't bother with jumptosector.nearest, use movetoobject (or whatever) and tell the player to set the autojump settings in the ship, and it will use the jumpdrive automatically if it can.

As for producing repair lasers. Take a look at LV's Jumpdrive Kits script, he creates factories specifically for producing Jumpdrive Kits. You could do similar for repair lasers.

Oh yeah, and IMO 'Special' commands should require the Special Command Software MK1. But that's a minor point, at best.

Lancefighter
Posts: 3144
Joined: Sun, 19. Dec 04, 02:41
x4

Post by Lancefighter » Sat, 1. Nov 08, 02:49

he puts the price of e-cells well above the max price of them; i dont think that is a problem really.

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Sat, 1. Nov 08, 03:37

ThisIsHarsh wrote:IMO 'Special' commands should require the Special Command Software MK1. But that's a minor point, at best.
Well, if you don't have Special Command Software you don't have a "Special" menu at all, do you? :D I see I didn't mention that in the OP, I'll update that now.

As for automagically adding e-cells, I can possibly make that an option for the non-beta release. Or, if you don't like automatically adding them, just make sure the ship keeps enough in its cargo hold. :wink:
ThisIsHarsh wrote:Don't bother with jumptosector.nearest, use movetoobject (or whatever) and tell the player to set the autojump settings in the ship, and it will use the jumpdrive automatically if it can.
Eh... that could be a pain. More work for the player to remember to set that every time he outfits a repair ship. The script is already written and works fine for jumping, so that probably won't change.
amurph0 wrote:did you increase the price of the repair lasers?
Nope, didn't change that. Repair Lasers are cheap items, why is it cheating to have low-cost items in the game? And did I write the whole thing since you posted something 7 minutes before this post? hardly. Been working on it for a few days, off and on. If I could write scripts that fast I'd probably work for Egosoft, lol.
Lancefighter wrote:he puts the price of e-cells well above the max price of them; i dont think that is a problem really.
Yeah, that's why I made it 25cr each, so you're paying for delivery or whatever. Thanks for the feedback/comments.

-Grax

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Sat, 1. Nov 08, 03:49

Just a piece of advice, I can see your trying to make it require 2 pieces of command software.
Rather then allowing the command and then giving an error message, you could make the command greyed out instead, using the:
025 set script command upgrade: command=COMMAND_JUMP_SECTOR upgrade=$upgrade script='!ship.cmdcheck.jump'

(Using the example from the !init.ship.commandupgrade.xml for the jump scripts, read the end of pg 39/top of 40 in the MSCI to see the different return codes, I think that including null in the return makes it hide it completely, although I don't think you can bitwise-or a null, so it'll have to be by it self)

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Sat, 1. Nov 08, 04:00

s9ilent wrote:I can see your trying to make it require 2 pieces of command software....., you could make the command greyed out instead
How do you figure that? The only required software is Special Command Software MK1. The Navigation Command Software MK1 is just so you have the extra Nav commands like "Jump and fly to position". It's not in my script. And also, the command is greyed out when you don't have a repair laser installed.

-G

User avatar
Krewzur
Posts: 725
Joined: Mon, 16. Jun 08, 20:14
x4

Post by Krewzur » Sat, 1. Nov 08, 04:14

the reason you should increase the price is because otherwise you'd have repair lasers on every ship that can equip them, and using 8 RL's on a corvette would repair a capital ship in a relatively short time. I'm just saying that it seem's like cheating when you can A) Use a bunch of ships decked out with RL's to repair a capital ship in 1/2 an hour for free OR B) Wait a 1/2 an hour for that ship to reach a shipyard and spend millions on repairs........ I just think having the RL's that cheap would make the game too easy. Also you should increase the notoriety needed to get a repair laser, so that you don't start making a s**t load of money from the very start of the game. Keep the game balanced, you know

Also i think it was an amazing coincidence that i was looking all day for something like this and a few minutes after asking about it, it just shows up.

amirite
Posts: 243
Joined: Thu, 23. Oct 08, 22:01

Post by amirite » Sat, 1. Nov 08, 05:30

Thanks for making this, looks sweet. I would also prefer it if repair shps bought Energy Cells, rather than automatically adding them. I'm pretty sure that's how it works for every other ship command that uses jumping.

And I agree with the price/noyoriety increase. Why would repair beams be cheap items anyway? Logic would suggest that they would be way MORE expensive than a pew pew laser. I mean it's a beam of energy that repairs complex circuitry and machinery for pete's sake.

Again though, this is awesome. And I'm glad someone made it so quick!
-TEVE

Baleur
Posts: 587
Joined: Fri, 28. Oct 05, 13:37
x3tc

Post by Baleur » Sat, 1. Nov 08, 10:07

ThisIsHarsh wrote:Awesome. However, I'm dubious about automagically adding ecells. I would prefer if that feature wasn't there, or at least there was a config option to turn it off.

Oh yeah, and IMO 'Special' commands should require the Special Command Software MK1. But that's a minor point, at best.
Agree :)
CPU: Intel i7 6300k RAM: 32gb GPU: nVidia 1070 6gb VRAM

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Sat, 1. Nov 08, 11:36

Thanks for the feedback. Next update (hopefully today) will change the energy cell thing to something more palatable for everyone, including purists. :) Most likely this will be something along the lines of having the repair ship buy energy cells after the first flight. If I do it any other way, I'd be making something similar to an ST/UT (a ship with it's own brain 100% of the time), which is something I'd rather not get into. The original idea is that you can easily make use of the repair lasers rather than having to do the repairs yourself.

Next bigger update will probably change this from a script to a mod.

Planned changes:

1. Make repair lasers larger. (currently ware class 0 (tiny), should be M).

2. Increase cost of repair lasers.

3. Add stations that produce repair lasers.

4. I need to figure out how the game makes space fuel vanish (consumable), so repair lasers can work in the economy. I'm thinking factories that make, Trading Stations buy and sell (as they do with other produced wares), and NPC's "consume".

5. Add notoriety requirements for buying repair lasers.

Great ideas, all! I will also be providing a script to remove the repair lasers from the Trading Stations once I get all that done. Have any of you actually tested the script? I tested a bunch myself... things like "What if the ship was close enough to go into Repair Mode but was facing the wrong direction", etc. Let me know if you find any bugs or ways to mess up the repair process.

-Grax

mpcribeiro
Posts: 185
Joined: Wed, 6. Nov 02, 20:31
x3tc

Re: [SCRIPT] Mobile Ship Repairs

Post by mpcribeiro » Sat, 1. Nov 08, 12:42

Graxster wrote:Mobile Ship Repairs


2. Take the ship to a Trading Station, buy Repair Lasers and install them. Note that if the ship does not have Repair Lasers installed the "Repair Ship" command will be unavailable in the command console.

3. Make sure the ship has Navigation Command MK1 software, a Jumpdrive, and Special Command Software MK1 installed. If no jumpdrive is installed and you order a ship to repair another ship which is not in the same sector, the pilot will send you a message telling you how lazy he is.
Doesn't seem to work on Centaur... my rep-ship has:

NavCmd 1
SpecialCmd 1
JumpDrv
FightCmd 1 + 2
PatrolCmd
8 repair lasers on main

No command available :(

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Re: [SCRIPT] Mobile Ship Repairs

Post by Graxster » Sat, 1. Nov 08, 15:04

mpcribeiro wrote: Doesn't seem to work on Centaur... my rep-ship has:

NavCmd 1
SpecialCmd 1
JumpDrv
FightCmd 1 + 2
PatrolCmd
8 repair lasers on main

No command available
Re-download please. Pretty sure I left a file out of the .spk package. Remade it and uploaded again, so it should be OK now.

Also added a new version for those people who don't want energy cells delivered to their ship.

-Grax

Legionnaire
Posts: 1368
Joined: Sun, 8. Feb 04, 16:28
x4

Post by Legionnaire » Sat, 1. Nov 08, 16:05

just installed this and now have 10000 repair lasers in each trading station, at 64Cr each i believe the price of them should be quite a bit higher than that :D

Legionnaire

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 1. Nov 08, 17:15

Fantastic. Gonna grab this asap. Cheers for making the manual version.

There are all sorts of custom menu commands if you do want to make a version that satisfies everyone. I've found them invaluable.

About the price. How about using an EMP ware? Then when you run the command for the first time the script converts all these custom wares on the ship into repair lasers. Maybe a bit overkill, but worth mentioning.

draffutt
Posts: 4292
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt » Sat, 1. Nov 08, 22:59

came across a problem:

using SpaceLootTransporter by Huefte with this script as an example to show the problem. bring up the select command from the special menu and just highlight one of the command. now take a look in your message log. it should be generating 10 messages a sec about your weapons. it seems your grax.repair.a.ship.lasercheck.xml is running constantly and it seems any command running from the special menu is accessing this xml.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes

Legionnaire
Posts: 1368
Joined: Sun, 8. Feb 04, 16:28
x4

Post by Legionnaire » Sat, 1. Nov 08, 23:20

i also came across this so uninstalled, however i still have 10000 lasers in every trading station ;)

Legionnaire

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Sat, 1. Nov 08, 23:33

draffutt wrote:came across a problem:

using SpaceLootTransporter by Huefte with this script as an example to show the problem. bring up the select command from the special menu and just highlight one of the command. now take a look in your message log. it should be generating 10 messages a sec about your weapons. it seems your grax.repair.a.ship.lasercheck.xml is running constantly and it seems any command running from the special menu is accessing this xml.
Dang, lol. Sorry about that. Had the logbook command in there during testing. Will fix momentarily.

-G

Post Reply

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