{"id":306973,"date":"2020-07-15T15:00:45","date_gmt":"2020-07-15T15:00:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306973"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306973","title":{"rendered":"Source Modding \u2014 \u0427\u0430\u0441\u0442\u044c 2 \u2014 \u0412\u0441\u0451 \u0435\u0441\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/511032\/\">\n<p>Source Engine \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0435\u0435\u0442. \u0412\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043c\u0438\u0440\u0430\u0442\u044c \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/post\/510834\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439<\/a> \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u043e\u043a\u0430 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 VPC \u0438 \u043f\u0435\u0447\u0430\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u043e\u043a\u0430 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u044d\u043d\u0442\u0438\u0442\u0438, \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/al\/8h\/cp\/al8hcprt2ryjbgatbla5mlc-flm.png\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"opyat-terminy\">\u041e\u043f\u044f\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d\u044b<\/h2>\n<p>  <\/p>\n<p><strong>\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u044c<\/strong> \u0438\u043b\u0438 <strong>\u042d\u043d\u0442\u0438\u0442\u0438<\/strong>(entity) \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435.<br \/>  <strong>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 I\/O<\/strong> \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f &quot;\u043e\u0431\u0449\u0435\u043d\u0438\u044f&quot; \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.<br \/>  <strong>\u0418\u043d\u043f\u0443\u0442<\/strong>(input) \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043c\u0435\u043d\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u0411\u044b\u0432\u0430\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u0430 \u0438\u0433\u0440\u043e\u043a\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043b\u0438 \u0430\u0443\u0442\u043f\u0443\u0442\u043e\u043c.<br \/>  <strong>\u0410\u0443\u0442\u043f\u0443\u0442<\/strong>(output) \u2014 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"a-voobsche-kak-eto-rabotaet\">\u0410 \u0432\u043e\u043e\u0431\u0449\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/h2>\n<p>  <\/p>\n<p>\u041b\u044e\u0431\u043e\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432 Source \u2014 \u043d\u0430\u0431\u043e\u0440 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439.<br \/>  \u041d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u043d\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f <code>worldspawn<\/code>. \u042d\u0442\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u2014 \u0432\u0435\u0441\u044c &quot;\u0442\u0432\u0435\u0440\u0434\u044b\u0439&quot; \u043c\u0438\u0440, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b a.k.a. \u0431\u0440\u0430\u0448\u0438 \u2014 \u043a\u0443\u0431\u044b, \u0448\u0430\u0440\u044b, \u0430\u0440\u043a\u0438, etc.<\/li>\n<li>\u0422\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 displacements (\u0434\u0438\u0441\u043f\u044b, <del>\u0434\u0438\u0441\u043f\u0435\u043d\u0441\u0435\u0440\u044b<\/del>) \u2014 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b \u043d\u0430 \u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u044b \u0438\u043b\u0438 (\u041d\u043e\u0432\u044b\u0435 \u043a\u0430\u0440\u0442\u044b \u0432 CS:GO \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u044d\u0442\u043e!) \u0437\u0434\u0430\u043d\u0438\u044f. \u041d\u0435 \u043f\u043e\u0434\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0438\u0445 &quot;\u0441\u043d\u0438\u0437\u0443&quot; \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u043c\u0438.<\/li>\n<li>\u0421\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 (<code>prop_static<\/code>). \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0442\u0435\u0445 \u0436\u0435 <code>prop_dynamic<\/code>, \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0436\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0433\u0440\u043e\u043a\u043e\u0432!) \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<br \/>  \u0412\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eu\/ay\/i2\/euayi2-maqft7mzgk-zieg9fa5q.jpeg\"><\/div>\n<p>  <\/p>\n<ul>\n<li>\u0422\u043e\u0447\u0435\u0447\u043d\u044b\u0435 \u2014 \u044d\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043c\u0438\u0440\u0435 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 <em>\u0442\u043e\u0447\u043a\u0435<\/em>.<\/li>\n<li>\u0411\u0440\u0430\u0448\u0435\u0432\u044b\u0435 \u2014 \u044d\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u0438\u0437 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432.<br \/>  <strong>\u0412\u0410\u0416\u041d\u041e\/Hammer:<\/strong> \u041d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0434\u0438\u0441\u043f\u044b \u0432 \u0431\u0440\u0430\u0448\u0435\u0432\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438!!!<\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"logicheskaya-entiti\">\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u044d\u043d\u0442\u0438\u0442\u0438<\/h2>\n<p>  <\/p>\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u2014 \u0441\u0430\u043c\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438\u0437 \u0432\u0441\u0435\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0438. \u0421\u0430\u043c\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435!<br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c <code>logic_auto<\/code> \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0443\u0442\u043f\u0443\u0442\u043e\u0432 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u0430\u0440\u0442\u044b \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445.<\/p>\n<p>  <\/p>\n<h3 id=\"logic_5---kod\">logic_5 \u2014 \u043a\u043e\u0434<\/h3>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u044f\u0442\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0438\u043d\u043f\u0443\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0446\u0432\u0435\u0442\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<\/p>\n<p>  <\/p>\n<ol>\n<li>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u0433\u0440\u044b \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>logic_5.cpp<\/code>.<br \/>  \u0422\u043e \u0435\u0441\u0442\u044c, \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u043f\u043e \u043f\u0443\u0442\u0438: <code>src\/game\/server\/logic_5.cpp<\/code>.<\/p>\n<p>  <\/li>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0432 \u043d\u0430\u0448 \u0444\u0430\u0439\u043b:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ cbase.h - \u043f\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a. \/\/ \u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u0441\u0451 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434 \u0441\u0443\u0440\u0441. #include &quot;cbase.h&quot; \/\/ memdbgon.h - \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 new \u0438 delete \/\/ memdbgon must be the last include file in a .cpp file!!! #include &quot;tier0\/memdbgon.h&quot;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043a\u043b\u0430\u0441\u0441 <code>CLogicFive<\/code> \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 <code>CLogicEntity<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">class CLogicFive : public CLogicEntity {     DECLARE_CLASS( CLogicFive, CLogicEntity ); public:     \/\/ ... private:     \/\/ ... };<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041f\u043e\u0433\u043e\u0434\u0438\u0442\u0435-\u043a\u0430! \u0427\u0442\u043e \u0437\u0430 DECLARE_CLASS()?<\/strong> \u042d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438. \u041e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u2014 <code>ThisClass<\/code> \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 <code>BaseClass<\/code> \u0434\u043b\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 (\u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u043c\u044b \u043a\u0441\u0442\u0430\u0442\u0438 \u0432\u0438\u0434\u0435\u043b\u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u043e\u043a\u0430&#8230;).<\/p>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434 <code>public<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">public:     DECLARE_DATADESC();     void Input_Tick( inputdata_t &amp;id );<\/code><\/pre>\n<p>  <\/p>\n<p><strong>\u041d\u0443 \u0438 \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e?<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><code>DECLARE_DATADESC()<\/code> \u044d\u0442\u043e \u043c\u0430\u043a\u0440\u043e\u0441, <em>\u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439<\/em> \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043b\u044f \u0434\u0432\u0438\u0436\u043a\u0430.<\/li>\n<li><code>void Input_Tick( inputdata_t &amp;id )<\/code> \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u043e\u0439 \u0438\u043d\u043f\u0443\u0442 <code>tick<\/code>.<\/li>\n<\/ul>\n<p>  <\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0442\u0438\u043a\u043e\u0432 \u043f\u043e\u0434 <code>private<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">private:     int m_iTicks = 0;<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u0430\u043a \u0431\u044b &quot;\u043f\u0440\u0438\u0431\u0438\u0442\u044c \u0433\u0432\u043e\u0437\u0434\u044f\u043c\u0438&quot; \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u043a \u0438\u043c\u0435\u043d\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 <code>logic_5<\/code>.<br \/>  \u0418 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 (\u0435\u0449\u0435 \u043e\u0434\u0438\u043d!) \u043c\u0430\u043a\u0440\u043e\u0441 \u2014 <code>LINK_ENTITY_TO_CLASS()<\/code>!<br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">    \/\/ ...     int m_iTicks = 0; }; LINK_ENTITY_TO_CLASS( logic_5, CLogicFive );<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e <em>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c<\/em> \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0432 \u0448\u0430\u0433\u0435 4:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">BEGIN_DATADESC( CLogicFive )     DEFINE_FIELD( m_iTicks, FIELD_INTEGER ), \/\/ \u043d\u0430\u0448 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0442\u0438\u043a\u043e\u0432     DEFINE_INPUTFUNC( FIELD_VOID, &quot;tick&quot;, Input_Tick ), \/\/ \u043d\u0430\u0448 \u0438\u043d\u043f\u0443\u0442 END_DATADESC();<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><code>BEGIN_DATADESC()<\/code> \u2014 \u043c\u0430\u043a\u0440\u043e\u0441, \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430.<\/li>\n<li><code>DEFINE_FIELD()<\/code> \u2014 \u043c\u0430\u043a\u0440\u043e\u0441, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u043e\u043b\u0435. \u041b\u044e\u0431\u043e\u0435 \u043f\u043e\u043b\u0435, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u044d\u0442\u0438\u043c \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0451 \u043c\u0435\u0441\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f!<\/li>\n<li><code>DEFINE_INPUTFUNC()<\/code> \u2014 \u043c\u0430\u043a\u0440\u043e\u0441, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u043d\u043f\u0443\u0442. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 (<code>FIELD_VOID<\/code>), \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>tick<\/code> \u0438 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <code>Input_Tick<\/code>.<\/li>\n<li><code>END_DATADESC()<\/code> \u2014 \u043c\u0430\u043a\u0440\u043e\u0441, \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043a\u043e\u043d\u0435\u0446 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<\/ul>\n<p>  <\/li>\n<li>\n<p>\u0418\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>Input_Tick<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">\/\/ \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043d\u043f\u0443\u0442\u0430 tick() void CLogicFive::Input_Tick( inputdata_t &amp;id ) {     m_iTicks++;     if( m_iTicks % 5 == 0 )         \/\/ \u0435\u0441\u043b\u0438 \u043d\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0438\u043a\u043e\u0432 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u044f\u0442\u044c, \u043d\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0446\u0432\u0435\u0442\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435!         ConColorMsg( Color( 255, 255, 0 ), &quot;logic_five: Another fifth tick!\\n&quot; ); }<\/code><\/pre>\n<p>  <\/li>\n<li>\n<p>[\u041d\u0415\u041e\u0411\u042f\u0417\u0410\u0422\u0415\u041b\u042c\u041d\u041e] \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u0430\u0448 \u0444\u0430\u0439\u043b \u0432 VPC \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\/\/ src\/game\/server\/server_episodic.vpc \/\/ \u0433\u0434\u0435-\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 $Folder &quot;Source Files&quot; $File &quot;$SRCDIR\/game\/server\/logic_5.cpp<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0442\u0435\u043c, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/li>\n<\/ol>\n<p>  <\/p>\n<h3 id=\"logic_5---v-igre\">logic_5 \u2014 \u0432 \u0438\u0433\u0440\u0435<\/h3>\n<p>  <\/p>\n<ol>\n<li>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0438\u0433\u0440\u0443 \u0438 \u043b\u044e\u0431\u0443\u044e \u043a\u0430\u0440\u0442\u0443 (<code>sdk_vehicles<\/code> \u0438\u043b\u0438 <code>dm_lockdown<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440) <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zx\/11\/r1\/zx11r1s0j6wmh-zwevggqewkitg.png\" align=\"right\"><\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u0430\u0448\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<br \/> \n<pre><code class=\"plaintext\">ent_create logic_5<\/code><\/pre>\n<\/li>\n<li>\u041f\u044f\u0442\u044c \u0440\u0430\u0437 \u0432\u044b\u0437\u043e\u0432\u0438\u0442\u0435 \u0438\u043d\u043f\u0443\u0442 <code>tick<\/code> \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<br \/> \n<pre><code class=\"plaintext\">ent_fire logic_5 tick<\/code><\/pre>\n<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u043f\u044f\u0442\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0436\u0435\u043b\u0442\u043e\u0435 (\u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0433\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438) \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435!<\/li>\n<\/ol>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<h3 id=\"chemu-my-nauchilis\">\u0427\u0435\u043c\u0443 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c?<\/h3>\n<p>  <\/p>\n<p>[\u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e] \u0438\u0437 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u043e\u043a\u0430 \u0432\u044b \u0443\u0437\u043d\u0430\u043b\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u0430\u043a\u0438\u0445 \u0432\u0438\u0434\u043e\u0432 \u043e\u043d\u0438 \u0431\u044b\u0432\u0430\u044e\u0442<\/li>\n<li>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430 \u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439<\/li>\n<li>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"chto-budet-dalshe\">\u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435?<\/h3>\n<p>  <\/p>\n<p>\u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043e\u0441\u043d\u043e\u0432\u0430\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 Valve Hammer Editor \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 FGD \u0444\u0430\u0439\u043b\u043e\u0432.<br \/>  \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u043e\u0437\u0436\u0435 \u044f \u0431\u0443\u0434\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0443\u0440\u043e\u043a, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043d\u0430\u0448\u0435\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u0443\u0442\u043f\u0443\u0442.<\/p>\n<p>  <\/p>\n<h3 id=\"poleznye-ssylki\">\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h3>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/gist.github.com\/undbsd\/f4b4fd12f11462ea47666419d0e7cf94\" rel=\"nofollow\">\u041a\u043e\u0434 \u0438\u0437 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430<\/a><\/li>\n<li><a href=\"https:\/\/developer.valvesoftware.com\/wiki\/Authoring_a_Logical_Entity\" rel=\"nofollow\">\u0421\u0442\u0430\u0442\u044c\u044f \u0442\u043e\u0439 \u0436\u0435 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043d\u0430 VDC<\/a> (\u0415\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u044f \u0434\u0430\u0436\u0435 \u043a\u0443\u0441\u043e\u043a \u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u0442\u0442\u0443\u0434\u0430 \u0432\u044b\u0434\u0440\u0430\u043b :D)<\/li>\n<li><a href=\"http:\/\/developer.valvesoftware.com\/\" rel=\"nofollow\">Valve Developer Community<\/a> \u0438 \u0435\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u0440\u043e <a href=\"https:\/\/developer.valvesoftware.com\/wiki\/SDK_Docs\" rel=\"nofollow\">SSDK<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/undbsd\/refraction-mod\" rel=\"nofollow\">\u041c\u043e\u0439 \u043c\u043e\u0434 [SP] \u0441 \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0438\u043a\u0441\u0430\u043c\u0438<\/a><\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/511032\/\"> https:\/\/habr.com\/ru\/post\/511032\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/511032\/\">\n<p>Source Engine \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0435\u0435\u0442. \u0412\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u043c\u0438\u0440\u0430\u0442\u044c \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/post\/510834\/\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439<\/a> \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u043e\u043a\u0430 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 VPC \u0438 \u043f\u0435\u0447\u0430\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0443\u0440\u043e\u043a\u0430 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u044d\u043d\u0442\u0438\u0442\u0438, \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0432\u0443\u044e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/al\/8h\/cp\/al8hcprt2ryjbgatbla5mlc-flm.png\"><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-306973","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306973"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306973\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}