Auto Factory Deployer

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

JumperBR
Posts: 163
Joined: Wed, 6. Nov 02, 20:31
x2

Auto Factory Deployer

Post by JumperBR »

Hi,
I´ve made recently a new script, this one I run into a ship and this becomes a auto factory deployer, works like this:

* Script is started
* a M6 is bought (well, could be any ship, a M6 sounded cool), this is the main ship
* a M5 is bought (fast), this one is going from sector to sector to find suitable spots for stations. It´s the Locator Ship.

*The Locator ship goes from sector to sector and get a list of all resource wares and how many stations use each ware and esclude the wares already served by the player, so no repeat stations in same sector), It only checks the current sector, the neighbours sector are not accounted.
* The Deployer ship use a logic like this:
- if has money and has a factory set
- get sector where to buy that factory type, get´s there
- check if there is any TL in the sector, if exists, it take control of the ship and sends it to the shipyard, buy station and deploy it at designed sector.
* The TL is released and the fee (10k per sector) is deducted from the player.
* The station is initialized, it runs my script AutoStation (buy ships and set them to trade)
* The station is renamed following a convention, like: Hornet Missile 1 f3 j2, (first Hornet Missile factory, with 3 freighters working on 2 jumps, this is usefull to change max jumps manually later.


I need some help in this:
- There is any way to hire a ship via script?
- There is any way to change the sectors jumps in stations via script? It´s the only thing that I have to manually do.

My question is, there is anyone interested in this script?
My initial idea was to make competitors, but using it with myself is a bit cooler. :D
Mai ingrish iz gud?
AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw »

Player Stations can only be 'constructed' while player is in sector.
Unless you found a way around that, this whole script may well be a waste of your effort Jumper.

I know some scripts 'create' stations, like the Wheat Farm you get. But how that deploys the station is pretty oddball. To 'purchase' a particular station from a dock, include the hired ship, move to the destination desired, and 'deploy' that ship the same way a player would do it may well be a problem.
JumperBR
Posts: 163
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JumperBR »

Strange, my script works fine even when Im not in the sector...
I use the create station command...

What I did was to take control of the TL ship, dock at the shipyard, add via script the factory, deduct the price, move the deployer to the location, wait to the TL to arrive (via follow me), create the station and deduct the fee for travels (almost like a hired ship would), releasing the TL to return to its sector.
The difference is that the "hired" status doesn´t appear in the TL.
Mai ingrish iz gud?
User avatar
milling_hordesman
Posts: 372
Joined: Mon, 1. Mar 04, 06:16
x3

Post by milling_hordesman »

yeah, create station does work fine, whether or not the player is in the sector.

no, i don't know of a way to hire a ship via scripting, but that's just because i've never looked into it before.

and no, i'm almost certain there's no way to change the maximum trade jumps via scripting.
//----------------------------------
--the milling_hordesman

Me Mods
AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw »

That's because you aren't "Hiring" it. You're merely turning the control of the ship's AI over to your script. ((Turning it into one of your ships temporarily.))

All the immersion effects of 'hiring' and such are player controlled, and require you to be there. (In Sector) to do the hiring, as far as I know. If there's a script for it, it's buried under mounds of data. *Hands you stack of files about four feet tall.*

All your script is doing is running the known shortcuts around the real commands.
D_Zorro
Posts: 2027
Joined: Wed, 6. Nov 02, 20:31
x3tc

Re: Auto Factory Deployer

Post by D_Zorro »

JumperBR wrote:Hi,
I´ve made recently a new script, this one I run into a ship and this becomes a auto factory deployer, works like this:

* Script is started
* a M6 is bought (well, could be any ship, a M6 sounded cool), this is the main ship
* a M5 is bought (fast), this one is going from sector to sector to find suitable spots for stations. It´s the Locator Ship.

*The Locator ship goes from sector to sector and get a list of all resource wares and how many stations use each ware and esclude the wares already served by the player, so no repeat stations in same sector), It only checks the current sector, the neighbours sector are not accounted.
* The Deployer ship use a logic like this:
- if has money and has a factory set
- get sector where to buy that factory type, get´s there
- check if there is any TL in the sector, if exists, it take control of the ship and sends it to the shipyard, buy station and deploy it at designed sector.
* The TL is released and the fee (10k per sector) is deducted from the player.
* The station is initialized, it runs my script AutoStation (buy ships and set them to trade)
* The station is renamed following a convention, like: Hornet Missile 1 f3 j2, (first Hornet Missile factory, with 3 freighters working on 2 jumps, this is usefull to change max jumps manually later.


I need some help in this:
- There is any way to hire a ship via script?
- There is any way to change the sectors jumps in stations via script? It´s the only thing that I have to manually do.

My question is, there is anyone interested in this script?
My initial idea was to make competitors, but using it with myself is a bit cooler. :D
If it works sure i will try it. Where do i sign up :D


DZorro,
System spec: Pentium (R) D 2.66 Ghz, Ram : 2048 DDR, HD : 250 GIG 7200 RPM intern 8 MB cash
Videocard : Nvidia Geforce 8800 GTS 320mb : Realtek
Laptop : AMD athlon 64 3200 + 1024 DDR 80 gig HD Conexant AMC Audio, Ati mobility Radeon Express 200
JumperBR
Posts: 163
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JumperBR »

Hi,
I´ve placed the FactoryDeployer-0.9b.zip at this link:
http://br.f1.pg.briefcase.yahoo.com/bc/ ... bc&.view=l

Start the script via Compet.HQShip.init (it´s a little cheat that creates a Osprey and adds 5mil to the player for testing purporses, if you want to start in a already existent ship, just run Compet.HQShip over the desired ship), run at your ship to start in your sector.

This is still beta, I haven´t made commands for it, so the "Factory Deployer" will appear with command "none" on it.

Also, install the AutoStation, it´s on the same link above and the FATE auto buy and sell is needed for the AutoStation to run properly.

After all this, go SETA and keep watching your Deployer as it goes...
Mai ingrish iz gud?
D_Zorro
Posts: 2027
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by D_Zorro »

I tried the link but it's all spanish and i can't download anything from there. :?


DZorro,
System spec: Pentium (R) D 2.66 Ghz, Ram : 2048 DDR, HD : 250 GIG 7200 RPM intern 8 MB cash
Videocard : Nvidia Geforce 8800 GTS 320mb : Realtek
Laptop : AMD athlon 64 3200 + 1024 DDR 80 gig HD Conexant AMC Audio, Ati mobility Radeon Express 200
JumperBR
Posts: 163
Joined: Wed, 6. Nov 02, 20:31
x2

Post by JumperBR »

Try this now: http://www.x2source.com/mods/uploads/Fa ... r-0.9b.zip

It´s just temporary. This weekend I pretend to make a nice release, this is just beta.

And, by the way, it´s portuguese, not spanish.
Mai ingrish iz gud?
D_Zorro
Posts: 2027
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by D_Zorro »

Thanks i tried it but how do i activate your mod ?? witch file do i highlight to get it to work ??? I tried it but it didn't do nothing for me. :?


DZorro,
System spec: Pentium (R) D 2.66 Ghz, Ram : 2048 DDR, HD : 250 GIG 7200 RPM intern 8 MB cash
Videocard : Nvidia Geforce 8800 GTS 320mb : Realtek
Laptop : AMD athlon 64 3200 + 1024 DDR 80 gig HD Conexant AMC Audio, Ati mobility Radeon Express 200

Return to “X²: The Threat - Scripts and Modding”