question

Cynder loves Portal

L420: High Member
Jan 9, 2016
434
103
On my map tyro station, the admin can override the train timer.

My question is:

how can i make a logic that separates the admin signal control with the normal train control system.

Also, how do you use logic_comapre?

so if the power is off, that is 0 and when it is on, i can set that is 1 so the normal signal reset logic is used.

When the admin overrides the train logic when the power is off, i don't want it to reset to normal while the power is still off.

I have two seperate signal reset logic_relay.

The admin one resets the signals when the admin presses the override.

Normal:

entity
{
"id" "17394"
"classname" "logic_relay"
"spawnflags" "2"
"StartDisabled" "0"
"targetname" "signal_reset"
connections
{
"OnTrigger" "signal_red,LightOn,,0,-1"
"OnTrigger" "signal_green,LightOff,,0,-1"
"OnTrigger" "train_warning_sound,StopSound,,0,-1"
"OnTrigger" "crossing_warning,Disable,,0,-1"
"OnTrigger" "Train_warning_panel_signal_red_1,LightOff,,0,-1"
"OnTrigger" "Train_warning_panel_signal_red_2,LightOff,,0,-1"
"OnTrigger" "signal_red_2,LightOn,,0,-1"
"OnTrigger" "signal_red_3,LightOn,,0,-1"
"OnTrigger" "signal_red_4,LightOn,,0,-1"
"OnTrigger" "signal_red_admin,LightOn,,0,-1"
}
"origin" "-6260.8 -218 14"
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[3000 10500]"
}
}



Admin Signal Reset:

{
"id" "246548"
"classname" "logic_relay"
"spawnflags" "2"
"StartDisabled" "0"
"targetname" "admin_signal_reset"
connections
{
"OnTrigger" "signal_red_4,LightOn,,0,-1"
"OnTrigger" "signal_red_3,LightOn,,0,-1"
"OnTrigger" "signal_red,LightOn,,0,-1"
"OnTrigger" "signal_red_2,LightOn,,0,-1"
"OnTrigger" "signal_green,LightOn,,0,-1"
"OnTrigger" "signal_red,LightOn,,0,-1"
"OnTrigger" "signal_green,LightOff,,0,-1"
"OnTrigger" "signal_red_admin,LightOn,,0,-1"
"OnTrigger" "signal_reset_control,SetValue,0,0,-1"
}
"origin" "-6150 -870 -20"
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[8500 -8268]"
}
}



Here's what I'm using currently:

entity
{
"id" "246526"
"classname" "math_counter"
"max" "1"
"min" "0"
"StartDisabled" "0"
"startvalue" "0"
"targetname" "signal_reset_control"
connections
{
"OnHitMin" "signal_reset,Trigger,,0,-1"
"OnHitMax" "admin_signal_reset,Trigger,,0,-1"
}
"origin" "-6248.73 -194 10"
editor
{
"color" "220 30 220"
"visgroupshown" "1"
"visgroupautoshown" "1"
"logicalpos" "[8500 -8768]"
}
}

The admin train override changes "signal_reset_control" to 1. but here's the problem, I'm going to set a time that resets the signal control back to automatic after a certain time and i want to check the power is off before it does so.
 
Last edited: