[SCRIPT/MOD] Ware Blueprint Manager 2.1 - Blueprint any ware at PHQ, upgrade PHQ

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

myshkin
Posts: 18
Joined: Thu, 17. Nov 05, 12:52
x3tc

[SCRIPT/MOD] Ware Blueprint Manager 2.1 - Blueprint any ware at PHQ, upgrade PHQ

Post by myshkin » Tue, 27. Apr 10, 20:37

Just a simple little script, my first attempt at one, to add an ability to the player HQ that i was surprised isn't included in the vanilla X3TC. I searched around for a script to provide this, but i couldn't find one, please let me know if one already exists!

Why did i go to the trouble of learning to script in x3 and write this? Well i liberated a terran Tyr, but it didn't come with 30x PSP and 16x SSC to arm it, which left me with a problem. So i hunted out another Tyr that was packed with weapons and capped that, but again no weapons with the cap. Now i had two Tyr's and lacked almost 100 weapons for them, not good.

So i had a choice of boarding/destroying every terran capital ship i could find for the next week, or cosying up to the terrans and buying up their product. I went for option B but discovered only one forge in their entire territory, and feeding that resources for 100 weapons would be at least a week again.

Suddenly scripting in an ability the HQ ought to have anyway seemed a more reasonable way to equip my Tyrs, so i present...



Ware Blueprint Manager 2.1


Description

Headquarters using this upgrade can create blueprints of almost any ware including weapons, equipment, stations, and some software. This service comes at a price, reverse engineering a ware will cost at least 10 million credits. Additionally blueprints no longer needed can be destroyed.

Older headquarters may require an upgrade to support this service. Headquarter upgrading is provided when necessary, for a one-time fee. Due to the intensive nature of upgrading such a large structure, repeated requests will be met with an escalating fee.

As well as providing ware blueprint support, the HQ upgrade can improve production times, and/or reduce resource requirements.


Usage

This is the main menu for WBM, it can only be acessed through the station commands menu of a headquarters structure:

[ external image ]


Add Blueprint...

This command lets you reverse engineer a ware into a blueprint for your HQ. You'll be presented with a list of wares currently in your HQ to choose from. Although blueprints are created instantly, the service costs between 10 and 50 million credits, depending on the complexity of the ware. For example most weapons are quite cheap, but most stations are very expensive. One of the ware will be consumed from your HQ in the process.

Remove Blueprint...

This command lets you remove a blueprint from your headquarters. You will not be refunded. As with adding blueprints, you'll be prompted for confirmation.

Transfer Ship Extension...

Using this command lets you transfer a ship extension from a docked ship to your HQ. The specialist technicians that perform the service charge a fee of at least one million credits.

Upgrade Headquarters

This service will upgrade your HQ if it doesn't currently support blueprints other than for ships. It requires dismantling your current HQ and upgrading it off-site before delivering it back to it's current sector. There is a fee, initially 15 million credits for the upgrade, but the fee increases rapidly should you keep requesting the service, as a single upgrade should suffice.

All wares, credits, and blueprints currently in your HQ will be placed in storage during the upgrade, and returned upon request. All docked ships will be undocked to prevent damage while the HQ is dismantled.

you will be prompted for confirmation before the HQ upgrade request is processed:

[ external image ]

A message will be sent to the owner when the upgraded HQ has been delivered to the sector.


Restore HQ contents

If you recently upgraded your headquarters, then a different command will be present in the WBM menu of the upgraded HQ, once built. This command requests the return of all wares, credits, and blueprints stored from before the upgrade procedure:

[ external image ]




Download and Installation

This addon installs using Plugin Manager Lite. Due to the nature of HQs abilities, times, and costs being set at the moment the HQ is built, this script comes in several flavours, only install one of them.

Unless you have an existing HQ mod installed, then upgrading your HQ should be your first action in-game before blueprinting any wares. I'd recommend the 10% upgrade download if you're unsure which version to select.


Ware Blueprint Manager 2.1 (upgraded 10% production time)
This version upgrades your HQ to support ware blueprints and reduces production times to 10% of their original. cost and resources are unchanged.


