其實問題在中門上,因此我想知如何改相關字句。
door.AI.osc來自此教學方法:
p2493678.htm#p2493678
以VA為例:
在door_modern_kacha.osc最底找到:
- 代碼: 選擇全部
{macro:trg_bus_dooraft}
(L.L.doorTarget_23) ! (S.L.doorTarget_23)
{if}
(T.L.ev_doortriggeropen_2)
{else}
(T.L.ev_doortriggerclose_2)
{endif}
(C.L.door_druckluft)
{if}
(L.L.bremse_p_Tank04) 100000 - 0.98 * 100000 + (S.L.bremse_p_Tank04)
{endif}
{end}
而在door_AI.osc最底找到:
- 代碼: 選擇全部
{macro:trg_bus_dooraft}
(L.L.bremse_halte_sw) ! (S.L.bremse_halte_sw)
(L.L.bremse_halte_sw)
{if}
(T.L.ev_haltebremse_sw_an)
{else}
(T.L.ev_haltebremse_sw_aus)
{endif}
{end}
我嘗試將AI.bus果段取代door_modern_kacha.osc果段,結果AI成功運作,但自駕版就無法開中門。
之後又望過{macro:Door2_Calc},{macro:Door3_Calc},找到當中的分別:
door_modern_kacha.osc內:
- 代碼: 選擇全部
{macro:Door2_Calc}
(C.L.electric_doors)
{if}
(L.L.doorTarget_23)
{if}
(L.L.door_2) (F.L.door_2_opn_speed) (S.L.doorMaxSpeed_2)
{else}
(L.L.door_2) (F.L.door_2_cls_speed) (S.L.doorMaxSpeed_2)
{endif}
(C.L.bdoor_acc) (S.L.doorAcc_2)
(L.L.doorTarget_23) ! (L.L.doorSpeed_2) s0 abs 0.05 > (L.L.door_2) 0 > || &&
{if}
l0 /-/ (L.L.doorMaxSpeed_2) <
{if}
(L.L.doorSpeed_2) (L.L.doorAcc_2) (L.S.Timegap) * - (S.L.doorSpeed_2)
{else}
(L.L.doorSpeed_2) (L.L.doorAcc_2) (L.S.Timegap) * + (S.L.doorSpeed_2)
{endif}
(L.L.door_2) (L.L.doorSpeed_2) (L.S.Timegap) * + (S.L.door_2)
{else}
(L.L.doorSpeed_2) abs 0.05 > (L.L.door_2) 1 < || (L.L.doorTarget_23) &&
{if}
l0 (L.L.doorMaxSpeed_2) <
{if}
(L.L.doorSpeed_2) (L.L.doorAcc_2) (L.S.Timegap) * + (S.L.doorSpeed_2)
{else}
(L.L.doorSpeed_2) (L.L.doorAcc_2) (L.S.Timegap) * - (S.L.doorSpeed_2)
{endif}
(L.L.door_2) (L.L.doorSpeed_2) (L.S.Timegap) * + (S.L.door_2)
{else}
0 (S.L.doorSpeed_2)
{endif}
{endif}
{else}
(L.L.doorTarget_23) ! (L.L.doorSpeed_2) s0 abs 0.05 > (L.L.door_2) 0 > || &&
{if}
l0 /-/ (L.L.doorMaxSpeed_2) <
{if}
(L.L.doorSpeed_2) (L.L.doorAcc_2) (L.S.Timegap) * - (S.L.doorSpeed_2)
{endif}
(L.L.door_2) (L.L.doorSpeed_2) (L.S.Timegap) * + (S.L.door_2)
{else}
(L.L.doorSpeed_2) abs 0.05 > (L.L.door_2) 1 < || (L.L.doorTarget_23) &&
{if}
l0 (L.L.doorMaxSpeed_2) <
{if}
(L.L.doorSpeed_2) (L.L.doorAcc_2) (L.S.Timegap) * + (S.L.doorSpeed_2)
{endif}
(L.L.door_2) (L.L.doorSpeed_2) (L.S.Timegap) * + (S.L.door_2)
{else}
0 (S.L.doorSpeed_2)
{endif}
{endif}
{endif}
(L.L.door_2) 1 >
{if}
(T.L.ev_doorhitopen_2)
1 (S.L.door_2)
(L.L.doorSpeed_2) /-/ (L.L.doorRefl_2) * (S.L.doorSpeed_2)
{else}
(L.L.door_2) 0 <
{if}
(T.L.ev_doorhitclose_2)
0 (S.L.door_2)
(L.L.doorSpeed_2) /-/ (L.L.doorRefl_2) * (S.L.doorSpeed_2)
{endif}
{endif}
{end}
door_AI.osc內:
- 代碼: 選擇全部
{macro:Door2_Calc}
(L.L.doorTarget_23) ! (L.L.doorSpeed_2) s0 abs 0.05 > (L.L.door_2) 0 > || &&
{if}
l0 /-/ (L.L.doorMaxSpeed_2) <
{if}
(L.L.doorSpeed_2) (L.L.doorAcc_2) (L.S.Timegap) * - (S.L.doorSpeed_2)
{endif}
(L.L.door_2) (L.L.doorSpeed_2) (L.S.Timegap) * + (S.L.door_2)
{else}
(L.L.doorSpeed_2) abs 0.05 > (L.L.door_2) 1 < || (L.L.doorTarget_23) &&
{if}
l0 (L.L.doorMaxSpeed_2) <
{if}
(L.L.doorSpeed_2) (L.L.doorAcc_2) (L.S.Timegap) * + (S.L.doorSpeed_2)
{endif}
(L.L.door_2) (L.L.doorSpeed_2) (L.S.Timegap) * + (S.L.door_2)
{else}
0 (S.L.doorSpeed_2)
{endif}
{endif}
(L.L.door_2) 1 >
{if}
(T.L.ev_doorhitopen_2)
1 (S.L.door_2)
(L.L.doorSpeed_2) /-/ (L.L.doorRefl_2) * (S.L.doorSpeed_2)
{else}
(L.L.door_2) 0 <
{if}
(T.L.ev_doorhitclose_2)
0 (S.L.door_2)
(L.L.doorSpeed_2) /-/ (L.L.doorRefl_2) * (S.L.doorSpeed_2)
{endif}
{endif}
{end}
各自的{macro:Door3_Calc}也很相似,分別只是2改成3。
於是我同樣嘗試將AI果段放入自駕版果段,但令自駕版中門完全無法打開。
自知對script認識很淺,離做整OMSI車開發者仍有一大段距離,所以想向大家請教。
紅色AI代表AI.bus,綠色AI代表自駕車以AI bus模式運作