// semafor ksztaltowy 2ramienny:
origin (p2) (p3) (p4)
rotate 0 (p5) 0
node -1 0 (p1) model 0 0 0 0 PKP/SK12krat.t3d tabl/ksztaltowe/(p6) Lights 0 endmodel
node 1200 0 none lines 90 90 95 2.0                                          
-0.3 0.0 0.1	 -0.3 7.5 0.1 
endline
node 1200 0 none lines 55 50 50 20.0                                          
0.0 0.0 0.0	 0.0 7.5 0.0 
endline
rotate 0 0 0
endorigin

//STANY SEMAFORA:

// stoj:
event (p1)_Sr1 multiple 0 none (p1)_sem_anim11 (p1)_sem_anim11p (p1)_sem_anim21 (p1)_sem_anim21p (p1)_sem_info_stop endevent

// wolna droga ze zmniejszona do 40 km/h predkoscia
event (p1)_Sr3 multiple 0 none (p1)_sem_anim12 (p1)_sem_anim12p (p1)_sem_anim22 (p1)_sem_anim22p (p1)_sem_info_v40 endevent


// wazne dla AI maszynisty!
// ponizsze zdarzenie jest wyzwalane z toru przy semaforze 
event (p1)_sem_info getvalues 1.0 (p1)_sem_mem endevent


// komorka pamietajaca predkosci oraz nazwy odpowiednich torow
node -1 0 (p1)_sem_mem memcell (p2) (p3) (p4) SetVelocity 0.0 0.0 none endmemcell

// animacja semafora
event (p1)_sem_anim11 animation 0 (p1) rotate ramie_gora 0 0 0 40 endevent
event (p1)_sem_anim12 animation 0 (p1) rotate ramie_gora 0 40 0 40 endevent
event (p1)_sem_anim11p animation 0 (p1) rotate przeslona_01 0 0 0 40 endevent
event (p1)_sem_anim12p animation 0 (p1) rotate przeslona_01 0 45 0 40 endevent


event (p1)_sem_anim21 animation 0 (p1) rotate ramie_dol 0 0 0 40 endevent
event (p1)_sem_anim22 animation 0 (p1) rotate ramie_dol 0 -38 0 40 endevent
event (p1)_sem_anim21p animation 0 (p1) rotate przeslona_02 0 0 0 40 endevent
event (p1)_sem_anim22p animation 0 (p1) rotate przeslona_02 0 45 0 40 endevent


// wpisanie informacji do komorki
event (p1)_sem_info_stop updatevalues 0.0 (p1)_sem_mem SetVelocity 0.0 0.0 endevent
event (p1)_sem_info_v40 updatevalues 1.0 (p1)_sem_mem SetVelocity 40.0 -1 endevent

//zapalanie/gaszenie oswietlenia:
event (p1)_dzienny lights 1.0 (p1) 0 endevent
event (p1)_nocny lights 1.0 (p1) 1 endevent
