This file has a lot of programming info and the structures.  These
structures are already defined in the TPU's, so you really only need to
look at them so you know what the varible names are, and what kind of
data each one is.

Each of your units that 'use' PLAN_VAR.TPU will have access to all the
varibles in this.  For procedures in other units (like ALLPAS) please
read its text file.

The varibles you can use.  Be sure you are using PLAN_VAR.TPU.

 I've attempted to comment everything of importance.  But I'm terrible
 at this kind of thing.. <G>

 If they aren't commented, better leave 'em alone because they are used
 internally.

              -=-=-=-=-=-= ABOUT MAKING TEOS IGM'S =-=-=-=-=-=-


You may create and sell IGM's without any fees.  (just like LORD)

Although I would like to keep a closer watch on them this time around.

I would appreciate it if you would let me preview a copy of your IGM
prior to release - I will look for ways to cheat and let you know if I
think it will 'ruin' the game, and tell you what to change.

I am pretty easy to please, so don't sweat it. <G>

I believe the IGM authors and myself should have a close relationship, I
want to make things as easy as possible for you - if you need something
changed in the .TPU's, let me know.  I can't promise to do everything, but
I'll do my best!

 -=-=-=-= HOW TO COMPILE THE EXAMPLE IGM AND USE IT =-=-=-=-

Unzip all this into an empty dir.  (I don't want to accidently overwrite
something important of yours)

If your BIN dir is in your path from dos you can type:

TPC TESTIGM.PAS

TPC TESTCFG.PAS

And it should compile into the .EXES.

Or, put the .TPU's where TPX can find them, and compile from the editor.
(easiest)

To try out the example IGM:

Type TESTCFG.EXE.

Follow the install prompts, then run TEOS and go to the correct planet.

Make sure the IGM *YOU* make works, installs and uninstalls as easy as
the 'TESTIGM'.

         -=-=-=-=-= Programming tips and tricks, Q and A =-=-=-=-

Many of the info in this file and others will not make sense at 1st - the
best thing to do is compile and run the TESTIGM and TESTCFG programs, then
look at the source and begin to make changes, using them as the frame.

Later you may find this information more usefull.

HOW CAN I RUN MY OWN MAINT?

 If your IGM does a maint once a day when the 1st person plays, you can
tell if the day has changed by comparing the number in TIME.DAT (a text
file) with a number you save in your own datafile - If the #'s are
different, do the maint and change your saved # to the current TIME.DAT
#.

HOW CAN I TELL IF THE TEOS GAME IS REGISTERED?

If you want certain options to work only if TEOS itself is registered,
just check the REGISTERED boolean.  If REGISTERED is true, then the vars
tbbs_name and tsysop_name will hold the information on who it was
registered to.  If your IGM required a registered TEOS game to run on,
you could checksum these values to create your registration #.

HOW WILL PEOPLE KNOW MY IGM HAS BEEN INSTALLED?

If they do 'G'ame stats, it will show every IGM and where it is.  It checks
every IGM(planet_num).DAT file in the MAIL dir for this info.  When
TESTCFG.EXE says it installed the IGM, this is what it added:

  Name to show on planet       Path and filename.  The * means pass node num
 /                               /
TestIgm|C:\WHATEVER\THE\IGMS\DIR\IS\TESTIGM.EXE *

BUT I DON'T WANT PEOPLE TO KNOW WHERE MY IGM IS!

Say you made an IGM called 'The Hippy Van', and it moved from planet to
planet and let players hitch rides.  But you don't want players to see where
it is in the Game Stats info page - just add |NOLOCATION at the end.

It will show [HIDDEN] instead of which planet it is located on.

Example:

TestIgm|C:\WHATEVER\THE\IGMS\DIR\IS\TESTIGM.EXE *|NOLOCATION

YOU DON'T UNDERSTAND, I DON'T WANT PEOPLE TO KNOW IT IS EVEN INSTALLED!

Oh.  Ok, instead of NOLOCATION, put NOSHOW.  This will ignore it when
listing IGM's on the 'Game Stats' page, but will still show up fine when
they are on the actual planet.

WHAT IS PLANETS.ORG and ENEMIES.ORG?

Because planets and enemies change throughout the game orginals are needed
in case the sysop ever resets.  The .ORG files are the orginals.  They are
copied to PLANETS.DAT and ENEMIES.DAT if TEOS can't find them.

If you make an IGM that adds a planet, you had better ALSO add it to the
ORG file.  Keep in mind it could be put at any location so you need to
be able to find your planet by a means other than # or name (which can
be changed).  You could find it by seeing if the items and percentages
match.

