
Operation
   _________________  _____  _________ __________ ___ ___ _______    _______
  /   ____/\_____   \/  _  \ \_   ___ \\_  _____//   |   \\____  \  / _____/
  \____  \  |    ___/  /_\  \/    \  \/ |   __)_/    ~    \/  |   \/  \  ___
  /       \ |   |  /    |    \     \____|       \    _    /   |    \   \_\  \
 /______  / |___|  \____|__  /\______  /______  /\___|_  /\______  /\_____  /
        \/                 \/        \/       \/       \/        \/       \/
     
                            from Free Lunch Design

                               THE LEVEL EDITOR



*********** INTRODUCTION

  Lots and lots of people have asked for the level editor for Operation
  Spacehog. At first I did not want to release it, thinking it was to
  unfriendly to use. But now I have changed my mind.

  I still think its very unfriendley to use, but I thought 'what the heck,
  let them try it'. This code for the level editor is one of the worst I
  have written. Cut and paste, cut and paste. Hence it is a bit tricky to
  describe what is possible. But I'll do my best. A copy of the first level
  in spacehog has been included in the zip. You can play with that one.

  I will not support this software or textfile in any way. If you have 
  questions I cannot promise to answer them, but I'll do my best.


*********** DISCLAIMER
                  
  I do not accept responsibility for any effects, adverse or otherwise,
  that this software may have on you, your computer, your sanity, your
  dog, or anything else that you can think of. Use it at your own risk.
  I have, however, never experienced any trouble with it.
                           

*********** THE LEVEL FORMAT

  Each level is built up of a number of events. These can be anything
  from waves to guardians to background objects. When playing Spacehog,
  the world slowly moves forward, pixel by pixel. There's a counter,
  increasing by one for every 80 pixels that has been passed. Every time
  this counter is increased, events get a chance to happen. Many events
  can be triggered at the same time, but between each group of events
  there are always 80 pixels.

  If a guardian is on the screen, the counter will not continue until the
  guardian is gone.

  For those of you who knows c, here's the structure of a level event:

      typedef struct LEVEL_EVENT {
         int when;
         unsigned char what, type;
         int starty, startx;
         char xspeed, yspeed;
         char pattern, number, dt;
         unsigned char radius, angle, aspeed;
         char dx, dy, linked;
         char give_pup;
      } LEVEL_EVENT;

  The events are all stored in a long _sorted_ array. The array is
  supposed to remain sorted no matter what but... Therefore, it's a bad
  thing to put an event which is to trigger before another event, earlier
  in the array. This will cause strange effects.

  Each level also holds some information about what it's called and some
  other stuff.


*********** EVENT TYPES

  Here's the different type of events:
         single             a single enemy
         wave               a wave of enemies, moving in pattern
         rotate             a single enemy rotating around a fix position
         etr & stay         a single enemy that stays a while on screen
         avoider            a single enemy, avoiding the players
         pattern            a single enemy, moving in a cyclic pattern
         bg obj             a background object
         end of level       a signal to the engine that the level ends here
         NEW                indicates that this event has not been set

  When creating an event that launches an enemy, you can link it to
  another enemy. This is done by making the first enemy a LINKHOST
  and the following enemies to LINKED. (TAB + L)


*********** STARTING AND USING THE EDITOR

  Make sure you have unzipped the files into your SPACEHOG directory.
  Otherwise, nothing will work.

  The editor is started from a DOS-prompt, simply type LEDIT. You will be
  presented with a quick init-screen and the with a new, empty level for
  you to play with.

  Use right arrow to scroll to the right. Press tab simultanously to scroll
  in 80 pixel steps. Using Tab and left arrow you can jump backwards.

  Pressing HOME take you to the beginning of the level.

  Use INSERT to insert an event at your current position. An indicator will
  appear in the top left corner showing that You have made a NEW event.
  Use 1..9 to look at and define it.

  An 'event editor' will now appear and you can set what kind of event you
  want. Controls are mostly made by pressing the big letter in the slot
  you want to change and using the arrow keys at the same time. E.g. to
  change startX, press X and arrows. This might sound difficult but you
  get the hang of it in a while. Press and hold LSHIFT to speed thing up.

  A lot of thing can be controled using your mouse, I don't remember what,
  you'll have to chance!


*********** USING MY LEVEL IN SPACEHOG

  This is the easy part. :)

  1) Put your level in the same directory as the rest of spacehog.
  2) Start spacehog.
  3) When at the start menu, open the console (TAB+ENTER).
  4) Type 'load level' end press ENTER.
  5) Type the name of your level and press ENTER.
  6) If you did everything right the console will tell you. If you did
     something wrong, you will also be told. Try again.
  7) In case everything went OK, leave the console and start the game.
  8) Play your level.

  If you want to set the next level to play after your first, start the
  console _while_ playing the first level and repeat the nessessary steps
  from above.


*********** KEYS

  Movement
    right arrow         scroll left
    right + [TAB]       step 80 pixels right
    left + [TAB]        step 80 pixels left
    [HOME]              move to start of level

  Events
    [INSERT]            insert an event at current position
    1-9                 show event # at current location

  Storage
    [ALT] + S           saves the level
    [ALT] + A           saves the level under a different name
    [ALT] + L           loads a level from disc

  Misc
    [ALT] + N           name the level
    [PRT SCR]           take a screenshot
    [F10]               lists a strange list (unusable)
    [ESC]               quit the editor

  Event editor
    T + left/right      change Type of event
    W + left/right      change When the event is to trigger
    S + left/right/up/down     change starting position
    X + left/right      change speed in X dir
    Y + left/right      change speed in Y dir
    [TAB] + G           toggles Guardian on/off
    G + left/right      toggles powerup
    E + up/down         change type of Enemy/bg etc
    P + left/right      change Pattern (pattern/wave events only)
    D + left/right      change Delay between wave members (wave events only)
    N + left/right      change number of wave members (wave events only)
    P + left/right      change pos to stay at (etr&stay events only)
    R + left/right      change num seconds to stay (etr&stay events only)
    R + left/right      change radius (rotate events only)
    L + left/right      change angle (rotate events only)
    A + left/right      change angle speed (rotate events only)
    [TAB] + L           set event to linkhost or linked
    L + left/right/up/down     change linked enemiy offset

    [RCTRL]+left/right  move to next/prev event
    [DEL]               delete event
    [LSHIFT]            speed up changes
    [ENTER]             leave



*********** F A Q

  Q: Can I bundle my levels into a pack and play them all in a row?
  A: No. Sorry.

  Q: How do I load a level into Spacehog?
  A: See section USING MY LEVELS

  Q: In Spacehog, you have a turret sitting on the side of a meteor, how
     do you do that?
  A: First, create the turret. Then create the meteor and set it to
     be a linkhost (TAB+L). Now set the Turret to be linked (TAB+L) and
     adjust the offset until it fits. Make sure that the linkhost has
     a lower event number.

  Q: How do I create a number of enemies rotating around each other like
     in Spacehog?
  A: Like you said. Create a number of events launching rotates at the
     same spot, at the same time. Adjust radius and keep the same angles
     and angle speeds.

  Q: Changing values in the event editor takes forever! I have to press
     the keys a million times!
  A: Press and hold LSHIFT to speed things up.

  Q: This editor really sucks! And I don't understand a word of this
     crap you call help text.
  A: Too bad. I can't do anything to help you, this is all you get.


*********** AUTHOR

  Johan Peitz, Free Lunch Design
  http://www.dtek.chalmers.se/~d98peitz/fld


*********** WHAT IS OPERATION SPACEHOG ANYWAY?

  Operation is a classic 2d shooter, find out more at the website.
  http://www.dtek.chalmers.se/~d98peitz/spacehog
  If you want to cheat, add /cheat after the URL above.




                                - the end -
