• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

KSM (Kal Server Map) Specification

aka Reb3lzrr
Joined
Aug 23, 2006
Messages
325
Reaction score
47
Ey all,

I decided to release KSM Specifications

A little snippet for Pascal:

Definition
Code:
  TKalServerPixel = class
  private
  public
    collision : word; //Mobs spawn YES/NO
    additional_info : word; //Like town or so
  end;

  TKalServerMap = array[0..255] of array[0..256] of TKalServerPixel;

  TKSM = class
  private
  public
    map : TKalServerMap;
    procedure LoadFromFile(FileLocation:String);
    constructor Create; overload;
  end;

Addidional info:
Code:
0=nothing special
1=OneWayPortal ( THESE ARE THE PORTALS USED BY INIXSOFT)
2=TwoWayPortal (not used by engine)
4=PkFree
6=Town
16=Castle

Loading

Code:
constructor TKSM.Create;
var
  x,y:Byte;
begin
  For x:=0 to 255 do
  begin
    For y:=0 to 255 do
    begin
      Self.Map[x,y]:=TKalServerPixel.Create;
    end;
  end;
end;

procedure TKSM.LoadFromFile(FileLocation:String);
var
  MemStream:TMemoryStream;
  Buf:Word;
  x,y:Byte;
begin
  try
    MemStream:=TMemoryStream.Create;
    MemStream.LoadFromFile(FileLocation);
    MemStream.Position:=4;

    For x:=0 to 255 do
    begin
      For y:=0 to 255 do
      begin
        MemStream.ReadBuffer(Buf,SizeOf(Buf));
        Self.map[x,y].Collision:=Buf;
        MemStream.ReadBuffer(Buf,SizeOf(Buf));
        Self.map[x,y].additional_info:=Buf;
      end;
    end;
  except
    ShowMessage('error has occured');
  end;
  MemStream.Free;
end;
as you see, we skip 4 bytes, these are ALWAYS (1,0,0,0)

This is the most plain version of loading a KSM...

have fun

gz reb3lzrr
 
Back
Top