If you make enemy add-ons, you had better have an installer that adds them
to the ENEMIES.DAT file and ALSO the ENEMIES.ORG file.

This way, if the SYSOP resets the game, your addons will still be there.

IGM's survive a reset also.

TO KILL SOMEONE:  (ie, blow them up)

Just set pl^.kicked_out to a # other than 0.  They will have to wait
that many days before playing again.  (then they will get thrown into that
arcade sequence to get 'rescued')

If you return from an IGM with that set, TEOS will promptly kick them back
out to the BBS.

  -=-=-=-=-=-= COMPLICATED STUFF YOU DON'T REALLY NEED TO KNOW =-=-=-=-=-

CAN I ADD MORE ITEMS?

IF YOU WANT TO ADD AN ITEM IN YOUR ADD ON, YOU MUST CONTACT ME AND I WILL
LET YOU KNOW WHICH ITEM # TO USE.  If everyone lets me know, I can make
sure no two IGM's will conflict.

Yes.  By changing ss^.c[number].name to the name of it, and .price and
.max you can create new items.  Up to 40 can exist - so if you are VERY
carefull, find a blank item and create it making sure there isn't a dupe,
you could put this kind of item on any planet.

Setting the max to anything other than 0 means a user can only hold
that many of them.  For instance, eden warp units have a max of 2.
Look below for the list of defaults as of beta3.

Don't add more than 1 or 2, since the max is 40 we need to conserve space.

Make SURE no other items use the FIRST letter, # or symbol that yours does.
(that is how TEOS lets people pick which item)

For instance, you couldn't add 'Frankfurters' because 'Fighter Drones'
has already taken F.  You could do '1 Frankfurters' though, because 1 is
not taken.

Be sure to use save_setup; if you change any item values.

CAN I DELETE A PLANET?

Sure.  It is YOUR responcibilty to move anyone on it 1st though.

Just change p_rec^.more[4] to TRUE.

If you do put an option in your IGM that lets users 'blow up a planet',
be sure you don't make this to easy to to.  Ie, it should only work on
planets that have no fighters on them, ect.

CAN I ADD A PLANET?

Sure.  Just append a record at the end of the PLANETS.DAT file.  Don't go
past 99 though.  Check to see if any planets are marked deleted, (more[4])
if they are, write over THAT RECORD instead of adding a record.  Don't
even THINK about leaving that out!!





              -=-=-=-=-=-= THE VARS AND STRUCTS =-=-=-=-=-=-


const
play_date: longint = 0;
max_accounts_ship: longint = 0;
max_accounts_cartel: longint = 0;
corp_special: boolean = false;  {if on, write_mail will write to ALL corp
                                 members}
max_accounts_enemies: longint = 0;
max_items: shortint = 40;
igm_play: integer = 0;
igm_true: boolean = false;
all_good: integer = 0;
all_bad: integer = 0;
all_normal : integer = 0;

registered : boolean (will equal TRUE if they have registered their copy
                      of TEOS)
tbbs_name : string[50] (if they have registred, this will hold the BBS name
                        that is used in their TEOS code)
tsysop_name : string[50] (if they have registred, this will hold the sysop's
                          real name used in their TEOS code)


  The GAME.DAT structure is not available for security reasons and for the
  safety of the sysops information.

  However, you can still load and save this information and access certain
  varibles.

  These are them!

