2015-08-19 15:50:17 (edited by ogomez92 2015-08-19 15:54:59)

Hi all,
I coded a new bgt class which some if not many of you will find useful.
It is a message history class, with a method like that of mush-z and similar to swamp and other games.

This is an interesting class which allows you to save up to 100 messages for later retrieval (currently using a very basic custom screen reader class which works with any reader, contained in this archive as reader.bgt).
Basically, it allows you to store up to 100 messages, allowing you to retrieve them either by using alt+1 through 0 (you can change the modifier property to any key you wish), or by using page up or down (ctrl page up going to top, and control page down going to the bottom of the list (you can change left control for this by modifying the modifier2 variable.)
In your game's while loop you must use the process() class method to ensure that it checks for message history shortcut keypresses. If you forget to do this, the class will not work properly, though you will still be able to store new messages.
It needs a variable called lang to run, defined as a global property in your script. The reason si that this script is multilingual, currently with English and Spanish languages. To set it to English create an int variable called lang and set it to 1. For Spanish, set it to 2.

Pauses

By using the add class method and setting pause to true, the script will wait for you to press return to continue execution. If you press any other key, the message will be repeated (very useful eh?).
If allow_pauses is set to false, pauses will be ignored.

Properties

int modifier: Key that will be used to review last ten messages default: Key_LMENU + 1 to 0
int modifier2: Key that will be used for going to top or bottom of history (default: KEY_LCONTROL).
int reader_mode: reader.bgt's reader result (1, 2, 3, 4, or 5 for sapi).
bool pauses_allowed: controls whether pauses are allowed
bool auto_move_to_end (false by default): Specifies whether you will be automatically moved to the end of the history when a new message is added (I wouldn't recommend this at all, as you might be moved while reviewing!)

methods

void add(string message,bool interrupt,bool pause):
Allows you to enter a new message to the history. self explanatory

void say(string message,boolinterrupt)
Allows you to speak without actually putting the message in the buffer.

bool process: Must be used in a while loop to process keyboard input.
Returns true if a history key was pressed, false otherwise.

Download from here
https://dl.dropboxusercontent.com/u/2142080/history.zip

ReferenceError: Signature is not defined.