diff --git a/doc/writing_games-en.txt b/doc/writing_games-en.txt index 7574ce5..54be9e6 100644 --- a/doc/writing_games-en.txt +++ b/doc/writing_games-en.txt @@ -1,4 +1,4 @@ -== 0. General information == +== 0. General information == Game code for STEAD is written in lua (5.1), therefore it is useful to know the language, though not necessary. The engine code in lua is only ~900 lines long. And, of course it is the best documentation. @@ -668,7 +668,14 @@ profdlg2 = dlg { }}} Any object or scene may have their “life” handler, which is called every time the game time advances, if the object or the scene have been added to the list of living objects with “lifeon”. Don't forget to remofe living objects from the list with “lifeoff”, when you no longer need them. You can do this, for example, in the “exit” handler or some other way. -== 17. Графика и музыка == +life may return string, that will be printed after all text of scene. + +From 0.9.1 you can return second retval -- importance. (true or false). For example: +{{{ +return 'Guard entered the room.', true -- The event will be printed before objects description. +}}} + +== 17. Graphics and music == Graphic interpreter analyzes the scene “pic” attribute and treats it as a path to the picture. For example: diff --git a/doc/writing_games.txt b/doc/writing_games.txt index b75a323..3c32551 100644 --- a/doc/writing_games.txt +++ b/doc/writing_games.txt @@ -659,6 +659,14 @@ profdlg2 = dlg { }}} Любой объект или сцена могут иметь свой обработчик life, который вызывается каждый раз при смене текущего времени игры, если объект или сцена были добавлены в список живых объектов с помощью lifeon. Не забывайте удалять живые объекты из списка с помощью lifeoff, когда они больше не нужны. Это можно сделать, например, в обработчике exit, или любым другим способом. +life метод может возвращать текст события, который печатается после описания сцены. + +Начиная с версии 0.9.1 вы можете вернуть из обработчика life второй код возврата, важность. (true или false). Например: +{{{ +return 'В комнату вошел охранник.', true +}}} +При этом текст события будет выведен до описания объектов. + == 17. Графика и музыка == Графический интерпретатор анализирует атрибут сцены pic, и воспринимает его как путь к картинке, например: @@ -983,3 +991,4 @@ Windows версия (>=0.8.7): Documents and Settings/USER/Local Settings/Appli TODO Полный список объектов и методов. +