type c1 = record
    name: string[25];  {name of item - don't use color codes}
    price: longint;    {price}
    max: longint;      {if more than 0 then this sets a max of how many
                        can be bought}
end;

The default item values are as follows:
Certain items like reactor units, fighters, shields, cargo spaces ect have
variable maxes, depending on the players info - setting a max won't do
anything in those cases.


ss^.c[1].name := 'Shield Battery';
ss^.c[1].price := 100;
ss^.c[2].name := 'Device Of Cloaking';
ss^.c[2].price := 5000;
ss^.c[3].name := 'AntiCloak Scanner';
ss^.c[3].price := 100000;
ss^.c[4].name := 'Big Cargo Space';
ss^.c[4].price := 200;
ss^.c[5].name := 'Medical Unit';
ss^.c[5].price := 500;
ss^.c[6].name := 'Heating Unit';
ss^.c[6].price := 1500;
ss^.c[7].name := 'Ice Unit';
ss^.c[7].price := 200;
ss^.c[8].name := 'Ground Weapon';
ss^.c[8].price := 350;
ss^.c[9].name := 'Reactor Unit';
ss^.c[9].price := 100000;
ss^.c[10].name := 'Novelty Pack';
ss^.c[10].price := 100;
ss^.c[11].name := 'Tree Growth Kit';
ss^.c[11].price := 800;
ss^.c[12].name := 'Jewel';
ss^.c[12].price := 2000;
ss^.c[13].name := 'Plastic Trinket';
ss^.c[13].price := 150;
ss^.c[14].name := 'Clothes Bundle';
ss^.c[14].price := 450;
ss^.c[15].name := 'Eden Warp Unit';
ss^.c[15].price := 25000;
ss^.c[15].max := 2; {can't buy any if you already have 2 of 'em}
ss^.c[16].name := 'Fighter Drone';
ss^.c[16].price := 200;
ss^.c[17].name := 'Zone Atomic Bomb';
ss^.c[17].price := 500000;
ss^.c[18].name := 'Utopia Planetary Defense';
ss^.c[18].price := 5000000;
ss^.c[19].name := 'Onboard Printing Kit';
ss^.c[19].price := 100000;



              planet_odds: longint;
              delete: longint;   {days till player deletion}
              change: longint;  {max change per day in s/f prices}
              min: longint;  {min s/f prices can go}
              max: longint;  {max s/f prices can go}
              scan_level: longint; {how many scanning levels can be used}
              c: array[1..40] of c1;  {info on each item for sale}







{this is for the array of certain planet info, not a file type that is
saved or loaded, just for in memory use}

            type world_info = record
            w: array[1..100] of string[30]; {Name of planet]
            owner: array[1..100] of integer; {who owns planet?}
            {the above is 0 for Alliance, -1 for Maraken and between 1 and
            200 if owned by a player.  (their account #)}
            no_warp: array[1..100] of boolean; {can the public directly warp
            to it?
            mode: array[1..100] of byte; {if 1 planet is private, no outsiders
                                           allowed to trade}
            end;


{for the array of certain player info also not a file type, but something
 kept in memory for each user.  Updated every Build_index.

 You have access to this information on any user # at any time }

              type all_p = record
   names: string[25];
   exp,fighters: longint;
   sex_male: boolean; {true if player is male}
   deleted: boolean;  {true if the player is deleted}
   cloaked: boolean;  {true if player is cloaked}
   planet: integer;   {planet # player is currently on}
   skillt,skillw,skillm: shortint; {reserved}
   org: shortint;  {0 for nothing, 1 for alliance 2 for Maraken}
   m_time: integer;       {reserved}
   on_now: boolean;       {reserved}
   hour_on: shortint;     {reserved}
   minute_on: shortint;   {reserved}
   cartel: integer; {what cartel they are in}
   who_cares: integer; {reserved}
   v2: integer; {reserved}
   king: integer; {reserved}
   busy: boolean; {reserved}
   cloak_level: integer; {what level they are cloaked at}
   ship_model: string[25];
   ship: string[25];
   ship_look: string[8]; {ansi symbols of ship}
  end;

  type all_players = record
  p: array[1..200] of all_p;
  end;


 {the ship record type in SHIP.DAT.  Much is unused}

type ship_rec = record
 ship_odds: integer;
 k1,k2,k3,k4,k5,k6,k7,k8,k9: boolean;
 owner,j2,j3,j4,j5,j6,j7,j8,j9: integer;
 ship_model: string[30];
 ship_look: string[8];
 akills,mkills,nkills,
 price: longint;
 ansi_name: string[8];
 max_reactor,
 max_fighters,max_holds: longint;
 max_shields: longint;
 max_torp: longint;
 fighters,shields,jumps_per_day: longint; {fighters and shields that come
                                           with the ship if people 'start
                                           with it'}

                                       {jumps_per_day is how many real
                                        'hyper hole' jumps it gets a day.
                                        max_reactor is how many reactor units 
                                        can be added.  Reactors don't give
                                        extra hyper holes, just power, so
                                        only 'custom' jumps can be made with
                                        them.  
                                        (if this is confusing, just play
                                        the game for ahwile. <G> )
 l1,l2,l3,l4: longint;
 holds: longint;
end;

 {npc rec, inside ENEMIES.DAT}


  type enemy_rec = record
  name: string[30];
  ship: string[30];
  boast: string[160]; {the first 80 is the 1st line, the second is the second
                       line.  Strange, but there for compatibility}
                       {You could read these as two string[80]s. }
  friend: string[160]; {all of these texts are like the above}
  cargo: array[1..40] of integer;
  mad: string[160];
  run: string[160];
  win: string[160];
  exp: longint;
  fighters: longint;
  torp: longint;
  gold: longint;
  org: shortint;
  shields: longint;
  like: array[1..200] of shortint;
  holds,power,att,brain,planet,l6,l7,l8,l9: longint;
  male,blown_up,k3,k4,k5,k6,k7,k8,k9: boolean;
  gift,j2,j3,j4,j5,j6,j7,j8,j9: integer;
ship_odds: integer;
ship_model: string[30];
ship_look: string[8];
akills,mkills,nkills,
max_reactor,
max_fighters,max_holds: longint;
max_shields: longint;
max_torp: longint;
jumps_per_day: longint;
  end;



 {player rec, inside TRADER.DAT (max 200)}

  type user_rec = record
   names : string[25];
   real_names: string[25];
   man1,man2,man3 : string[25]; {ship, 1st and 2nd mate}
   flight: string; {contains todays flight path.  It uses two chars for each
                    stop, I didn't upgrade this part.. Damn it!}
   bad, shields, planet,fighter,holds,power,path,quest: longint;
    {planet is current planet.  holds is cargo spaces.  power is reactor
     units.  }
   rate, expert,why,tip: shortint;
   cloaked: boolean;
   male: boolean;
   gold,bank,exp: longint;
   last_day_on: integer;
   o1,o2,o3,o4,o5,o6: longint;
   ship_odds: integer; {5 to 100}
   ship_model: string[30];
   max_fighters,max_holds: longint;
   cargo: array[1..40] of integer;
   on_now: boolean;
   hour_on: shortint;
   minute_on: shortint;
   cloak_level,l2,l3,l4,l5,l6: longint;
   cartel,j2,j3,j4,j5,j6,j7,j8,j9: integer;

   jumps_per_day: longint;
   max_shields: longint;
   ship_look: string[8];  {ship ansi symbol}
   akills,mkills,nkills,
   max_reactor: longint;
   max_torp: longint;
   org,l1,kicked_out,torp,d5,d6: shortint;
   dead,busy,deleted,nice,blacklisted,e6: boolean;
   {if blackedlisted, the person cannot trade at that planet until they
    Warp somewhere.  This is to prevent attackers buying weapons at the
    planet they are on}

   t: array[1..6] of integer;   {reserved} {everything is reserved!}
   end;

 {planet rec, inside PLANETS.DAT}

    type plan_rec = record
   name: string[50];
   desc: array[1..5] of string[130];
   village_name: string[40];
   trader_look: string[120];
   trader_name: string[40];
   trader_desc: array[1..2] of string[100];
   rate: array[1..40] of integer;
   shop: array[1..20] of boolean;
    { 1 bank
      2
    }

   setting: array[1..20] of integer;
   {
    1 amount of fuel
    2 percentage

    }

   name_of_shop: array[1..20] of string[30];
   {shop 1 bank
    shop 2 alliance
    shop 3 maraken
    shop 4 Dreamor temple
    shop 5 graffiti wall
    }

   more: array[1..40] of boolean;

   {more 1 is trader male?
    more 2 can you Eden Warp to planet?
    more 3 Utopia defense?


   }
   owner: integer;
   pop: longint; {population}
   power: longint; {fighter drones on planet}
   graph,gold,income,number_of_trades: longint;
   mode,nuke,c3,c4: shortint;
   custom_place: array[1..4] of string[60];  {these are not used}
   custom_place_name: array[1..4] of string[20];
   end;

{  Cartel.dat record }

  type cartel_rec = record
   deleted: boolean;
   name: string[25];
   password: string[10];
   ceo: integer;
   members: array[1..10] of integer;
   hate_list: array[1..20] of integer;
   friend_list: array[1..20] of integer;
   a1,a2,a3,a4,a5,a6,a7,a8,a9: longint;
   b1,b2,b3,b4,b5,b6,b7,b8,b9: longint;
  end;

var
dir1: string;
pl: ^user_rec;
en: ^user_rec;
mon: ^enemy_rec;
p: ^all_players;
p_rec: ^plan_rec;
shipd: ^ship_rec;
p_rec1: ^plan_rec;
carteld: ^cartel_rec;
cartel_temp: ^cartel_rec;
w: ^world_info;

max_accounts: integer;
max_planets: integer;
cur_enemy: integer;
play,mail_num: integer;
directory,mail_string: string;
cur_choose: integer;
ch: char;
