EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[Script] Headquarters Management and Upgrade Framework - [1.1][updated 25/07/09]
Post new topic Reply to topic Goto page 1, 2, 3, 4  Next
View previous topic :: View next topic
Author Message
Osiris_sam





Joined: 24 Aug 2006
Posts: 422 on topic
Location: UK
Thank you for registering your game
modified
PostPosted: Fri, 3. Jul 09, 01:44    Post subject: [Script] Headquarters Management and Upgrade Framework - [1.1][updated 25/07/09] Reply with quote Print

Headquarters Management and Upgrade Framework

Overview:
Manages Station Credits
Manages autotraders
Manages Station Traders
Produces Reports

pink ftw
Download:[.rar] ~ SPK included
Trader Description and details: See V1 update notes

Alternative download link from xdownloads:


Installation:
1)Download the .rar and either
- Open the .spk file to auto install the script
-requires Cycrows Plugin Manager

- Extract the t folder to the respective *x3TC directory*/t folder, and scripts to the *x3TC directory*/Scripts folder


Description:
The ingame headquarters description brings 4 elements to your attention:
1)Credit Management
2)Locations
3)Ware Control
4)Profitability analysis

Recommended/compatible scripts
The HQ management will interact with the following scripts:
Commercial Agent (CAG) by Lucike
Economy and Supply Trader (EST) by Lucike


1) Credit management:
Once activated, this script will maintain an amount, set in the configuration menu, to all the stations you own. Profits will be Transfered back to the HQ. These are logged, and then sent back to the player ~ if using the built in money transfer

2)Locations:
The script can produces reports on the homebase locations of all of your mk3 autotraders (and ESTs) and your stations.

3)Ware control:
Again, the script can produce a report, detailing all the products you produce, and factories that produce them. This can come in the form of a logbook entry, or as a menu.
The menu will produce details on factories; for a given product.

4)Profitability analysis:
I tried to have some fun with this, but x3 doesnt like decimals... so its kinda plain. The advanced money transfer stores the last 20 pre-transfer amounts in a list, which is accessable. These values can be written to a report, or two values, selected from a menu, can be compared.


Some other features:

