Результаты (
русский) 3:
[копия]Скопировано!
moveablegates = {};
функцию moveablegates. prerequisitespresent (специальностям)
возвращение specializationutil. hasspecialization (animatedvehicle, специальностей);
функции; moveablegates: нагрузки (xmlfile)
self.movegate = specializationutil. callspecializationsfunction ("movegate");
self.gatecontroltriggercallback = moveablegates. gatecontroltriggercallback; self.moveablegates = {}
местные num = 0;
и правда не
основные местные = "транспортного средства. moveablegates. ворота (". tostring (ням). ")"; ", если не hasxmlproperty (xmlfile, ключ), потом
перерыв;
; местных ворота = {}
gate.animationname = getxmlstring (xmlfile, ключ..." # animationname ");
gate.axisname = getxmlstring (xmlfile, ключ..." # axisname ");
gate.helppaneltextname = getxmlstring (xmlfile, ключ..." # helppaneltextname ");
ворота.Inputbinding gate.axisname axisindex = []; gate.iconfilename = utils.getfilename подогрева (getxmlstring (xmlfile, key... "# iconfile"), self.basedirectory); G:addiconfilename _ mousecontrolshelp подогрева подогрева (gate.iconfilename gate.speedfactor utils.getnonil (); = (xmlfile key... ", getxmlfloat # speedfactor"), gate.mousespeedfactor = 1);
((xmlfile, getxmlfloat utils.getnonil "# mousespeedfactor key...", 1);
)если getxmlstring (xmlfile, ключ... "# steeringstickindex") ~ = 0 тогда
gate.steeringstick - utils. indextoobject (self.components, getxmlstring (xmlfile, ключ... "# steeringstickindex");
gate.steeringstickamplitude = математика. (RAD - utils. getnonil (getxmlfloat (xmlfile, ключ... "# steeringstickamplitude"), 15));
_, _, gate.steeringstickrotzbackup = getrotation (ворота. steeringstick);
конец;местные action = inputbinding. действия [ворота. axisindex];] gate.helptext = g_i18n: gettext (ворота. helppaneltextname),.. "". keyboardhelper. getkeynames (действий. keys1). "/". keyboardhelper. getkeynames (действий. keys2);
столом. "(self.moveablegates, ворота);
num = num 1;
цели;
self.gatecontroltrigger - utils. indextoobject (self.components, getxmlstring (xmlfile" транспортное средство.moveablegates # controltriggerindex ");
addtrigger (self.gatecontroltrigger", gatecontroltriggercallback ",");
self.playerisingatecontroltrigger = true;
функции; moveablegates: delete()
removetrigger (самостоятельно. gatecontroltrigger);
функции; moveablegates: loadfromattributesandnodes (xmlfile, ключ, ключ, ключ, resetvehicles)
местных gatetimesstr = getxmlstring (xmlfile ключевые... "# gatetimes"); "если gatetimesstr ~ = 0 тогда
местных gatetimes - utils. splitstring ("", gatetimesstr);
для = 1, таблица. getn (самостоятельно. moveablegates)
местных ворота = самостоятельно. moveablegates [];
местных animtime = tonumber (gatetimes []);
я: movegate a, animtime);
цели;
цели;
возвращение basemission. vehicle_load_ok;
функции; moveablegates: getsaveattributesandnodes (nodeIdent)
местные атрибуты = 'gatetimes = ""; "за = 1,таблица. getn (самостоятельно. moveablegates)
местных ворота = самостоятельно. moveablegates [];
местных animtime = самостоятельно: getanimationtime (ворота. animationname);
атрибуты = атрибуты. tostring (animtime),.. ""; "конец;
атрибуты = атрибуты.." ";" возвращение атрибуты ","
функции;; moveablegates: readstream (streamid, связи)
для = 1, таблица. getn (самостоятельно. moveablegates)
местных ворота = самостоятельно. moveablegates [];]местные animtime = streamreadfloat32 (streamid);
я: movegate (а, animtime, правда);
цели;
функции; moveablegates: writestream (streamid, связи)
для = 1, таблица. getn (самостоятельно. moveablegates)
местных ворота = самостоятельно. moveablegates [];] местные animtime = самостоятельно: getanimationtime (ворота. animationname);
streamwritefloat32 (streamid, animtime);
цели;
функции; moveablegates: mouseevent (posx, пози, как утверждается, isdown,isup, кнопку)
функции; moveablegates: keyevent (Unicode, sym, модификатор, isdown)
функции; moveablegates: обновление (DT)
местных gatesmoved = false;
, если g_currentmission.player ~ = 0 и g_currentmission.player.isentered тогда
местный магазин, пи, PZ = getworldtranslation (g_currentmission rootnode. игрок.);
местных TX, тай, TZ = getworldtranslation (самостоятельно. gatecontroltrigger);
если самостоятельно.playerisingatecontroltrigger и self.attachervehicle ~ = 0 - utils. vector3length (PX - TX, пи, тай, PZ TZ) < 5 тогда
для = 1, таблица. getn (самостоятельно. moveablegates)
местных ворота = самостоятельно. moveablegates [];
местных двигаться, axistype = inputbinding. getinputaxis (ворота. axisindex);
местных steeringstickamplitude = 0;
, если gate.steeringstick = = 0 тогда
steeringstickamplitude = 0;
цели;
, если двигаться ~ = 0 тогда
gatesmoved = true;
местных скорость = DT * 0.001;
, если axistype = = inputbinding.inputtype_mouse_axis тогда
скорость = скорость продвижения * * ворота. speedfactor;
скорость = скорость продвижения еще * * ворота. mousespeedfactor;
местных animtime =; сам: getanimationtime (ворота. animationname);
я: movegate (а, animtime скорости);
g_mousecontrolshelp: seticonfilename ("ворота. iconfilename);
если steeringstickamplitude ~ = 0 тогда
, если двигаться > 0 тогда
steeringstickamplitude = ворота. steeringstickamplitude;
еще
steeringstickamplitude = 0-gate. steeringstickamplitude;
цели;
цели;
elseif вклада. ismousebuttonpressed (материалы. mouse_button_left) или информацию. ismousebuttonpressed (материалы. mouse_button_right), а затем
gatesmoved = true, если steeringstickamplitude ~ = 0 тогда
steeringstickamplitude = 0;]целью;
еще
, если steeringstickamplitude ~ = 0 тогда
steeringstickamplitude = 0;
цели;
gate.steeringstick; если ~ = 0 тогда
setrotation (gate.steeringstick, 0, 0, gate.steeringstickrotzbackup steeringstickamplitude);
self.playerisingatecontroltrigger; если затем
g_currentmission: addextraprinttext (ворота. helptext); ";
цели;
цели;
- g_currentmission: setshowhasmousebuttoninput (ложные);
- нет конца; решение кэм, используя мышь / геймпад
, если gatesmoved тогда
g_currentmission.isplayerfrozen = false;
g_currentmission.controlplayer = true;
g_currentmission.isplayerfrozenchangedbymoveablegates = true;
elseif g_currentmission.isplayerfrozenchangedbymoveablegates тогда
g_currentmission.isplayerfrozen = false;
g_currentmission.controlplayer = true;
g_currentmission.isplayerfrozenchangedbymoveablegates = false;
цели;
функции; moveablegates: updatetick (DT)
функции; moveablegates: draw()
функции; moveablegates: gatecontroltriggercallback (triggerid, otherid, onenter, onleave, onstay, othershapeid): если g_currentmission.player ~ = 0 тогда
, если g_currentmission.player.rootnode = = otherid и g_currentmission.player.isentered тогда, если onenter тогда
self.playerisingatecontroltrigger = true;
elseif onleave тогда
self.playerisingatecontroltrigger = false;
конец конец конец;
конец;;,
функцию moveablegates: movegate (gateindex, animtime, noeventsend)
местных ворота = самостоятельно. moveablegates [gateindex];
я: setanimationtime (gate.animationname, animtime, правда);
для = 1, таблица. getn (самостоятельно. movingparts)
cylindered. updatemovingpart (сами, самостоятельно.movingparts [], ложные);
; если не noeventsend тогда
movegateevent. sendevent (самостоятельно, gateindex, animtime, noeventsend); ";";
переводится, пожалуйста, подождите..