Ware Blueprint Manager 2.1 (upgraded default times and costs)
This version upgrades your HQ with ware blueprint support. Production time, cost, and resources are all unchanged.


Ware Blueprint Manager 2.1 (upgraded 10% time, 50% resources)
This version upgrades the HQ to support ware blueprints, reduces production times to 10%, reduces resource requirements to 50%, but keeps costs unchanged.


Ware Blueprint Manager 2.1 (compatible with other HQ mods)
Use this version if you currently have another player HQ mod installed. If ware blueprints fail to appear in your HQ, see the F.A.Q. on updating the HQ mod. You'll only need to use the in-game Upgrade HQ service when the player HQ mod you're using is ever updated.



Upgrading

Upgrading requires you exit the game, uninstall your previous version of WBM, then install the new version.

If you wish to change flavour of WBM, that is to say change your HQ attributes, you should follow the same procedure as above, then upgrade your HQ in-game using the WBM menu. However, be warned that each time you upgrade HQ with WBM the cost will escalate.



Uninstall

Uninstall at any time using Plugin Manager Lite, no save required.



F.A.Q.

Q. So in short, what does this script do?
A. It lets you blueprint and produce any ware in your player HQ. Creating blueprints uses a custom menu, but production is handled in the Adjust Parameters menu of your HQ, just the same as producing ships.


Q. But i built my HQ already, and i know you can't change it once it's built?
A. That's right, so this script provides a way to rebuild your HQ whilst preserving it's contents.


Q. Will i lose all the rare ship blueprints that i've collected when i upgrade my HQ?
A. No, the upgrade will put your current blueprints into storage and let you restore them later.


Q. I edited my own HQ.xml file to increase the pitiful storage capacity of the default HQ, does that mean i need the mod compatibility version of WBM?
A. No you should use one of the upgrade versions, as all of them increase the HQ storage capacity to 50 million units.


Q. I also customised other areas of my own hq.xml, and i'd like to keep those changes, are you sure i should install an upgrade version of WBM?
A. You should, but first make a backup of your custom hq.xml, then install an upgrade version of WBM and edit the installed hq.xml to suit, before using the Upgrade Headquarters command in-game.


Q. I blueprinted some wares but they don't appear in the Adjust Parameters menu of my headquarters?
A. You need to upgrade your headquarters before any blueprinted wares are available for production.


Q. I upgraded my headquarters but there's still no production entry for the wares i've blueprinted?
A. Roll back to savegame before the upgrade, and exit game. Ensure your installed version of WBM is an upgrade version (ie. not the mod compatibility install).


Q. But i am using a HQ mod so i downloaded the compatibility version, yet my blueprinted wares don't appear for production in my HQ?
A. The author of your HQ addon needs to add ware blueprint support to hq.xml, namely in the <production> section and ideally in the <resources> section too. The specific changes can be found by downloading the vanilla upgrade version of WBM and comparing the contained hq.xml to the default X3TC 2.5 version.


Q. Is this script available in my language?
A. There are no translations at present, but if anyone would like to, thanks.


Q. What does the list of blueprints in the main WBM menu actually do?
A. Nothing as yet, it's more for a fast way to check what blueprints you have, rather than scroll the often massive list of products and resources in the adjust parameters menu of the HQ.


Compatibility and game resources

So far as i'm aware, there aren't any incompatibilities with existing scripts according to xai corp's resource register.

If you use a mod or fake patch that alters the HQ, download the plain WBM without the HQ mod included.

Code: Select all

T-file: 
8983 ......... Ware Blueprint Manager by Myshkin
text-page: 
8983 ......... Ware Blueprint Manager by Myshkin
<t id="1143">WBM_MENU</t>  : Ware Blueprint Manager


Credit and thanks

LV - excellent tutorial on scripting for the X engine - http://forum.egosoft.com/viewtopic.php?t=218654

Apricotslice - Huge appreciation for your Apricot PHQ v3 mod, comparing this to the vanilla hq.xml let me figure out what was needed for ware blueprint support in the HQ. - http://forum.egosoft.com/viewtopic.php?t=226623


Future versions

RE times for wares

While it's not possible so far as i know, to have RE times in the same way as a ship would, it would be possible to RE wares seperately in the WBM window with a status update area to track REs. I'm not sure if anyone wants this though?
Last edited by myshkin on Wed, 5. May 10, 13:02, edited 6 times in total.

russbo
Posts: 862
Joined: Sat, 12. Nov 05, 21:53
x4

Post by russbo » Tue, 27. Apr 10, 20:54

Nice job, and much needed. Making Terran weapons will be extremely useful.

myshkin
Posts: 18
Joined: Thu, 17. Nov 05, 12:52
x3tc

Post by myshkin » Fri, 30. Apr 10, 10:04

Quite a big update for 2.0, the biggest of which is...

added ability to upgrade an existing headquarters

This basically means if you built your HQ a year ago, with any version of X3TC, you can now upgrade it to support ware blueprints and production without losing any part of it.

Other changes include...

- a new name, more suited to the game universe
- a custom menu
- more player feedback and confirmation for actions
- all actions that affect property or credits will record confirmation messages in the player log
- moved all text strings to a text page, no more hardcoding, so translation is possible
- increased cost cap from 35m to 50m credits
- cost of upgrading the HQ doubles each time, this is to prevent abusing the command as a way to move your HQ around the universe for free.


Edit: whoops, SPK's downloaded before the time of this edit were missing a file, fixed now.

lordmuck
Posts: 1736
Joined: Sun, 1. Mar 09, 12:25
x4

Post by lordmuck » Sat, 1. May 10, 01:13

thanks I am going to try the 1st link tomo when I wake up :)

Gripen
Posts: 88
Joined: Fri, 12. Jun 09, 12:10
x4

Post by Gripen » Sat, 1. May 10, 10:58

Looks awesome, is it possible to get a jumpdrive blueprint this way?

Mad_CatMk2
Posts: 518
Joined: Sun, 22. Feb 09, 20:13
x4

Post by Mad_CatMk2 » Sat, 1. May 10, 20:55

this script really makes the PHQ a "PHQ" where you can do almost anything :D

looking forward to using this
I fly an OWP. What about you?

myshkin
Posts: 18
Joined: Thu, 17. Nov 05, 12:52
x3tc

Post by myshkin » Sun, 2. May 10, 00:20

Sure you can blueprint a jumpdrive, depending which flavour of WBM you choose, your production costs and times will vary from below:

[ external image ]

[ external image ]

You can also blueprint third party ship equipment such as MARS or advanced jumpdrive, they get expensive tho (50m RE and 40+m and resources production costs for an FTL jumpdrive). :)

milytar
Posts: 345
Joined: Wed, 25. Feb 09, 19:44
x4

Post by milytar » Sun, 2. May 10, 09:57

I love your stuff and use it!Script work well now!
And one day ... one day i will be there ...
And if not... then i will be here ...

Me

Gripen
Posts: 88
Joined: Fri, 12. Jun 09, 12:10
x4

Post by Gripen » Sun, 2. May 10, 12:52

Sweet! Will try this out after exams :)

Gripen
Posts: 88
Joined: Fri, 12. Jun 09, 12:10
x4

Post by Gripen » Mon, 3. May 10, 16:50

Hmmm seems to be an incompability with this and Dynamic Product Pricing, where i usually activate it the command on a factory is replaced with the blueprint thingy.

Edit: and i cant figure out how to re' software :(

myshkin
Posts: 18
Joined: Thu, 17. Nov 05, 12:52
x3tc

Post by myshkin » Mon, 3. May 10, 17:59

Just had a quick search of the forum, and managed to track down the command slot for dynamic product pricing, there is a conflict there. I'll post v2.01 later today to fix that.

To RE anything, you need at least one unit to be in your HQ, so the question is more how to get software in your HQ? I'd suggest a script such as dockware manager, add the software as a product of your HQ, then transfer the software from one of your ships to your HQ.

Then, as you now have a unit of the software present in your HQ, you can RE it. :)

Gripen
Posts: 88
Joined: Fri, 12. Jun 09, 12:10
x4

