Useful Functions and Constants for CLEO Mod Developers






















-
depositfiles.comDownload
Developer Tools for CLEO
This pack simplifies the development of CLEO mods with functions and constants.
Functions:
There are 6 functions in the pack:
* Actor spawn
* Shortened actor spawn
* Vehicle spawn
* Shortened vehicle spawn
* Pickup spawn
* Train spawn
You connect the function via the {$I} directive at the beginning of the file, specifying the path to the function, for example: {$I actor_spawn.func}. The directive must be at the very beginning of the file (where {$CLEO}is usually written).
Then you only need to write one line (function call).
Function call opcode:
0AB1:
{$CLEO}
{$I car_spawn.func}
0AB1: call_scm_func @car_spawn num_params 17 model #FIRETRUK -2144.25 922.4758 79.8516 angle 269.7736 color_1 26 color_2 1 door_status 1 very_heavy 0 BP 0 FP 0 EP 0 MP 0 CP 0 radio 11 siren 1 engine 0 return_a_handle 0@
Marker.CreateAboveCar(1@, 0@)
0A93: end_custom_thread
Constants:
In my pack, you will also find a file const, which contains a large list of various constants that can aid in development. I have grouped all constants:
* Constants for button designations (opcode 0AB0:). Note that Sanny Builder does not support Russian names for constants; English names are used. Key names consisting of more than one word are written with underscores (otherwise the compiler gets confused), for example: PAGE_DOWN. In the constants file, synonymous key names are listed one after another. Example: the file contains constants for the escape key - ESC and ESCAPE. Use whichever you prefer. Due to compiler limitations, keys with numbers are written as: 0_KEY, 5_KEY. For num-pad: 0_NUM, 7_NUM. Right and left windows are written as: WINDOWS_L, WINDOWS_R. If you have some knowledge of English, it’s easy to guess that constants COMMA and DOT are used for the comma and period (the synonymous POINT is also allowed).
* Common global variables allowed in CLEO.
* Radio stations.
* Car components (doors, hood, trunk).
* Basic car colors.
* Actor walking styles.
* Types of explosions. Many are duplicated; the most basic constants are recorded without repeats.
* Radar icons.
* Weather codes.
* Gangs.
* Weapon numbers.
* Train types.
* Pickup types.
There are also three additional constants - three zeros (ZEROES), smooth and sharp transitions for the game camera (JUMP_INSTANT, JUMP_SMOOTH).
The constants file is included via the {$I}directive.
Most of these constants are very applicable and save you from digging through Sanny Builder's documentation, however, if you want to use them in your mods, I recommend skimming through their list by opening the file.
You can use these functions and constants in your mods; it is not necessary to mention the file author and website.
NOTE: after compiling the script, you do not need to attach them with the script - the {$I} directive works by including the function code inside the file, meaning the function will be within your script. The same applies to constants. (replaced with the line {$I}).
NOTE: you can also use the full form of the directive - {$INCLUDE}.
Инструменты разработчика на CLEO
Данный пак немного упрощает разработку модов на CLEO - функциями и константами.
Функции:
В паке 6 функций:
* Спавн актера
* Спавн актера сокращенный
* Спавн машины
* Спавн машины сокращенный
* Спавн пикапа
* Спавн поезда
Вы подключаете функцию через директиву {$I} в начале файла, и прямо там указываете путь до функции, например, так: {$I actor_spawn.func}. Директива должна быть в самом начале файла (там, где обычно пишется {$CLEO}).
Затем вам остается прописать лишь одну строку (вызов функции).
Опкод вызова функции:
0AB1:
{$CLEO}
{$I car_spawn.func}
0AB1: call_scm_func @car_spawn num_params 17 model #FIRETRUK -2144.25 922.4758 79.8516 angle 269.7736 color_1 26 color_2 1 door_status 1 very_heavy 0 BP 0 FP 0 EP 0 MP 0 CP 0 radio 11 siren 1 engine 0 return_a_handle 0@
Marker.CreateAboveCar(1@, 0@)
0A93: end_custom_thread
Константы:
В моем паке вы также найдете файл const, который содержит в себе большой список разнообразных констант, которые могут помочь в разработке. Я поделил все константы на группы:
* Константы для обозначения кнопок (опкод 0AB0:). Имейте ввиду, что Sanny Builder не поддерживает русские имена констант, используются английские названия. Названия клавиш, которые состоят из более одного слова, записываются через знак нижнего подчеркивания (иначе компилятор начинает путаться), например: PAGE_DOWN. В файле констант синонимичные названия клавиш прописаны одна за другой. Пример: в файле есть константы для кнопки escape - ESC и ESCAPE. Пользуйтесь тем, что нравится больше. Из-за ограничений компилятора клавиши с цифрами пишутся так: 0_KEY, 5_KEY. Для num-pad\'а вот так: 0_NUM, 7_NUM. Правый и левый windows, соответственно, вот так: WINDOWS_L, WINDOWS_R. Если есть кое-какие знания английского языка, нетрудно догадаться, что для запятой и точки используются константы COMMA и DOT (синонимичное POINT также допускается).
* Распространенные разрешенные в CLEO глобальные переменные.
* Радиостанции.
* Компоненты автомобиля (двери, капот, багажник).
* Базовые цвета автомобилей.
* Стили походки актеров.
* Типы взрывов. Многие дублируются, в константы записаны самые основные, без повторов.
* Иконки радара.
* Коды погоды.
* Банды.
* Номера оружия.
* Типы поездов.
* Типы пикапов.
Также есть три дополнительные константы - три нуля (ZEROES), плавный и резкий переход для игровой камеры (JUMP_INSTANT, JUMP_SMOOTH).
Файл с константами подключается через директиву {$I}.
Большинство из этих констант очень применимы, и избавляют вас от лазания по справке Sanny Builder\'а, однако, если вы хотите их использовать в своих модах, советую пробежаться по их списку, открыв файл.
Вы можете использовать данные функции и константы в своих модах, автора файла и сайт указывать необязательно.
ПРИМЕЧАНИЕ: после компиляции скрипта, их необязательно прилагать вместе со скриптом - директива {$I} работает по принципу подключения кода функции внутрь файла, то есть, функция будет внутри вашего скрипта. То же относится и к константам. (заменена на строку {$I}).
ПРИМЕЧАНИЕ: вы можете использовать и полную форму записи директивы - {$INCLUDE}.