EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
[SCR] Replication v1.0.0 (21-03-14)
Post new topic Reply to topic Goto page 1, 2  Next
View previous topic :: View next topic
Author Message
Shimrod





Joined: 18 Feb 2003
Posts: 887 on topic
Location: UK
Thank you for registering your game
modified
PostPosted: Sat, 22. Mar 14, 00:34    Post subject: [SCR] Replication v1.0.0 (21-03-14) Reply with quote Print

Summary

This script adds a Replicator ware to a selection of docks. When equipped with replicator units a ship can produce missiles, energy cells, ammo, drones and satellites over time.

When a ship has one or more replicator units it gains an additional ship command "Replicate..." which opens a menu:
- Set the production limits for each ware
- Begin replication.
- View the status of the current replication cycle through dynamic menu updates

Note: The Replicator uses an EMP-X ware entry; please see the Dependencies section.

Applications
- Jump around with follower ships without micromanaging energy
- Retain a buffer of missile defence mosquitoes
- Drone carriers can absorb losses as long as your bank balance can support it.
- Live the ammo based weaponry dream. Missile boats with regenerating ammo
- Universe explorers with a ready supply of satellites

Dependencies
- This script requires the EMP-X which adds customizable ware entries.
- EMP-X is built into XRM
- X Plugin Manager applies the EMP-X when launching the game through it
- XTC only has EMP not EMP-X so script is incompatible.

Compatibility
- This has been tested on AP with XRM, and vanilla AP with X Plugin Manager.
- It doesn't work in XTC or XTC:AP as this does not have the EMP-X wares.

Format
- ZIP file containing T file and script files

Download



Install/Uninstall
- To install, copy the script and t folder contents from the zip file to those folders of the same name either in the "x3 terran conflict" folder, or the "addon" subfolder if playing Albion Prelude.
- To uninstall, run the uninstall command from the replication menu, save the game, and remove the setup script before reloading. It may take a few seconds before replicator wares are removed from stations.

Stats
- Replicators do not require physical resources
- The cost of replicating a ware is equal to the maximum price of that ware.
- Each replicator unit contributes 60 credits toward ware production per second
- Add more replicator units to increase production
- A replication cycle lasts a minimum of 10 seconds
- Multiple cheap wares can be produced in a single 10 second cycle
- Expensive wares require lengthy cycles to produce single units
- Replicators are sold in various out of the way stations
- Replicators cost about 100k per unit and require a good reputation to buy.
- Replicators are 13 volume L class wares in vanilla and XL class in XRM.
- Replicators can be found at:

Spoiler
Docks whose names include:
- Unknown (and docks in unknown sectors)
- Research
- Secret
- Communications
- Torus
- Installation
Spoiler


References
- Developed using X-Studio: http://forum.egosoft.com/viewtopic.php?t=301433

Script Resources
Code:
Ship Additional Commands
  1233: COMMAND_TYPE_SHIP_33
Ware (EMP)
  62010: SS_WARE_SW_CUSTOM2_26
Text File, Task Id & Logfile ID
  9056



Edit [1st Dec 2015]: replaced outdated with working xdownloads link. X2-Illuminatus


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.


Last edited by Shimrod on Wed, 8. Oct 14, 16:46; edited 23 times in total
Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 887 on topic
Location: UK
Thank you for registering your game
PostPosted: Sat, 22. Mar 14, 00:35    Post subject: Reply with quote Print

Change log

1.0.0
- Initial release


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
DrBullwinkle





Joined: 17 Dec 2011
Posts: 5705 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Sun, 23. Mar 14, 22:29    Post subject: Reply with quote Print

Quote:
Replicators are sold in various out of the way stations


Various and rare out of the way stations. Wink . Only two docks in my entire game were seeded with the ware. It took me a while to figure out whether the ware had installed properly.

However, it did work the first time for me (installed with PM).

This is a cool way to keep my ships supplied with Mosquito missiles for Missile Defense Mosquito. Nice.


    Seems brave of you to use an EMP ware. Smile I get a lot of trouble reports about them, so I go through some trouble to allow the script to "fall back" to a vanilla ware (or no ware) in case the EMP installation fails. Testing whether the ware has the correct name seems to be a reliable way to check whether the ware is properly installed.



_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
Shimrod





Joined: 18 Feb 2003
Posts: 887 on topic
Location: UK
Thank you for registering your game
modified
PostPosted: Sun, 23. Mar 14, 23:24    Post subject: Reply with quote Print

One way to see where the ware is sold is to check the 9056 logifile either at first install, or about 10 sec after running the uninstall menu option. The restock tasks beginning or ending on the docks are traced regardless of logging setting.

It's my first foray into custom wares but no trouble so far, besides plugin manager clobbering the custom ware text. The original EMP seems to have been more friendly by naming its init script like a.a.a. to execute as early as possible in the startup chain.

So far I've been using it:
- On carriers to produce missiles that wing ships auto supply themselves with
- To minimize the amount of jump fuel required, since it regenerates, maximizing space for weapons
- To retain a good stock of drones while I had a small fleet (leading to a nice win in Astreus + 3xM6 vs Khaak advanced destroyer + 2 frigates - without strafing)
- To stock mosquitoes, swarms, heavy torpedoes on capships.

I thought it was a bug initially that mass driver ammo didn't appear in the list, but it turned out that XRM mass drivers don't require ammo.


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.


Last edited by Shimrod on Sun, 23. Mar 14, 23:36; edited 2 times in total
Back to top
View user's profile Send private message
DrBullwinkle