Autotrader assignment:
The script will assign autotraders using suitable ships the HQ owns (which arn't doing anything else, dont worry, your CLS delivering goods is safe)
An upper limit is set using the configuration menu, and gradually, the script will assign traders up to this limit. Setting this limit below the amount of traders you already have will cause the script to not hire any more. This script can automatically assign ESTs (providing you have the script installed). This option is also available on the configuration menu.

Station trader assignment:
Like the autotrader assignement. This module (yes im comming to that) automatically assigns suitable ships the hq owns to stations that dont own any. If you have CAG installed... the script will automatically assign these. otherwise, you will have to set them up yourself to do whatever.


Menu System
Main Menu


Begin Hq Automation:Start the automation system.

Change number of Autotraders: Change the number of automatically assigned autotraders (default [disabled] )

Toggle use of ESTs: Enables or disables the use of ESTs as default autotraders (default [disabled])

Change Station Fund Amount: Prompts you to enter the amount to be maintainted at your stations (default 200,000)

Module Options: Opens the Module Options Menu

Ware Report: Opens either the the ware information menu, or sends a report. Type of report is set in the Module Options -> Ware Management menu

Locations Report: Sends a locations report to you.


Module Options Menu


Create Report on Installed Modules: A list of the installed modules and a breif description will be sent to you.


Installed Modules: This list will change based on what modules you have installed. By default. The three modules shown above are installed (along with 2 preinstalled modules)

Credit Transfer Management


Write History to Log: Writes the last 20 reports to your logbook


Write History to Log: Compare two Entries from the last 20. This will bring up two menus. Select an entry in the first menu and the second and you will get a comparison of the two. Selecting one in the first menu and not the second, will show you the entry you selected.

Change Upper Limit: Change the upper limit for HQ funds.

Change Lower Limit: Change the lower limit for HQ funds. Setting this to 0 will disable it. If your HQs funds drop below this limit, then it will take money from the player account (if available) to make it up.

Reset Profit History: Delete existing entries.


Uninstall: Self explanatory. Note: this will only uninstall until your next load. To completely uninstall this module, open the script editor, find setup.plugin.hq and delete, or comment out line 58

Station Trader Management


Uninstall: Self explanatory. Note: this will only uninstall until your next load. To completely uninstall this module, open the script editor, find setup.plugin.hq and delete, or comment out line 56

Ware Management


Change Report Type: Change the type of report displayed by the 'Ware Report' option on the main menu


Modules
This script is designed to have new modules linked to it. This is very easy to do. Any script writers who wish to have a go ~ details on how to do this are in the next post.

Inbuilt Modules

-> Station Fund Management
-> Autotrader Management

Pre-Installed Modules

-> Station Trader Managemnt
-> Ware Management
-> Credit Transfer Management

External Modules

-> Station Stock Manager


Ok; This script is finished, and bug free as far as i have tested.
I havnt written a readme yet, so if you have any questions, post them here, and i will answer them (or at least try).

Please report any bugs by posting them here. Also please (please please please) give me feedback ~ i want to know what you think; good or bad

Technical Details:

Command Slots used:

<t id="1144">COMMAND_TYPE_STATION_44</t>: HQ Operations: Automate

Custom Command: 8200

Text file:

8200 - L044
6000 - L044 - page 8200

Credits:
S9ilent for his smashing (livesaver) hub/station check library

Version History:
V1.1
- New module interfacing
- Modules require purchase now (already installed modules do not need to be puchased again)
- Module menu system now on the main menu page, not a seperate one
- Some bug fixes
- Community plugin manager menu system

v1.0 ~ Official beta [.rar]
- New Station Stocking
- Some modifications to the menu
- one or two bug fixes

v0.7 ~ initial Release
[0.7]


Edit [6th Dec 2015]: Added alternative download link from xdownloads. X2-Illuminatus


_________________

my scripts: TC:HQ Management and upgrade framework


Last edited by Osiris_sam on Sat, 25. Jul 09, 03:35; edited 6 times in total
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Osiris_sam





Joined: 24 Aug 2006
Posts: 422 on topic
Location: UK
Thank you for registering your game
modified
PostPosted: Fri, 3. Jul 09, 01:44    Post subject: Reply with quote Print

In the next version i will be overhauling the module system for a much more friendly method installing. (plus cost for balancing the effects)

Quote:
Guidelines for Module addon creation: should you wish to make one.

This script will run any addon that is hooked onto it. But remember... this script will call your addon periodically.

To start with, you need 3 scripts.
an admin script,
a config menu script
and a execute script

The admin File:
This is the script that will interface with the framework; To save time, this can be copied (the example below has notes to assist, should you wish to make one, it can be found in the scripts folder.)

Code:

Script plugin.hq.station.trader.admin
Version: 7
for Script Engine Version: 43

Description
Module - Station traders - admin
Arguments
1: task , Var/String , 'task'
Source Text

001   * 2009 - osiris sam - hq automation framework - modular addon admin script
002   * Station trader management
003   
004   $pageid = get global variable: name='hq.pageid'
005   
006   * Definition of tasks to complete - the various tasks the script can do.
007   * these do not need to be saved as variables, but i find it helps.
008   $null = null
009   $install = 'INSTALL'
010   $Uninstall = 'UNINSTALL'
011   $run = 'RUN'
012   $Menu.opt = 'MENU.OPTION'
013   $config = 'CONFIG'
014   
015   $scr.name = get script name
016   * the all important script name. note that this script will be the one called up
017   * by the hq framework. the tasks below are the minimum tasks for the script to
018   * function correctly
019   
020   if $task == $install
021   * call the install/uninstall script
022 @ |$retvar = $null -> call script 'plugin.hq.module.hook' :  Scriptname=$scr.name  task=$install
023   |
024   else if $task == $Uninstall
025   * call the install/uninstall script
026 @ |$retvar = $null -> call script 'plugin.hq.module.hook' :  Scriptname=$scr.name  task=$Uninstall
027   |
028   else if $task == $run
029   * call the function execution script - the main script of your module
030 @ |= [THIS] -> call script 'plugin.hq.sttrader.main' :
031   |
032   else if $task == $Menu.opt
033   * load the text from the text file to be displayed on the framework menu system
034   * the text should be returned in an array. element 0 should be the heading
035   * element 1 should be a brief description of the module
036   |$retarray =  read text: page id=$pageid, from 2000 to 2001 to array, include empty=[FALSE]
037   |return $retarray
038   |
039   else if $task == $config
040   * call the configuration menu
041 @ |START [THIS] -> call script 'plugin.hq.sttrader.config.menu' :
042   |
043   end
044   
045   return null


pageid ~ load the text file id that you will be using, mine is 8200
task ~ what task is this script going to run

script name ~ this is how the scripts interact, make sure this line is in there.

Install ~ register your addon with the script, done by calling plugin.hq.module.hook with task INSTALL

Uninstall ~ Unresigester your script, again by calling plugin.hq.module.hook but with task UNINSTALL

run ~ call the script which makes your addon do what it does

Mod opts (module options) ~ an array containing the display name of your script, and a breif description. name=Array[0], description=Array[1]

Config ~ call the configuration menu for your addon



The modules are first installed by setup script, along with loading the other things you need:
text files, hotkeys

you need a line which looks like
Code:
055   * install default modules
056 @ = $null -> call script 'plugin.hq.station.trader.admin' :  task='INSTALL'
057 @ = $null -> call script 'plugin.hq.ware.admin' :  task='INSTALL'
058 @ = $null -> call script 'plugin.hq.transfer.admin' :  task='INSTALL'


To be safe, load the game with the framework installed at least once before you install another addon

If you're unsure of any part of this, drop me a pm... im happy to help.



_________________

my scripts: TC:HQ Management and upgrade framework


Last edited by Osiris_sam on Fri, 17. Jul 09, 19:39; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Lancefighter





Joined: 19 Dec 2004
Posts: 2936 on topic

Thank you for registering your game
PostPosted: Fri, 3. Jul 09, 08:52    Post subject: Reply with quote Print

thats pretty cool - i remember this from x3r..

I just got one question - does it work this time?

I mean, if I give it my HQ and a sum of money (say, 10 mill), will it be able to stock the HQ for production (will it queue production/repair tasks?) and make a profit through est/ut?

You also say that it manages your stations.. So I can plop down stations, and it will 'take care' of them?

You say that it transfers money to/from the player, would it be possible to remove the player wallet from this, and instead use the HQ wallet, and request funds from the player if it needs to, through a incoming message? (i see it being like "attention, your headquarter wallet is under the recommended minimum, we need a bailout!"

It seems like a brilliant idea, if done right (i probably said the same last time), and i want to make sure it does what you say it does first Wink

edit!
Does it DEFEND itself? Will it defend its factories or transports?


_________________
in the market for a new sig, willing to pay 1 billion credits for a proper sig...
Back to top
View user's profile Send private message
Osiris_sam





Joined: 24 Aug 2006
Posts: 422 on topic
Location: UK
Thank you for registering your game
PostPosted: Fri, 3. Jul 09, 12:49    Post subject: Reply with quote Print

Yes, it does work. ive tested each functions, but that doesnt mean i havnt overlooked bugs (not intentionally ofc)

No, atm, it wont stock the HQ for production ~ but this could be written as an addon (maybe). EST/UT profit still goes to the player, the script doesnt monitor that ~ i need to ask someone more on terms with that script to find out exactly how money is transfered before i attempt that

If you plop down a station, it will do 2 things.
Firstly it will give the station X credits (default 200,000) ~ setting on the config menu
If the HQ has an unused TS (only TS) landed on it, with the HQ set as homebase, it will assign this ship to the station, either as a CAG (if installed).
If no cag is installed... then you will need to set the trader up (im not writing a very basic station manager script - i hate trade scripts)

The HQ will not;
set ware prices, although a module for this is probably possible
pre-stock the station, also possible through module... but probably pushes the 'the script is playing my game' boundry

The transfer script could be modified to have another source, a private bank if you will, but i dont see the advantage of this over taking directly from the player ~ either way, the player is gonna have to put money into it.
The lower limit can be disabled, so the script basically becomes the default egosoft script with profit management inbuilt

ATM, it doesnt defend itself. or factories, or transports.
the way i see it, the trade scripts in existence - apart from the stock ones, have enough warnings (message book, incomming messages, etc...) for you to protect your own ships.
(not defending your HQ is a kinda bad idea ~ unless you dont mind cheating another one in)

final note: this isnt the same script as X3:R, even if it has some of the same functions... the are most likely executed in a completely different way. (even the credit distrubution code, believe it or not)


_________________

my scripts: TC:HQ Management and upgrade framework
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Lancefighter





Joined: 19 Dec 2004
Posts: 2936 on topic

Thank you for registering your game
PostPosted: Sat, 4. Jul 09, 03:44    Post subject: Reply with quote Print

Looks pretty good - I may use this to manage my HQ and stations... After i find someplace to put it lol


_________________
in the market for a new sig, willing to pay 1 billion credits for a proper sig...
Back to top
View user's profile Send private message
Osiris_sam





Joined: 24 Aug 2006
Posts: 422 on topic
Location: UK
Thank you for registering your game
PostPosted: Sat, 11. Jul 09, 03:50    Post subject: Reply with quote Print

Version 1 Release
[.rar]

Changes:
- Some bug fixes
- Some improvements to the menu system

- New module - Station Stock Management

New Module overview:

Lancefighter wrote:

You also say that it manages your stations.. So I can plop down stations, and it will 'take care' of them?

Now it does

Description
The Station Stock Module will stock newely built stations using a designated trader.
This script comes with a custom trader script which will be described in more depth in this post.
Stations will be stocked to 20% by default... but this amount is changeable through the normal configuration menu

Trader Functions

The trader can be assigned to any station or TL.
The Homebase must be set, but it can be set to another station

Setting the homebase to the same station as the one you designate to supply will lock the ship to the station, i.e it will continue to supply that station continuously. Otherwise it will stock it once and then return home.

To assign the ship to a tl ( which will unload specified wares from the ship to the homebase) a station homebase must be set. Choosing a TL as the stock target will open a list of wares, and then asks if it should be locked to the task.

any questions, comments, bugs or feedback PLEASE post them here


_________________

my scripts: TC:HQ Management and upgrade framework
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Lancefighter





Joined: 19 Dec 2004
Posts: 2936 on topic

Thank you for registering your game
modified
PostPosted: Sat, 11. Jul 09, 04:06    Post subject: Reply with quote Print

edit
nvm


_________________
in the market for a new sig, willing to pay 1 billion credits for a proper sig...


Last edited by Lancefighter on Thu, 16. Jul 09, 11:38; edited 1 time in total
Back to top
View user's profile Send private message
Nho





Joined: 24 Feb 2006
Posts: 180 on topic

Thank you for registering your game
PostPosted: Thu, 16. Jul 09, 11:12    Post subject: Reply with quote Print

Sounds great! I just need an HQ to try it Smile

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





Joined: 24 Aug 2006
Posts: 422 on topic
Location: UK
Thank you for registering your game
PostPosted: Sat, 25. Jul 09, 03:34    Post subject: Reply with quote Print

Version 1.1 Released (25/07/09)

Download:[.rar]
V1.1
- New module interfacing
- Modules require purchase now (already installed modules do not need to be puchased again)
- Module menu system now on the main menu page, not a seperate one
- Some bug fixes
- Community plugin manager menu system

End note:
Please provide feedback, i want to hear what is good or bad about this, bugs or otherwise.


_________________

my scripts: TC:HQ Management and upgrade framework
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
TingTung





Joined: 11 Aug 2009



PostPosted: Tue, 11. Aug 09, 13:32    Post subject: Reply with quote Print

How exactly do you get the scrip to work? I've installed it using the SPK, but when I build an HQ in game I can't do anything special with it.

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





Joined: 24 Aug 2006
Posts: 422 on topic
Location: UK
Thank you for registering your game
PostPosted: Tue, 11. Aug 09, 14:02    Post subject: Reply with quote Print

once the phq is built and the script is installed, open the hq command console, select a free command slot (as you would to activate any other command). HQ operations: automate should be on the list of available commands.
Selecting this, will bring up the menu, from which you start the system and change settings.

If that command fails to appear, could you pm me a list of the scripts you have installed. as well as;

could you also check that the text files are of the correct version (the script will not load unless the text files are the correct version)
this can be found by opening t/ 8200-L044.xml
on the first entry <t id="0"> the number should be 11 ( for version 1.1).
a message is also added to your log if the script is terminated in this way, checking for that will save you the hassel of opening the text file. (depeding how cluttered your logbook is Razz, a new message should appear at each load if the t file is wrong)


_________________

my scripts: TC:HQ Management and upgrade framework
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
TingTung





Joined: 11 Aug 2009



PostPosted: Wed, 12. Aug 09, 19:28    Post subject: Reply with quote Print

Alright, that's the problem, using the cheat plugin, I added a Headquarter to a TL and then built it. When it was built I looked into the command slots to see what I could and nothing about station management was in place.

Installed plugins are as follows :

Cheat Collection Package
HQ Management
Property Baron

Also, your 1.1 SPK is broken, it's updating something that doesn't have the same name. The version numbers can be different but the package name can't be.

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





Joined: 24 Aug 2006
Posts: 422 on topic
Location: UK
Thank you for registering your game
PostPosted: Thu, 13. Aug 09, 18:51    Post subject: Reply with quote Print

a cheated in hq should work just fine (i tested this way). its more likely due to the spk problem. im not sure how that has arisen, i actually just changed the first file :\. ill fix and reupload.


_________________

my scripts: TC:HQ Management and upgrade framework
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
TingTung





Joined: 11 Aug 2009



PostPosted: Fri, 14. Aug 09, 16:24    Post subject: Reply with quote Print

Perhaps it's the version of X3 I'm running? I'm on 1.4

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





Joined: 24 Aug 2006
Posts: 422 on topic
Location: UK
Thank you for registering your game
PostPosted: Sat, 15. Aug 09, 15:26    Post subject: Reply with quote Print

that is also an issue, this script was written and tested in 2.0/1, so its probably not compaitble with 1.4


_________________

my scripts: TC:HQ Management and upgrade framework
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2, 3, 4  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 Tue, 30. May 17, 09:19

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.86349 seconds, sql queries = 30