Post by Gripen » Mon, 3. May 10, 18:28

I tried dockware manager, however the problem is that you cant att a software as tradable ware :/

myshkin
Posts: 18
Joined: Thu, 17. Nov 05, 12:52
x3tc

Post by myshkin » Wed, 5. May 10, 13:02

compatibility issues and software blueprinting addressed. Little late with this update, since i couldn't remember how i got a jumpdrive in my HQ, so version 2.01 became 2.1...

WBM 2.1

- changed the command id to 1143 for compatibility with Dynamic Product Pricing.

-Added a new command, Transfer Ship Extension, so you can move ship extensions like software to your HQ to blueprint them. To prevent using the command to hoard ship extensions in your HQ from every ship you cap or want to sell, the command costs 1m credits + avg price of software.




In other news, I've been toying with a couple of other script ideas...

pirate alley revival

The first is an addition to Pirate Guild to help it work better with Military Base Response. When i say addition, i mean more of a hack. Essentially it revives 'pirate alley' from hatikvah's faith to split fire.

My experience was that i had two problems when using rearguard forces, firstly that unless i raised xenon tokens to a 3 or 4x mutliplier, the xenon sectors were permanently clear and never launched attacks on neighbouring sectors, and secondly that even then pirate alley was far too safe for traders, with race capital ships often camped out in them for long periods. With such a high multiplier for xenon i also had the issue of occasional super-invasions where they'd clean out 3 straight sectors before being subdued.

So to counter that, i made a script that spawns a pirate base in each of the pirate sectors in the alley, along with a defensive brigantine. Additionally, since Hatikvah's always bears the brunt of MBR's wrath, it gets a second base, brigantine, and a shipyard. Freedom's reach also gains a pirate shipyard. If the brigantines get killed, they'll respawn after a while.

The effect seems to be that MBR now splits the main race invasions between the xenon and pirate alley; pirate alley has some active pirates but isn't a death trap for all who enter, and xenon forces get enough slack that on a token multiplier of 1 or 2 they can build up sufficient forces to defend their sectors and launch occasional offensives too. Race capital ships still try to invade pirate alley sectors, actually quite often, but they take noticable losses before quitting or (if 2 races team up on a sector) destroying the defensive brigantine(s).

An additional side effect, at least with PG set to High guild strength, they have enough forces to mount their own sector invasions on rare occasions.

PG actually takes ownership of the bases and the brigantines when they're created, so it's free to use them for PG missions too.

I'll keep testing this to see how it plays out in the long term, and get permission from Serial Kicked before i look at releasing it though.


hey, i know that ***hole!

Obviously a WIP script title, this is a pretty simple idea. Ever had some ship ruin your plans or offend you somehow? An M2 that blew away your cap target and all your marines onboard, the xenon Q that destroyed your UT in grand exchange, or the pirate caravel that nearly killed you back when you started your current game?

This script will give a hotkey command that notes the IFF code of the ship you wish to remember and revenge yourself upon later. A ship command lets you view your list of currently noted ships, their IFF code, and a toggle option that lets you receive an alert when any of your assets spot said ship.

The idea being to add some sense of identity to the numerous NPC ships that cross you. It's possible to just jot down their IFF on a piece of paper currently, but i think it'd be fun that instead of remembering some Paranid Agamemnon shot down your first sector trader, you can now record exactly which one, and when the mood takes you, receive alerts when he's next spotted and return the favour.


Either of those sound worthwhile scripts? :)

Gripen
Posts: 88
Joined: Fri, 12. Jun 09, 12:10
x4

Post by Gripen » Thu, 6. May 10, 11:55

Ah, the awaited update, thanks!

alemarazza
Posts: 33
Joined: Sun, 9. Apr 06, 17:48
x4

Post by alemarazza » Sun, 9. May 10, 16:47

Hey myshkin

I tried your script and upgraded my HQ. The wares I had transfered succesfully in the new HQ, but the blueprints I had before the upgrade were lost in the process. Any idea what went wrong?

AL

lordmuck
Posts: 1736
Joined: Sun, 1. Mar 09, 12:25
x4

