This section contains scripts written for Hardwar upgrade 3 (beta 3+), including scripts to build MUD-style rooms and walk links, and scripts to try and make the beta 5 economy playable. Instructions on using these scripts are below the list of scripts. This page also contains notes on the scripts.

Scripts

Important: These scripts should be regarded as experimental. Whilst I have found them to work correctly, I cannot be held responsible for any problem they may cause you. Should you encounter problems, and nothing else on this page helps you, then please contact me with details.

The following files are designed for use with U3 beta 5. It is recommended that instead you upgrade to the latest UIM patch instead.

Note: Max's economy patch (see hardwar.info for compendium) largely replaces the need for such extensive scripting to 'fix' the beta 5 economy. You may find parts of the script are still useful for adding missing software, cash, and setting buy/sell values to correct starting stock errors, or even giving trading posts a limited function. This is essentially what firefox and smurph did in May 2003. You will need to pick and choose which parts of the script to run, and I suspect only the most dedicated server administrator will ever want to get this detailed. I have left the scripts in their original form. The only significant changes I am aware of are a to fix pricing at General Industrial (from Wez), vis:

teleport general industrial
hangar stock,water,maxbuy,25
hangar stock,water,buy,340

And a fix to allow faction pilots to respawn (from smurph), vis:

teleport lazarus moths
hangar software,cdm
teleport klamp-g moth factory
hangar software,cdm

Instructions

These scripts require Hardwar U3 beta 3 or greater, unless otherwise stated. They are tested with beta 5.

There are two ways to run scripts. The first method is the easiest, but has serious limitations:

1. By editing the file worldinit.txt, found in the Hardwar directory. Before making changes, create a backup of the existing file, just in case things go wrong. For most scripts, cut and paste the new script into either the start or end of the file and save the file. Where a crater already has entries care needs to be taken. The default file has room building entries for Alpha and Downtown only.

Note that (for me anyway) the game crashes on startup if more than about 200 lines of commands are contained in worldinit.txt. This is quite likely if trying to script an entire crater. It is suggested that worldinit.txt be used for essential startup commands (few if any), and world building be done using method 2.

2. By sending the script through the Terminal Server (TS). A TS port must be set on the Network tab before starting the game - if in doubt use 9001. You will also need a telnet client. Most computers will already have something suitable: Windows has a basic client called telnet (type telnet into the run box), and may have a slightly more user freindly client called HyperTerminal.

Start the game in whatever mode you wish. Next connect using the telnet client to 127.0.0.1 (which is your own machine) and whatever port you set (probably 9001). For example, in HyperTerminal, select File-New Connection, name the connection to continue, then select TCP/IP from the "Connect using" box, then in "Host name" type "127.0.0.1", and in "Port number" type "9001" (or whatever). Log yourself in as Admin.

Note that before you send a script file you may need to change your telnet client's setup so that it sends a delay between lines. If no delay is set, the hardwar client/server won't be able to process and respond to each line before the next arrives, and you'll get a screen full of errors and most of the script will fail to run. I recommend at least a 100 millisecond delay between lines, although if you have problems consider increasing this. To do this in HyperTerminal, select File-Properties-Settings, then ASCII Setup. Now change the "Line delay" to "100". You may also wish to enable "Echo typed characters locally", so you can see what is happening.

Now transfer the text file via the telnet client. For example, in HyperTerminal, Transfer-Send Text File, and select the relevant script txt.

This works well in single player mode with beta 4 and 5, it just seems to take a little longer for the Hardwar client to respond to commands than it does when acting as a server. With beta 3, the player has to be called Admin in order for admin privledges to exist in the game. Once the game has started, get the player out of the moth and onto foot. Then log into the terminal server as Admin, using the password "admin". The terminal screen may lag a little behind for a while, but should work again after you've typed in a few random commands. In beta 4 and 5, the admin can log on after a non-admin player character has started the game.

Scripts can potentially be run over a network, but you might need to increase the delay between lines. This is best avoided because of the risk of commands getting lost.

Currently I am unaware of an anti-build command, so once you have run a building script, the changes will be retained for the remainder of the game. This is not the case for economy commands, although care needs to be taken in making too many economy changes whilst the game is running, because each change takes a while for the rest of the economy to adjust to.

Notes on Scripts

The rooms and links created in my scripts mostly reflect walkways that can be seen between buildings. I've shortened the apparent length of certain links - Software Refinery's sample set required a lot of movement to get anywhere, which became slightly annoying after a while. There is a lot of potential to add more depth in terms of rooms and descriptions. Think of these as a starting point.

Scripting is simple in concept, but quite easy to mess up. Imagine you are the admin typing commands. Each line in the script is like typing a new command. A list of commands is included within the FAQ. Examining the default worldinit.txt is also useful to see how commands are used.

Typically scripts start with a TELEPORT command, to take you to an existing hangar. Room building scripts then build OUT from the starting hangar to create a new room. The next command typically moves the admin into that room. From there they can describe the room, or create other rooms or walk routes. For example, you will see this quite a lot:

build n,Some Place -- builds Some Place to the north
n -- moves north, to Some Place
describe This is SOME place. -- adds description to Some Place

The important thing to note is that you aren't moved to the newly created location automatically.

Once "Some Place" is created, you can TELEPORT back to it. For this reason ensure all places you might want to TELEPORT back to have unique sounding names. Not all rooms need to be uniquely named, just those that you need to refer back to later in the script. When trying to enter an existing building from a custom room, BUILD HLINK,[hangar name] is used.

Lines starting "//" are comments, and should be ignored when worldinit.txt is processed, and do nothing (other than make the script take longer to send) when sent via telnet.

Short scripts can be debugged by using method 1 (worldinit.txt), starting up a game, and then examining the file worldinit_output.txt. Alternatively log on yourself and have a walk round.