[Script] HQ build ships - auto upgrade v1.4 [Updated 22/02/2007]

The place to discuss scripting and game modifications for X³: Reunion.

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

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

[Script] HQ build ships - auto upgrade v1.4 [Updated 22/02/2007]

Post by DeltaWolf » Wed, 6. Dec 06, 09:59

Idea came from sc_hornetAMF see this

Readme:

Code: Select all

Auto upgrade and Auto Dock commands v1.4

Two new commands:

1) Auto Upgrade: (v3)
Activated via Station command console

This will upgrade a docked ship with max Engine Tunings, Rudder optimization, and Cargo space, and install Navigation Software, Trade Command Mk1, Trade Command Mk2, Fight command Mk1, Fight Command Mk2 Special Command Software, and Triplex scanner
It will do this for all your ships as long as you've got enough credits.

It will also add the max shields to your ship, if the shields are available on the station.(Bought or made by player)

2) Auto Dock (v2)
Activated via Station command console

This will find all your ships in the same sector as the station, if it is doing noting eg command is NONE, it will tell the ship to dock at the selected station (if possible)

text file / text id used : 8970

Commands used:

<t id="1152">COMMAND_TYPE_STATION_52</t>
<t id="1153">COMMAND_TYPE_STATION_53</t>

Download:

Zip file : here
Spk file: here (plugin manager required from here)

version history:
v1.4 - fix some errors
v1.3 - fix problem with cost being too high
v1.2 - player ship will be ignored when the autodock command is running
v1.1 - fixed small error, improved programming
v1.0 - added shields to upgrades
v0 - initial release
Last edited by DeltaWolf on Thu, 22. Feb 07, 07:26, edited 5 times in total.

djkaos
Posts: 74
Joined: Fri, 5. Mar 04, 00:19
x2

Post by djkaos » Wed, 6. Dec 06, 11:01

Very handy. Good job :thumb_up: Does it give them shields?

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Wed, 6. Dec 06, 11:48

No - you have to install that yourself

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Wed, 6. Dec 06, 12:32

djkaos wrote:Very handy. Good job :thumb_up: Does it give them shields?
Extending it shouldn't be a problem! Good job! :thumb_up:

xalien
Posts: 2252
Joined: Fri, 12. Mar 04, 01:03
x4

Post by xalien » Wed, 6. Dec 06, 12:32

A suggestion - add an option to install jumpdrive/transporter IF you have a good enough rep with Argons (for jumpdrive only) or Goners (for both) to sort-of buy them.

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Wed, 6. Dec 06, 13:19

plugin.upgrade.ship

Code: Select all

118   * --- Fit max shields
119      $money = get player money
120      $shield.type = $ship -> get max. shield type that can be installed
121      $max.shields = $ship -> get number of shield bays
122      $shield.cost = get average price of ware $shield.type
123      $up = $ship -> get true amount of ware $shield.type in cargo bay
124      $cost = $max.shields * $shield.cost
125      if $money > $cost
126       if $up < 1
127        $cost = $cost * -1
128        = $ship -> install $max.shields units of $shield.type
129       end
130      else
131       goto label nomoney
132      end
133   * --- Fit max shields
Hope that works! :D Can't test it cuz I have yet to build anything at my PHQ.

DeltaWolf hope you don't mind...

The same idea can be added to include anything else you want in your PHQ-built ships, as long as the requisite checks are made.

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Wed, 6. Dec 06, 13:51

Yes I do relize that, but the whole idea was to add basic stuff so that you don't have to send the ships you build to an Equipment dock to get Engine Tunings and Rudder optimizations, eg equipment you can't make yourself. It's a balancing question - I don't want to make it too easy for the player.

Shields you can make yourself and transport it to your HQ.

Jumpdrives and other software, you still need to buy at Terracorp HQ or Goner temple (that's the way it's suppose to be :D )

Nothing stops you from adding other equipment to the script yourself.

fud
Posts: 9837
Joined: Wed, 25. Jan 06, 14:26
x3

Post by fud » Wed, 6. Dec 06, 14:05

Wow, long time no see.

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Wed, 6. Dec 06, 14:31

Yes I'm back :twisted:

Cedrk
Posts: 79
Joined: Sat, 8. Jul 06, 01:59
x3tc

Post by Cedrk » Thu, 7. Dec 06, 02:34

Can you make the script check for shields from the station items and install them as well

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Fri, 8. Dec 06, 07:18

Cedrk wrote:Can you make the script check for shields from the station items and install them as well
Done - see new version

Cedrk
Posts: 79
Joined: Sat, 8. Jul 06, 01:59
x3tc

Post by Cedrk » Sat, 9. Dec 06, 00:28

Thanks Delta

I did think about weapons as well but I don’t think it would be a good idea because you might want different weapons on different ships.

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Sun, 10. Dec 06, 14:32

DeltaWolf, is it me or did you forget to deduct the credits for some of the software extensions?

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Mon, 11. Dec 06, 07:27

Yes I did forget :D

Fixed in new version.

rubberman
Posts: 120
Joined: Wed, 6. Nov 02, 20:31
x4

Post by rubberman » Mon, 11. Dec 06, 13:10

Auto dock function appears to effect the playership as well, most disconcerting when fighting pirates in the same sector as my HQ to find the autopilot take control and suddenly change course a head for the HQ.


:?

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Mon, 11. Dec 06, 13:44

Never thought of that :oops:

I will fix

Startomb
Posts: 51
Joined: Tue, 27. Dec 05, 08:47
x3

Post by Startomb » Mon, 11. Dec 06, 17:44

not sure whats happened but i choose the auto upg option from the commands then select my Hq and i get the message Note enough money or somthing along those lines. So i thought maybee i just need more cash i bring out the cheats (getting 1 billion) and only put 1 buster in the hq then try out the command still same ans...

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Tue, 12. Dec 06, 07:26

rubberman wrote:Auto dock function appears to effect the playership as well, most disconcerting when fighting pirates in the same sector as my HQ to find the autopilot take control and suddenly change course a head for the HQ.
Fixed - see ver 1.2
Startomb wrote:not sure whats happened but i choose the auto upg option from the commands then select my Hq and i get the message Note enough money or somthing along those lines. So i thought maybee i just need more cash i bring out the cheats (getting 1 billion) and only put 1 buster in the hq then try out the command still same ans...
This should not happen with 1 bil cr. - I don't even have that much and I've upgraded a Nemesis.

1) Are you 100% sure that there is no other ships docked at the HQ?
2) Can you check what upgrades are installed on the ship before you run the command and after you've got the message. This will help in tracking down were the script bombs out.

User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 » Tue, 12. Dec 06, 07:39

DeltaWolf, instead of checking only for non-playership on the auto-dock script, you might want to also select only ships with command_none.

User avatar
DeltaWolf
Posts: 597
Joined: Tue, 6. Jul 04, 08:48
x4

Post by DeltaWolf » Tue, 12. Dec 06, 07:42

That is what the command is doing - it's checks the sector for all player owned ships and if the ship is doing noting eg command is NONE it gives that ship a command to dock with the selected station.

Post Reply

Return to “X³: Reunion - Scripts and Modding”