ななついろチャンネルさん向けPythonスクリプト
>-----------------------------
時間式信号機遷移中突入対応版
>-----------------------------
#OBJID=38
import vrmapi
def vrmevent_38(obj,ev,param): #38はセンサー部品のID
di = obj.GetDict()
if ev == 'init':
di['signal'] = vrmapi.LAYOUT().GetSignal(36) #36は信号機のID
di['signal'].SetStat(0,6)
di['evid1'] = 0
di['evid2'] = 0
di['evid3'] = 0
di['evid4'] = 0
elif ev == 'broadcast':
dummy = 1
elif ev == 'timer':
dummy = 1
elif ev == 'time':
dummy = 1
elif ev == 'after':
if param['eventUID'] == 100:
di['signal'].SetStat(0,2)
di['evid2'] = obj.SetEventAfter(5.0,101) #5.0が秒数
if param['eventUID'] == 101:
di['signal'].SetStat(0,3)
di['evid3'] = obj.SetEventAfter(5.0,102) #5.0が秒数
if param['eventUID'] == 102:
di['signal'].SetStat(0,4)
di['evid4'] = obj.SetEventAfter(5.0,103) #5.0が秒数
if param['eventUID'] == 103:
di['signal'].SetStat(0,6)
elif ev == 'frame':
dummy = 1
elif ev == 'catch':
if obj.GetForward() == 1:
obj.ResetEvent(di['evid1'])
obj.ResetEvent(di['evid2'])
obj.ResetEvent(di['evid3'])
obj.ResetEvent(di['evid4'])
di['signal'].SetStat(0,1)
di['evid1'] = obj.SetEventAfter(5.0,100) #5.0が秒数