RiftWorks
Найти
Персональное меню
Вы не представились системе
user-interface-preferences
Персональные инструменты
Обсуждение
Вклад
Создать учётную запись
Войти
Параметры
notifications
Редактирование:
Guide to snpc
(раздел)
associated-pages
Статья
Обсуждение
Просмотры
Читать
Править
Править код
История
Внимание:
Вы не вошли в систему. Ваш IP-адрес будет общедоступен, если вы запишете какие-либо изменения. Если вы
войдёте
или
создадите учётную запись
, её имя будет использоваться вместо IP-адреса, наряду с другими преимуществами.
Анти-спам проверка.
Не
заполняйте это!
==NPC base functions== Accessing NPC base functions and controlling them: *Overall, the NPC uses the var "interest" to determine how long they have been doing something, if interest peaks under certain amounts, the NPC will shift to doing something else. Interest goes up while the "doing" var is not equal 0 (has bitflags assigned). *NPCs keep track of their ID and their PDA using the MYID and MYPDA variables. These are direct references to the items, and can be used to activate, unlock/lock, and do all things both would do in general. *NPCs also keep track of what is their hands in a "smart" way. The variables "main_hand" and "other_hand" reference the l_hand and r_hand of the NPC, but are shifted (and can be forced using enforce_hands()) when then NPC drops items, changes items etc, to make sure there is always something in the main_hand. The var "update_hands" can be set to 1 to force a recheck of hands (such as when picking items up) *NPCs have two variables, TARGET and LAST_TARGET, which are used primarly for combat recognition. Setting TARGET to anything other than null will cause the Combat module to attempt to fight that target. LAST_TARGET is the last var TARGET has been set to. Additionally, the var "retal_target" refers to the last person to attack the NPC. *NPCs have a custom travel proc, tryWalk(var/turf), which will attempt to walk them to the target. In cases where you want to force them to walk (such as sidestepping in combat, dancing etc), use walk2derpless(var/target) directly. *Most interaction that NPCs do with the world should use target_filter(var/target) and denied_filter(var/denied) to check if they are valid targets. ===Doing Var=== *The "doing" var has three distinct flags that are checked and changed for what the NPC is doing. ** INTERACTING: defines that an NPC is interacting with something. ** FIGHTING: defines that an NPC is in combat. ** TRAVEL: defines that an NPC is moving from one location to another. ** "doing" is a bitflag and can be changed with doing |= flag to add a flag, or doing = ~doing&flag to remove one.
Описание изменений:
Обратите внимание, что все изменения в RiftWorks рассматриваются как выпущенные на условиях лицензии Creative Commons Attribution-NonCommercial-ShareAlike (см.
RiftWorks:Авторские права
). Если вы не хотите, чтобы ваши тексты свободно распространялись и редактировались любым желающим, не помещайте их сюда.
Вы также подтверждаете, что являетесь автором вносимых дополнений или скопировали их из источника в общественном достоянии или под совместимой лицензией.
Не размещайте без разрешения материалы, защищённые авторским правом!
Отменить
Справка по редактированию
(в новом окне)