Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Sledgy on Tue 14/01/2014 23:35:16

Title: CHA Viewer
Post by: Sledgy on Tue 14/01/2014 23:35:16
Who can create fast CHA Viewer?

. FileListBox with cha-s
. Choose cha -> see frame #0 (loop 0)


I have pack of characters, and I can't to import it all to check it, I need to browse it

Cha examples (http://www.mediafire.com/download/la6p6fjvdbf2ffw/res_for_CHA_Viewer.rar) (+ BMP versions)
Title: Re: CHA Viewer
Post by: Khris on Wed 15/01/2014 02:53:26
Correct me if I'm wrong, but you can't do this with an AGS game. In order to view .cha files, you have to import them into the editor.
There's no command to import a .cha file at runtime.
Title: Re: CHA Viewer
Post by: Gilbert on Wed 15/01/2014 04:56:21
I think he knew this. It's just a request for someone to make a viewer for the .cha format.
Title: Re: CHA Viewer
Post by: Crimson Wizard on Wed 15/01/2014 14:59:31
There's already code for reading CHA in the Editor (obviously), and it looks pretty straightforward, except for calling native C++ code when creating bitmap, which may require setting up Allegro, or copying the important code manually from the library (which is open source too).

If anyone's interested, seek for functions ImportCharacter272 and ExportCharacter272 in Editor\AGS.Editor\ImportExport.cs.
Title: Re: CHA Viewer
Post by: Sledgy on Sat 18/01/2014 13:00:13
(http://s018.radikal.ru/i515/1401/dd/7516cac02ae4.png)

http://www.mediafire.com/download/b11bihpq9nn9pzc/CHA_Viewer_v05.rar

v0.5, 'cause wrong palette for viewed frame. It's bad)


There's original code (C++) in ImportExport file. See pls, here is palette info, maybe you can convert it to Delphi code

And also there's source of the CHA Viewer (Delphi 6)