Survivalist .xnb

How to translate the files of a game
makc_ar
Posts: 1193
Joined: Sun Aug 17, 2014 7:27 pm

Survivalist .xnb

Post by makc_ar »

Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Survivalist .xnb

Post by Delutto »

It's easy but... the texts length are in 7BitEncodedInt(I think)... I tried read this value in Pascal but no success... ¬¬

C implementation:

Code: Select all

int Read7BitEncodedInt()
{
   int result = 0;
   int bitsRead = 0;
   int value;
   do
   {
      value = ReadByte();
      result |= (value & 0x7f) << bitsRead;
      bitsRead += 7;
   }
   while (value & 0x80);
   return result;
}

Pascal implementation (attempt)

Code: Select all

function Read7BitEncodedInt: Integer;
var
   VByte: Byte;
   Offset: Integer;
begin
   Offset := 0;
   Result := 0;
   repeat
      FInput.Read(VByte, 1);
      Result := Result or ((VByte and $7F) shl Offset);
      Inc(Offset, 7);
   until (VByte and $80) = 0;
end;
Vecna
Posts: 9
Joined: Tue Jul 21, 2015 10:51 am

Re: Survivalist .xnb

Post by Vecna »

Excuse me, makc_ar from which hexeditor is taken your screenshot?
makc_ar
Posts: 1193
Joined: Sun Aug 17, 2014 7:27 pm

Re: Survivalist .xnb

Post by makc_ar »

Vecna wrote:Excuse me, makc_ar from which hexeditor is taken your screenshot?

viewtopic.php?p=5594#p5594
Vecna
Posts: 9
Joined: Tue Jul 21, 2015 10:51 am

Re: Survivalist .xnb

Post by Vecna »

Thank you very much.
swuforce
Posts: 233
Joined: Thu Oct 16, 2014 4:39 pm

Re: Survivalist .xnb

Post by swuforce »

Try the tool from my sources.
makc_ar
Posts: 1193
Joined: Sun Aug 17, 2014 7:27 pm

Re: Survivalist .xnb

Post by makc_ar »

Thanks a lot swuforce!