Post by lordmuck » Sun, 9. May 10, 22:30

Just downloaded the 2.1 @ 10% only version, I did have the previous version installed , this wont cause a problem as I already deployed the PHQ and had it upgraded with your previous version?.

Anyway will find out soon. Thanks for looking after your mod

myshkin
Posts: 18
Joined: Thu, 17. Nov 05, 12:52
x3tc

Post by myshkin » Mon, 10. May 10, 09:23

@lordmuck

so long as you're upgrading WBM to the same flavour, ie. 10% version to 10% version, it's fine.

You only need to re-upgrade your phq if you're switching flavour, ie 10% version to 10%+50% version. :)



@alemarazza

Could you post some more info about your HQ? When was it originally created, that is, which patch version (2.1 or 2.5 etc)? Also if you could post what blueprints it contains that aren't being carried over with the upgrade? Lastly if you're using any mods that add ship types or alter ship properties, post that too. thanks. :)

oh quick edit, the game language too? i think WBM has only been tested with english.

I'll check if there's any issues with that info, and post a debug version if needed. :)

another quick edit: If anyone else has upgraded their HQ and lost their blueprints in the process, do please post!

alemarazza
Posts: 33
Joined: Sun, 9. Apr 06, 17:48
x4

Post by alemarazza » Mon, 10. May 10, 16:45

Ok, here some informations on my HQ:

- it was created with version 2.1 of X3TC
- the new HQ did not carry over any of the blueprints (I had about 20 blueprints of various ship types)
- I don't use any mods that changes ship proprietes or add ships
- Maybe the problem is that I have 2 HQ (I purchased one with the mod "The Marauder Shipyard")

Strange is, that the wares carry over correctly, just the blueprints don't.
The first time I install your mod, even before I upgrade the HQ, I don't see any blueprints in your menu in any of my HQ.

I hope this helps

AL

myshkin
Posts: 18
Joined: Thu, 17. Nov 05, 12:52
x3tc

Post by myshkin » Mon, 10. May 10, 17:21

Ah there's the issue, you have two HQs.

The script commands egosoft provides for blueprints don't let you specify a HQ, they work on the HQ. That's to say, the script commands assume you have only one HQ.

As far as i know, if you do have multiple HQs, the script commands operate on the most recent HQ that you built.

I'm not entirely sure how to work around that, if your newer HQ doesn't contain any blueprints, you can probably just self-destruct it, and then your old HQ becomes the HQ so far as the game is concerned.

Considering that the WBM HQ upgrade command was giving you a new HQ without any blueprints, my guess is that your Marauder Shipyard HQ has no blueprints? In which case i'd recommend the following procedure...

1)self-destruct your marauder shipyard HQ (ensure it's empty etc)
2)run the Upgrade HQ in the WBM menu of your actual PHQ
3)rebuild your marauder shipyard HQ
4)build your upgraded HQ from the delivery orca
5)Restore previous HQ contents in the WBM menu of your upgraded HQ

That should work, because so far as the game thinks, when you upgrade your PHQ it's the only HQ you own (step 2), and when you restore it's contents then it's the newest HQ you've built (step 4).

So just to be clear, when you run Upgrade HQ in WBM, your phq should be the only HQ you own, and when you restore HQ contents in WBM your phq should be the most recent HQ that you've built. You want to build your maurader shipyard inbetween the two events so that if you use the Add Ware... command in WBM, those blueprints are added to your newest HQ, your phq, and not the shipyard.

alemarazza
Posts: 33
Joined: Sun, 9. Apr 06, 17:48
x4

Post by alemarazza » Mon, 10. May 10, 19:39

Well, I tried to destroy one HQ and upgrade the other, but still no blueprints.

Both HQ have the same blueprints, so I don't think this issue is related to which HQ was first built.

Anyway the ware carry over works as it should, even with two HQ.
I think I will produce the ships I can't buy, then upgrade the HQ and get thoso blueprints again.

Beside this little problem your script is very useful.

If I find a solution I will post it.

Thanks for your work.

AL

Post Reply

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