Joined: 17 Dec 2011
Posts: 5705 on topic
Location: Boston, USA
Thank you for registering your game
PostPosted: Sun, 23. Mar 14, 23:31    Post subject: Reply with quote Print

Yeah, that is how I discovered where the ware was... by looking in the log. Smile

No PM clobbering in my case; the ware got the correct name. But, then, my environment is EMP-friendly. My experience is that not all environments are so friendly.


_________________
Peace through superior firepower

Bullwinkle's List | Marine Repairs and Training | Mobile Mining Mk2 | Drone Carrier Software 2 (DCS2) | Ship Tricks: Mini-Guides (with Video)
Back to top
View user's profile Send private message Visit poster's website
Pierre'70





Joined: 30 Apr 2005
Posts: 120 on topic

Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 11:53    Post subject: Reply with quote Print

I've been using this with XRM, and it works a treat, except that lots of missiles seem to be missing from the replication list. Is it possible to edit the t file to add in missiles added by XRM?

Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 887 on topic
Location: UK
Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 12:01    Post subject: Reply with quote Print

It's filtered to the set of missiles that particular ship can use, in glen.replication.menu.xml by:
Code:
$Unfiltered = $Ship -> get compatible missile array

Then filtered on
Code:
$Ship -> can transport ware $Ware


This is aimed at making it easier to replicate the right kind of missiles for the ship, though I appreciate its not ideal for a carrier resupplying docked ships.


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
Pierre'70





Joined: 30 Apr 2005
Posts: 120 on topic

Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 12:31    Post subject: Reply with quote Print

What should I edit to enable my ship to build all missile types? As you say, I'm trying to use it on a carrier. I like the idea of preventing replication of wares too large for the ship to hold - I don't want to remove this, only the restriction on missiles the ship can fire.

Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 887 on topic
Location: UK
Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 12:58    Post subject: Reply with quote Print

Try pasting the following subroutine to the end of glen.replication.menu.xml:
Code:
Get.Missiles:
    $Missiles = array alloc: size = 0
    $idx = get number of subtypes of maintype 10
    while $idx
        dec $idx
        $Missile = get ware from maintype 10 and subtype $idx
        append $Missile to array $Missiles
    end
endsub


Then replace this:
Code:
$Unfiltered = $Ship -> get compatible missile array

With this:
Code:
gosub Get.Missiles:
$Unfiltered = $Missiles


Note to future self: add config checkbox for missile restriction


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
Pierre'70





Joined: 30 Apr 2005
Posts: 120 on topic

Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 13:17    Post subject: Reply with quote Print

Sorry Shimrod, I can't find this to replace:



Quote:
Then replace this:
Code:
$Unfiltered = $Ship -> get compatible missile array

With this:
Code:
gosub Get.Missiles:
$Unfiltered = $Missiles


in any of the Replication files (in t or scripts).

Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 887 on topic
Location: UK
Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 15:07    Post subject: Reply with quote Print

Line 113 of glen.replication.menu.xml. I'm assuming you're familiar with X-Studio.

Code:
113    * Determine the set of wares to show in the menu
114    $Unfiltered = $Ship -> get compatible missile array
115    append {Energy Cells} to array $Unfiltered
116    append {Navigation Relay Satellite} to array $Unfiltered
117    append {Advanced Satellite} to array $Unfiltered
118    append {Keris} to array $Unfiltered
119    append {Fighter Drone MKII} to array $Unfiltered
120    append {Fighter Drone} to array $Unfiltered



_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
Pierre'70





Joined: 30 Apr 2005
Posts: 120 on topic

Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 15:38    Post subject: Reply with quote Print

Ah. I've been trying to use Notepad++. I'm not really familiar with X-Studio. Sorry.

Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 887 on topic
Location: UK
Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 16:45    Post subject: Reply with quote Print

The scripts can't be edited directly as they have compiled code at the end. Not a problem with X-Studio though, just load the file in that, edit and save and it'll compile it to the right format. Has syntax highlighting, auto-completion and stuff.

X-Studio: http://forum.egosoft.com/viewtopic.php?t=301433


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
Pierre'70





Joined: 30 Apr 2005
Posts: 120 on topic

Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 17:15    Post subject: Reply with quote Print

I've got X-Studio working and opened the correct file in it. I've tried following your instructions but it refuses to save the file after I have altered it. I'm getting the following errors:

Unrecognised or incomplete script command on line 114 : 'gosub Get.Missiles:'
Unrecognised or incomplete script command on line 295 : 'Get.Missiles:'
The variable '$Missiles' on line 115 is being used without being assigned
Compilation aborted due to syntax errors in script commands

Forgive my muppetry over this, thanks for your patience.

Back to top
View user's profile Send private message
Shimrod





Joined: 18 Feb 2003
Posts: 887 on topic
Location: UK
Thank you for registering your game
PostPosted: Thu, 11. Sep 14, 17:50    Post subject: Reply with quote Print

I've never seen that before. You can ignore the use without assignment warning, it's just a simple top to bottom check and doesn't follow branches.

Thoughts:

There are other gosubs in the file. Does what was pasted look different? Try copy and pasting one of them then rename it to Get.Missiles.

Maybe some strange characters got pasted in that's confusing it, like with Word's smart quotes. A funky colon? Smile

On rare occasions I've seen X-Studio occasionally report a line as an error until I retype it. Try re-typing those lines manually.

If you saved the file in notepad++ previously maybe it's corrupt.


_________________
My scripts: Beacon Jump, Custom Start, OK Traders, Replication, Smart Turrets.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Mon, 11. Dec 17, 13:35

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.13341 seconds, sql queries = 29