The easiest way to learn "how to do a mission", is to look into already done scenarios. In
.scn files, You can find several entries called "event" - these are commands for the switches, lights, etc. Events for these elements You can find in their
.inc files. All have been described in Scenery.doc file, which can be found
here. The AI commands You can find
here. Also, please have a look
here (polish text).
Short example:
You want to switch a signal on the semaphore. The entry of it in the scenery (.scn) file is:
include;SS5zpcpbY.inc;Own_semaphore_name;-35795.7;0.0;-3156.63;-105.0;E;72;end
The bolded part is the semaphore "name". In the semaphore .inc file (here: SS5zpcpbY.inc), You can find several entries, like the one below:
event (p1)_s1 multiple 0 none (p1)_sem_ligh1 (p1)_sem_info_stop (p7)_os1 endevent
You are interested only in the name of the event (bolded), where (p1) is the pointer for the semaphore name. So, in
.scn file, the event entry will be as here:
event Event_name multiple 0 none Own_semaphore_name_s1 endevent
When You place f.e.
event0 in a track:
event0 Event_name
the loco, which will stop on this track, will launch the event, and the semaphore will turn to S1 signal (red).
It looks a little bit tricky, but as I wrote above - look into already done missions, find specified names in files and everything will be clear.