Nighthawk - a journey back


 
Project links
Front page
Project page
More Details
Local news
Sourceforge news
Downloads
Recent achievements
Write your own levels
View the source code online

Original author
A copy of Jason Nunn's
last Nighthawk page

Other related pages
FreeDroid
Night-Gem
Birth of a Paradroid
 

Introduction

You have a small problem - you want to slate extra levels. However, you have no levels to slate. Sorry there's no piccies here yet. They're coming.

You need to recompile the source tarball, making sure you uncomment the following line within options.h:
#define DEVELOPMENT_MODE 1

The alternative to this is to execute configure, adding the --enable-tools parameter to the commandline you use. I use the following example, yours may differ.

[user@host] nighthawk-2.3 $ ./configure --prefix=/usr --enable-tools

Then go and recompile the code. A simple "make" will do this. Take especial note of the eventual creation of a binary called "ned". You'll need this to actually edit levels later. Make sure you run "make install" to actually make use of the editor.

Then, create a directory somewhere else in which to create your brand new level. Make sure it does not conflict with any other ships already defined.

Next, change into this directory.

Run ned, to create your floorplan. Start off with "ned --help" to see how it's done. Also, be very aware that this editor hogs CPU like you wouldn't believe! I have had the X server crash several times on lower specced machines.

I have yet to create an editor for droids to be added to the "chars" file, but I am working on it.

Unfortunately, I haven't got any fancy screenshots - that'll come later.

You must make sure your level is correct, otherwise nighthawk will behave very weirdly, and perhaps even cause your machine to lock up. We have not fixed this fault yet, mainly because we have no idea what's causing it yet.

Once you have created the "chars" file in the directory, hop up a directory and copy the "ctrl.d" file to a backup, and edit the "ctrl.d" file, which is a list of the shiplevels the game should run, and in what order.

Change one of the existing shiplevel names to the name of your newly minted ship, and save the file back to disk. Then - start up nighthawk, and try playing your level. If it works, then, congratulations! Email it to us!

Remember not to change the number of entries - if you have created more than ten levels, then WOW! Send them to US!! Actually, even if you create LESS than ten levels, send them to us anyway!! I can't promise that there'll be any prizes or anything, but we'll have fun playing them anyhow.

Char file format

The format of this "chars" file runs a bit like this:

  1. type: [name]
    One of these types: Flag ship, Battle cruiser, Attack Frigate, Scientific Frigate Destroyer Class, Fleet Support, Scout Ship, Medical Frigate, Cargo Vessel.
  2. floor: [name]
    Each name will become a floor in your new ship. You will need to create as many floors as are needed.
  3. transport: [floorname] <x1> <y1> <x2> <y2> <liftnum>
    basically, elevators to change from floor to floor. An elevator must have at least two floors that it appears on, and may not appear in the same place as another elevator on the same floor.
  4. init: [floorname] <x1> <y1>
    where you start the level
  5. droid: <numerictype> [floorname] <x1> <y1>
    The droid field can have a number of lines following it, covered in the droids section. Droid numerictypes range from the lowly 108, a cleaning droid, to the cyborg 999 - you don't want to meet this droid down a corridor with nowhere to go!

    Do make sure you use a robot number that actually exists - and not a 109, which would be 108's brother, if there was one.

Droid movements

Lines to define droids movements, and length of time they stop at each place (their "beat") are defined by one of either of the two lines shown below:

* g <x1> <y1>
Go to this x1 y1 position.

or
* w <timelength> 0
Wait for timelen tenths of seconds - the zero on the end is needed, but I don't know why.

A droid line can exist on its own:
droid: 799 Bridge 112 32

These lines are generally okay for droids that have "AI" - in short, they don't need to have a "beat", but will hunt you down if they see you. You may still assign a beat if you wish, this makes them just that bit more predictable, and if you keep the time intervals short, it will stop transfers to the droid unless you are able to keep pace with the droid you wish to transfer to.

However, the lower level droids generally need to have a "beat" assigned to them, otherwise, they'll just sit there and be boring.

Do note, you cannot embed droids in a wall by accident and expect them to go anywhere. They'll just jiggle helplessly - this also applies when you inadverdetly put a droids route through a wall when there isn't a intervening door.

Currently, there is no way to have a droid change floors (otherwise escaping a mad 799 would be almost impossible).

Just as an example, I show an excerpt out of the first level of nighthawk.

type: Fleet Support
floor: Bridge
floor: Cargo
floor: Quarters
floor: Engineering
transport: Bridge 89 8 432 208 0
transport: Cargo 89 20 496 208 0
transport: Cargo 47 20 176 144 1
transport: Quarters 47 30 144 80 1
transport: Engineering 153 31 48 80 2
transport: Cargo 153 20 912 240 2
init: Engineering 48 80
droid: 108 Engineering 144 80
* g 144 48
* w 50 0
* g 48 48
* w 50 0
* g 144 48
* w 50 0
* g 144 80
* w 50 0
droid: 108 Quarters 48 48
* g 144 48
* g 48 48
* g 48 112
* g 144 112
* g 48 112
droid: 108 Cargo 304 80
* g 752 80
* g 752 240
* g 592 240
* g 592 112
* g 368 112
* g 368 272
* g 304 272
* g 304 80
... ... ...
droid: 899 Bridge 208 80
* w 100 0
* g 208 176
* w 100 0
* g 208 80
droid: 606 Cargo 432 176
* w 100 0
* g 432 272
* g 432 176
droid: 275 Cargo 912 48
* g 848 48
* w 20 0
* g 912 48
* w 20 0
droid: 606 Cargo 176 272
* w 8 0
* g 368 272
* w 8 0
* g 176 272

As you can see, a fair amount of information is stored in this file. It is important that you get this file correct, otherwise, you are likely to crash nighthawk, or at least cause some really weird results. I have recently locked up a machine hard due to not getting a level correct. I did it twice, and each time, I faced having to press the reset button.

Well, I hope this really little HOWTO will encourage you to create some levels, play them, perhaps even send them to us, where we can review them.

Go TO it!

 

News

Okay - news has shifted to here - get the news until I find a better place for it. The other place to look is the sourceforge news.

     

Document CopyRight © The Viking, 2004, soon to be under the Open Documentation License.

You can get back to Sourceforge through THIS link, or click THIS icon:

Sourceforge Logo

Give this game a go!