I've been using AGS for a few months now, and I can mostly make it jump how I tell it to (I have some programming background). However I am not sure how to properly handle very long constant (read-only) strings. Let me give you 2 instances of where I need to do this, though you might think of others:
a) I have a rather large maze-like area, all using one AGS room, where I use some dynamic drawing and turn walkable areas on and off, etc. to give the illusion of multiple rooms. So far so good: each virtual room needs to have several parameters set (location of doors and walls, connectivity with other rooms, misc objects, etc.) and these are described in one .txt file, each line describing one virtual room. The code then reads the lines into a string of arrays at the beginning of the game, and parses the information for a particular room during its load function.
b) The player finds a book which contains several pages of text. When the book is opened, its closeup appears, and the page's text is rendered in a funky font, with the possibility of flipping pages with the hand icon. The totality of the book's text is stored in one .txt, with separator symbols between pages.
In both situations, you need a very large block of text, which is not easy to place between quotes (the editor doesn't even wrap lines). Loading .txt's is fine, except should I finish the game and deliver it to the public, I don't want the user to look at, or mess with, these files. Copying the whole text into a string by hand is cumbersome for editing later on, particularly for editing my maze map.
To summarise, I have one of two problems:
i) The large strings are placed directly in the code, which makes them cumbersome to edit.
ii) They are placed in a .txt file, where the user has unfettered access to them.
So I want to hear how others have handled/would handle this.
This leads me to the following questions/ideas:
1) Can you import a .txt as a resource into AGS?
2) Can you write long strings in the AGS editor in a multiline fashion, or at least make the editor wrap lines?
3) In the end, I might just develop the game with the .txt's, and copy everything manually into strings at the very end, just before making it public. This is bad programming practice however, and ideally such large resources should be in some way separate, just like the .vox files are.
4) Alternatively, I might write a simple home-brewed encryption algorithm to change the text into something unreadable, with some checksum so that it cannot be easily messed with, and have the game read and decrypt the file. (After all, if someone is very ambitious, they might as well try to decompile the game code itself.) This feels a little overkill, though.
Discuss.
a) I have a rather large maze-like area, all using one AGS room, where I use some dynamic drawing and turn walkable areas on and off, etc. to give the illusion of multiple rooms. So far so good: each virtual room needs to have several parameters set (location of doors and walls, connectivity with other rooms, misc objects, etc.) and these are described in one .txt file, each line describing one virtual room. The code then reads the lines into a string of arrays at the beginning of the game, and parses the information for a particular room during its load function.
b) The player finds a book which contains several pages of text. When the book is opened, its closeup appears, and the page's text is rendered in a funky font, with the possibility of flipping pages with the hand icon. The totality of the book's text is stored in one .txt, with separator symbols between pages.
In both situations, you need a very large block of text, which is not easy to place between quotes (the editor doesn't even wrap lines). Loading .txt's is fine, except should I finish the game and deliver it to the public, I don't want the user to look at, or mess with, these files. Copying the whole text into a string by hand is cumbersome for editing later on, particularly for editing my maze map.
To summarise, I have one of two problems:
i) The large strings are placed directly in the code, which makes them cumbersome to edit.
ii) They are placed in a .txt file, where the user has unfettered access to them.
So I want to hear how others have handled/would handle this.
This leads me to the following questions/ideas:
1) Can you import a .txt as a resource into AGS?
2) Can you write long strings in the AGS editor in a multiline fashion, or at least make the editor wrap lines?
3) In the end, I might just develop the game with the .txt's, and copy everything manually into strings at the very end, just before making it public. This is bad programming practice however, and ideally such large resources should be in some way separate, just like the .vox files are.
4) Alternatively, I might write a simple home-brewed encryption algorithm to change the text into something unreadable, with some checksum so that it cannot be easily messed with, and have the game read and decrypt the file. (After all, if someone is very ambitious, they might as well try to decompile the game code itself.) This feels a little overkill, though.
Discuss.