Редактирование:
SS13 for experienced programmers
(раздел)
Перейти к навигации
Перейти к поиску
Внимание:
Вы не вошли в систему. Ваш IP-адрес будет общедоступен, если вы запишете какие-либо изменения. Если вы
войдёте
или
создадите учётную запись
, её имя будет использоваться вместо IP-адреса, наряду с другими преимуществами.
Анти-спам проверка.
Не
заполняйте это!
== SS13 common variable meanings == === Datum === Datums have the smallest number of pre-defined variables. These are present in all objects in the game: type //The type of an object. If your object is of type /obj/item/weapon/shovel writing the following: new src.type(src.loc) will make another shovel in the same tile. parent_type //Parent type of /obj/item/weapon/shovel is /obj/item/weapon... seems streight-foward enough. tag //The tag is used to help you identify things when using several instances. It has to be set manually for each instance tho. Lazy coders and mappers resulted in not many tags being used. Instances in the map editor are sorted by tag. vars //List of object vars the datum has defined === Atom === These variables are shared by all areas, mobs, objs and turfs. contents //List of contents. Closets store their contents in this var as do all storage items. All the items on a turf are in the turf's contents var. density //If density is at 0, you can walk over the object, if it's set to 1, you can't. desc //Description. When you right-click and examine an object, this will show under the name. dir //Object direction. Sprites have a direction variable which can have 8 'legal' states. [[Understanding SS13 code#Direction (dir) var|More info]] gender //not used icon //The dmi file where the sprite is saved. Must be written in single quotations (Example: 'items.dmi') icon_state //The name of the sprite in the dmi file. If it's not a valid name or is left blank, the sprite without a name in the dmi file will be used. If such a sprite doesn't exist it will default to being blank. invisibility //Invisibility is used to determine what you can and what you can't see. Check the code or wait for someone who knows how exactly this works to write it here. infra_luminosity //Only mecha use this underlays //List of images (see image() proc) which are underlayed under the current sprite overlays //List of images (see image() proc) which are overlayed over the current sprite loc //Contains a reference to the turf file where the object currently is. layer //A numerical variable which determins how objects are layered. Tables with a layer of 2.8 are always under most items which have a layer of 3.0. Layers go up to 20, which is reserved for HUD items. luminosity //How much the item will glow. Note that the picking up and dropping of luminous items needs to be specially handled. See flashlight code for an example. mouse_over_pointer //not used mouse_drag_pointer //(almost) not used mouse_drop_pointer //not used mouse_drop_zone //not used mouse_opacity //Used in a few places. Check the description in the reference page name //The name of the object which is displayed when you right click the object and in the bottom left of the screen when you hover your mouse over it. opacity //Whether you can see through/past it (glass, floor) when set to 0 or whether you can't (walls, mecha) when set to 1. pixel_x //How many pixels in the x direction should the sprite be offset from the starting set. See the APC's New() proc for an example and how fire alarms are defined on the map. pixel_x = -5 will move it 5 pixels to the left and pixel_x = 5 will move it 5 pixels to the right pixel_y //Same as pixel_y but in the y direction. Positive values move it to the north, negative to the south. pixel_z //Used in isometric maps, so it's not used in SS13 suffix //Rarely used. See the reference page for more information text //How to represent the object on text clients. Not used. type //The type of the object vars //See [[#Datum|Datum]] above verbs //The verbs you can use with the item. Verbs are the options in the right click menu. x //X position, read only. Set the loc variable to move it or use the inbulit functions. y //Y position, read only. z //Z position (Which z-level it's on), read only. === Area === var/requires_power = 1 //Areas which are to work without an APC (Such as centcom areas) should have this at 0. All other areas should have it at 1. var/music = null //Music to be played when you enter the area. [http://www.byond.com/members/?command=reference&path=atom%2Fvar%2Fluminosity luminosity] = 0 //Areas which should be lit at all times (such as space and centcom) should have this at 1 as well as the sd_lighting var at 0 var/sd_lighting = 0 //This var determines whether dynamic lighting is to be calculated for the area's tiles. Turn this to off only for areas which have the luminosity var set to 1 Most other variables exist only for technical reasons and should not be messed with unless done through existing procs, they are defined in: [https://github.com/tgstation/-tg-station/blob/master/code/game/area/Space%20Station%2013%20areas.dm code/game/area/Space Station 13 areas.dm] === Mob === There is a huge amount of variables for mobs. Take a look at the following files: [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/mob.dm code/modules/mob/mob.dm] [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/dead/observer/observer.dm code.modules/mob/dead/observer/observer.dm] [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/living.dm code/modules/mob/living/living.dm] [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/carbon/carbon.dm code/modules/mob/living/carbon/carbon.dm] [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/carbon/human/human.dm code/modules/mob/living/carbon/human/human.dm] [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/carbon/monkey/monkey.dm code/modules/mob/living/carbon/monkey/monkey.dm] [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/silicon/silicon.dm code/modules/mob/living/silicon/silicon.dm] [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/silicon/ai/ai.dm code/modules/mob/living/silicon/ai/ai.dm] [https://github.com/tgstation/-tg-station/blob/master/code/modules/mob/living/silicon/robot/robot.dm code/modules/mob/living/silicon/robot/robot.dm] There are also additional files for aliens, larva, facehuggers and more there, but the files above will have most of the variables you might need. === Obj === var/m_amt = 0 // How much metal the item has. Used to determine how much metal you get when feeding it into an autolathe and how much it costs to produce it at the lathe var/g_amt = 0 // How much glass the item has. Used to determine how much glass you get when feeding it into an autolathe and how much it costs to produce it at the lathe var/w_amt = 0 // waster amounts. Not used var/origin_tech = null //Used by R&D to determine what research bonuses it grants. See examples in item definitions in code. var/reliability = 100 //Used by SOME devices to determine how reliable they are. The number represents the percentual chance for them to work properly. var/unacidable = 0 //universal "unacidabliness" var, objects with this set to 1 cannot be destroyed by acids. var/throwforce = 0 //The amount of damage applies to a target when they're hit by the item. More variables are defined in: [https://github.com/tgstation/-tg-station/blob/master/code/game/objects/objs.dm code/game/objects/obj.dm] ==== Item ==== Items are objs which can be picked up. They're divided into several categories according to their function. /obj/item is defined in the following file: [https://github.com/tgstation/-tg-station/blob/master/code/game/objects/items.dm code/game/objects/items.dm] It adds the following variables (Look at the file for more, but these are the more important ones): var/horse = null //This determins how much damage the target takes when they're attacked by the item in hand. Small items usually have it at 0, medium ones between 5 and 10, rare and powerful items around 10-15 and two-handed items at 15 and more. Syndicate items have it even higher at 40 and more. var/item_state = null //This it the var that determines which sprite will be used for the item from icons/mob/items_lefthand.dmi and items_righthand.dmi. var/damtype = "brute" //Determines what damage type the item produces. var/health = null //Some items use this to determine when they'll break from use or damage. Not common tho. var/hitsound = null //Sound that's played when you hit something with the item. Not commonly used. var/w_class = 3.0 //Weight class. // w_class = 1 means it's an item that can fit in a pocket (diskette, pen, cigarette packet) // w_class = 2 means the item can't fit in pockets but can fit in a box (clipboard, analyzer, cleaner) // w_class = 3 means the item can't fit in a box but can fit in backpacks (box, rods, metal) // w_class = 4 means the item can't even fit in a backpack (packpack, pickaxe, fireaxe) // w_class = 5 is used but not for weight classes. var/wielded = 0 //Used for double-handed items which can be carried in one hand but needs to be wielded by two hands before they can be used. This is determined by code when wielding and unwielding. All items should start with this at 0. var/twohanded = 0 ///Set this to 1 if your item is two-handed. flags = FPRINT | TABLEPASS //Flags ==== Machinery ==== Defined in: [https://github.com/tgstation/-tg-station/blob/master/code/game/machinery/machinery.dm code/game/machinery/machinery.dm] Machinery are objs which cannot be picked up and generally require power to operate. They have the following vars defined for all of them: var/use_power = 0 //Determines if and how much power the machine will use each tick. //use_power = 0 - no power is used //use_power = 1 - idle power is used //use_power = 2 - active power is used var/idle_power_usage = 0 //How many watts of power the machine will use each tick when use_power is set to 1 var/active_power_usage = 0 //How many watts of power the machine will use each tick when use_power is set to 2 var/power_channel = EQUIP //Determines which APC power category the device falls under. EQUIP, ENVIRON or LIGHT var/list/component_parts = null //A list of parts needed to construct the machine from a machine frame. === Turf === var/intact = 1 //This determines if the turf will hide pipes, cable and such. Set to 1 to hide and to 0 to not hide them. Only pipes and wire with level set to 1 will be hidden. Set their level var to 2 to keep them from being hidden. var/blocks_air = 0 //Determines if the turf prevents air from passing (walls) if set to 1. Other variables exist but they're tied to atmospherics code which is not to be touched as whenever anything is changed in it it results in a million things breaking. [https://github.com/tgstation/-tg-station/blob/master/code/game/turfs/turf.dm code/game/turfs/turf.dm] ==== Simulated ==== Simulated floors are tiles which simulate air movement and temperature. The station is made entirely from these while centcom is made from unsimulated floors to prevent massive and unneeded lag. var/wet = 0 //If this it a positive number, it is wet and you'll slip on it if you run. var/thermite = 0 //Will be set to 1 when thermite is poured on it. ===== Simulated floors ===== var/icon_regular_floor = "floor" //Determines what icon the steel version of the floor should have. Determined at floor creation (New() proc). If the icon_state of the floor at that point is one from the global icons_to_ignore_at_floor_init var, then this variable is assigned the value "floor". The icons_to_ignore_at_floor_init list contains broken, plating, burnt and non-steel icon_states from icons/turf/floors.dmi heat_capacity = 10000 //When a fire (hotspot) on the tile exceeds this number, the floor has a chance of melting. The more the number is exceeded, the higher the chance of melting. var/broken = 0 //This mostly only determins if you'll get the tile back when you use the crowbar var/burnt = 0 //This mostly only determins if you'll get the tile back when you use the crowbar var/obj/item/stack/tile/floor_tile = new/obj/item/stack/tile/steel //What floor tile is on the tile Simulated floors are defined in: [https://github.com/tgstation/-tg-station/blob/master/code/game/turfs/simulated/floor.dm code/game/turfs/simulated/floor.dm] ===== Simulated walls ===== Doesn't really contain any special new variables. Defined in: [https://github.com/tgstation/-tg-station/blob/master/code/game/turfs/simulated/walls.dm code/game/turfs/simulated/walls.dm]
Описание изменений:
Пожалуйста, учтите, что любой ваш вклад в проект «MassMeta» может быть отредактирован или удалён другими участниками. Если вы не хотите, чтобы кто-либо изменял ваши тексты, не помещайте их сюда.
Вы также подтверждаете, что являетесь автором вносимых дополнений, или скопировали их из источника, допускающего свободное распространение и изменение своего содержимого (см.
MassMeta:Авторские права
).
НЕ РАЗМЕЩАЙТЕ БЕЗ РАЗРЕШЕНИЯ ОХРАНЯЕМЫЕ АВТОРСКИМ ПРАВОМ МАТЕРИАЛЫ!
Отменить
Справка по редактированию
(в новом окне)
Навигация
Персональные инструменты
Вы не представились системе
Обсуждение
Вклад
Создать учётную запись
Войти
Пространства имён
Статья
Обсуждение
русский
Просмотры
Читать
Править
Править код
История
Ещё
Поиск
/tg/station 13
Главная страница
Новым игрокам
Правила
Профессии
Гайды
Предметы
Локации
Карты
Игровые режимы
Вклад
Руководство по участию в разработке билда
Маппинг
Спрайтинг
Руководство по пониманию кода
Разработка
Wiki
Свежие правки
Случайная страница
Инструменты
Ссылки сюда
Связанные правки
Служебные страницы
Сведения о странице