
PluginHeader{
	RailSimVersion = 2.00;
	PluginType = Train;
	PluginName = "大交20系30番台素材";
	PluginAuthor = "n";
	IconTexture = "icon.png";
}
TrainInfo{
	FrontLimit = 9.35;
	TailLimit = -9.35;
	MaxVelocity = 70.0;
	MaxAcceleration = 3.0;
	MaxDeceleration = 3.5;
	DoorClosingTime = 5.0;
}
DefineSwitch "電源"{
GroupCommon = "nomtb2030電源";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "前照灯・尾灯"{
GroupCommon = "nomtb2030前照灯";
	Entry = "自動";
	Entry = "入替";
	Entry = "切";
}
DefineSwitch "幕灯"{
GroupCommon = "nomtb2030幕灯";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "運転室灯"{
GroupCommon = "nomtb2030運転室灯";
	Entry = "自動";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "客室照明"{
GroupCommon = "nomtb2030客室灯";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "行先"{
GroupCommon = "nomtb2030行先";
	Entry = "無表示";
	Entry = "大日";
	Entry = "八尾南";
	Entry = "守口";
	Entry = "文の里";
	Entry = "都島";
	Entry = "喜連瓜破";
	Entry = "長原";
	Entry = "";
	Entry = "";
	Entry = "";
	Entry = "";
	Entry = "回送";
	Entry = "試運転";
	Entry = "臨時";
}
DefineSwitch "編成"{
GroupCommon = "nomtb2030編成";
	Entry = "31";
	Entry = "32";
	Entry = "33";
	Entry = "34";
	Entry = "35";
	Entry = "36";
	Entry = "37";
	Entry = "38";
	Entry = "39";
}
DefineSwitch "号車"{
	Entry = "1号車(八尾南方先頭)";
	Entry = "2号車";
	Entry = "3号車";
	Entry = "4号車";
	Entry = "5号車";
	Entry = "6号車(大日方先頭)";
}
DefineSwitch "遮光幕"{
	Entry = "開";
	Entry = "閉";
}
DefineSwitch "帯"{
GroupCommon = "nomtb2030帯";
	Entry = "旧";
	Entry = "新";
	Entry = "";
}
DefineSwitch "転落防止幌"{
GroupCommon = "nomtb2030転落防止幌";
	Entry = "有(2000〜)";
	Entry = "無";
}
DefineSwitch "簡易影"{
	GroupCommon = "nomtb2030簡易陰";
	Entry = "入";
	Entry = "切";
}

PrimaryAssembly{
	Axle "wheel1"{
		ModelFileName = "../n_omtbn20_1/wheel.x";
		CastShadow = no;
		AlphaZeroTest = 0,1;
		Diameter = 0.86;
		Symmetric = 16;
		Coord = (7.3,0.43);
	}
	Axle "wheel2"{
		ModelFileName = "../n_omtbn20_1/wheel.x";
		CastShadow = no;
		AlphaZeroTest = 0,1;
		Diameter = 0.86;
		Symmetric = 16;
		Coord = (5.1,0.43);
	}
	Axle "wheel3"{
		ModelFileName = "../n_omtbn20_1/wheel.x";
		CastShadow = no;
		AlphaZeroTest = 0,1;
		Diameter = 0.86;
		Symmetric = 16;

		Coord = (-7.3,0.43);
	}
	Axle "wheel4"{
		ModelFileName = "../n_omtbn20_1/wheel.x";
		CastShadow = no;
		AlphaZeroTest = 0,1;
		Diameter = 0.86;
		Symmetric = 16;
		Coord = (-5.1,0.43);
	}
	Body "Bogie1"{
		ModelFileName = "../n_omtbn20_1/bogie_t.x";
		ApplySwitch "号車"{
		Case 0,2,3:
			ChangeModel = "../n_omtbn20_1/bogie_m.x", 1.0;
		}
		JointZY "wheel1"{
			AttachCoord = (0,0);
			LocalCoord = (1.1, 0.0);
		}
		JointZY "wheel2"{
			AttachCoord = (0,0);
			LocalCoord = (-1.1, 0.0);
		}
	}
	Body "Bogie2"{
		ModelFileName = "../n_omtbn20_1/bogie_t.x";
		Turn = yes;
		ApplySwitch "号車"{
		Case 0,3:
			ChangeModel = "../n_omtbn20_1/bogie_m.x", 1.0;
		}
		JointZY "wheel3"{
			AttachCoord = (0.0,0.0);
			LocalCoord = (1.1, 0.0);
		}
		JointZY "wheel4"{
			AttachCoord = (0,0);
			LocalCoord = (-1.1, 0.0);
		}
	}
	Body "Dummy"{
		ModelFileName = "";
		ModelScale = 1.0;
		JointZY "Bogie1"{
			AttachCoord = (0.0, 0.57);
			LocalCoord = (6.2, 1.0);
		}
		JointZY "Bogie2"{
			AttachCoord = (0.0, 0.57);
			LocalCoord = (-6.2, 1.0);
		}
	}
	Object3D "MainBody"{
		ModelFileName = "body1.x";
		ChangeAlpha = 40,0.0;
		NoShadow = 1,40;
		NoCastShadow = 7,8,9,13,14;
		Transparent = 41,42,43,44;
		ApplySwitch "号車"{
		Case 1,2,3,4:
			ChangeModel = "body2.x", 1.0;
		}
		If "電源"==0{
			If "前照灯・尾灯"==0 && !"_FRONT"&&!"_CONNECT1"{
						ChangeMaterial{
							MaterialID = 1;
							Emissive = 1.0, 1.0, 1.0;
　　　　　	　　				}
						ShiftTexture = 1, -0.25, 0.6875;
						ChangeAlpha = 1,1.0;
　　　　　	　　	}
			If "前照灯・尾灯"==1 && !"_FRONT"&&!"_CONNECT1"{
						ChangeMaterial{
							MaterialID = 1;
							Emissive = 1.0, 1.0, 1.0;
　　　　　	　　				}
						ChangeAlpha = 1,1.0;
　　　　　	　　	}
			If ("前照灯・尾灯"==0 || "前照灯・尾灯"==1)&& "_FRONT"&&!"_CONNECT1"{
						ChangeMaterial{
							MaterialID = 1;
							Emissive = 1.0, 1.0, 1.0;
　　　　　	　　				}
						ShiftTexture = 1, 0.0, 0.6875;
						ChangeAlpha = 1,1.0;
　　　　　	　　	}
			If "幕灯"==0{
					ChangeMaterial{
						MaterialID = 2;
						Emissive = 1.0, 1.0, 1.0;
　　　　　	　　		}
			}
			If "客室照明"==0{
					ChangeMaterial{
						MaterialID = 29,30,31,32,33,34,35,36,37,38,39;
						Emissive = 1.0, 1.0, 1.0;
　　　　　	　　		}
			}
			If "運転室灯"==1 || ("運転室灯"==0 && "_FRONT"){
					ChangeMaterial{
						MaterialID = 22,23,24,25,26,27,28;
						Emissive = 1.0, 1.0, 1.0;
　　　　　	　　		}
			}
		}


		ApplySwitch "遮光幕"{
			Case 1:
				ShiftTexture = 42, 0.25, 0.0;
		}
		ApplySwitch "帯"{
			Case 0:
				NoCastShadow = 11;
				NoShadow = 10;
				ChangeAlpha = 10,0.0;
			Case 1:
				ShiftTexture = 3, 0.0, 0.15625;
				ShiftTexture = 18, 0.0, 0.5;
				NoCastShadow = 10;
				NoShadow = 11;
				ChangeAlpha = 11,0.0;
			Case 2:
				ShiftTexture = 3, 0.0, 0.3125;
				ChangeTexture = 4, "tex/前面_00.png";
				NoCastShadow = 11;
				NoShadow = 10;
				ChangeAlpha = 10,0.0;
				ChangeTexture = 45, "tex/#007213.png";
		}
		ApplySwitch "帯"{
		Case 2:
			ApplySwitch "行先"{
			Case 1:
				ShiftTexture = 2, 0.5, 0.125;
			Case 2:
				ShiftTexture = 2, 0.5, 0.25;
			Case 3:
				ShiftTexture = 2, 0.5, 0.375;
			Case 4:
				ShiftTexture = 2, 0.5, 0.5;
			Case 5:
				ShiftTexture = 2, 0.5, 0.625;
			Case 6:
				ShiftTexture = 2, 0.5, 0.75;
			Case 7:
				ShiftTexture = 2, 0.5, 0.875;
			Case 8:
				ShiftTexture = 2, 0.75, 0.0;
			Case 9:
				ShiftTexture = 2, 0.75, 0.125;
			Case 10:
				ShiftTexture = 2, 0.75, 0.25;
			Case 11:
				ShiftTexture = 2, 0.75, 0.375;
			Case 12:
				ShiftTexture = 2, 0.25, 0.5;
			Case 13:
				ShiftTexture = 2, 0.25, 0.625;
			Case 14:
				ShiftTexture = 2, 0.25, 0.75;
			}
			ApplySwitch "編成"{
			Case 0:
				ShiftTexture = 8, 0.1875, 0.0;
			Case 1:
				ShiftTexture = 8, 0.1875, 0.125;
			Case 2:
				ShiftTexture = 8, 0.1875, 0.25;
			Case 3:
				ShiftTexture = 8, 0.1875, 0.375;
			Case 4:
				ShiftTexture = 8, 0.1875, 0.5;
			Case 5:
				ShiftTexture = 8, 0.1875, 0.625;
			Case 6:
				ShiftTexture = 8, 0.1875, 0.75;
			}
		Default:
			ApplySwitch "行先"{
			Case 1:
				ShiftTexture = 2, 0.0, 0.125;
			Case 2:
				ShiftTexture = 2, 0.0, 0.25;
			Case 3:
				ShiftTexture = 2, 0.0, 0.375;
			Case 4:
				ShiftTexture = 2, 0.0, 0.5;
			Case 5:
				ShiftTexture = 2, 0.0, 0.625;
			Case 6:
				ShiftTexture = 2, 0.0, 0.75;
			Case 7:
				ShiftTexture = 2, 0.0, 0.875;
			Case 8:
				ShiftTexture = 2, 0.25, 0.0;
			Case 9:
				ShiftTexture = 2, 0.25, 0.125;
			Case 10:
				ShiftTexture = 2, 0.25, 0.25;
			Case 11:
				ShiftTexture = 2, 0.25, 0.375;
			Case 12:
				ShiftTexture = 2, 0.25, 0.5;
			Case 13:
				ShiftTexture = 2, 0.25, 0.625;
			Case 14:
				ShiftTexture = 2, 0.25, 0.75;
			}
			ApplySwitch "編成"{
			Case 0:
			Case 1:
				ShiftTexture = 8, 0.0, 0.125;
			Case 2:
				ShiftTexture = 8, 0.0, 0.25;
			Case 3:
				ShiftTexture = 8, 0.0, 0.375;
			Case 4:
				ShiftTexture = 8, 0.0, 0.5;
			Case 5:
				ShiftTexture = 8, 0.0, 0.625;
			Case 6:
				ShiftTexture = 8, 0.0, 0.75;
			Case 7:
				ShiftTexture = 8, 0.0, 0.875;
			Case 8:
				ShiftTexture = 8, 0.1875, 0.875;
			}
		}
		ApplySwitch "号車"{
			Case 1:
				ShiftTexture = 7, 0.0, 0.125;
			Case 2:
				ShiftTexture = 7, 0.0, 0.25;
			Case 3:
				ShiftTexture = 7, 0.0, 0.375;
			Case 4:
				ShiftTexture = 7, 0.0, 0.5;
			Case 5:
				ShiftTexture = 7, 0.0, 0.625;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "yuka"{
		ModelFileName = "";
		ApplySwitch "号車"{
			Case 0:ChangeModel = "../n_omtbn20_1/yuka_20600.x", 1.0;
			Case 1,3,4:ChangeModel = "../n_omtbn20_1/yuka_20100.x", 1.0;
			Case 2:ChangeModel = "../n_omtbn20_1/yuka_20500.x", 1.0;
			Case 5:ChangeModel = "../n_omtbn20_1/yuka_20600.x", 1.0;
				StaticRotation{
					RotationAxis = (0.0, 1.0, 0.0);
					RotationAngle = 180;
				}
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "yuka_c"{
		ModelFileName = "../n_omtbn20_1/yuka_f.x";
		ApplySwitch "号車"{
			Case 1,2,3,4:
				ChangeModel = "../n_omtbn20_1/yuka_c.x", 1.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "Horo"{
		ModelFileName = "";
		If "転落防止幌"==0 && ("号車"<5&&"号車">0){
			ChangeModel = "../n_omtbn20_1/horo.x", 1.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "Horo-z"{
		ModelFileName = "";
		ApplySwitch "転落防止幌"{
			Case 0:
				ChangeModel = "../n_omtbn20_1/horo.x", 1.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "Doorll"{
		ModelFileName = "Doorl.x";
		Transparent = 5;
		If "電源"==0 && "客室照明"==0{
				ChangeMaterial{
					MaterialID = 0;
					Emissive = 1.0, 1.0, 1.0;
				}
　　　　　　　　}
		If "_DOOR1"{
			StaticMove{
				Displacement = (0.0, 0.0, 0.6);
				PreAnimationDelay = 1.0;
				AnimationTime = 1.5;
				 PreReverseDelay = 0.5;
				ReverseTime = 1.5;
			}
			StaticMove{
				Displacement = (0.0, 0.0, 0.05);
				PreAnimationDelay = 2.5;
				AnimationTime = 0.5;
				 PreReverseDelay = 2.0;
				ReverseTime = 0.5;
			}
		}
		ApplySwitch "帯"{
			Case 1:
				TransformTexture = 1, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}

	Object3D "Doorlr"{
		ModelFileName = "Doorr.x";
		Transparent = 5;
		If "電源"==0 && "客室照明"==0{
				ChangeMaterial{
					MaterialID = 0;
					Emissive = 1.0, 1.0, 1.0;
				}
　　　　　　　　}
		If "_DOOR1" {
			StaticMove{
				Displacement = (0.0, 0.0, -0.6);
				PreAnimationDelay = 1.0;
				AnimationTime = 1.5;
				 PreReverseDelay = 0.5;
				ReverseTime = 1.5;
			}
			StaticMove{
				Displacement = (0.0, 0.0, -0.05);
				PreAnimationDelay = 2.5;
				AnimationTime = 0.5;
				 PreReverseDelay = 2.0;
				ReverseTime = 0.5;
			}
		}
		ApplySwitch "帯"{
			Case 1:
				TransformTexture = 1, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "Doorrl"{
		ModelFileName = "Doorr.x";
		TransformTexture = 2, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0;
		Transparent = 5;
		If "電源"==0 && "客室照明"==0{
				ChangeMaterial{
					MaterialID = 0;
					Emissive = 1.0, 1.0, 1.0;
				}
　　　　　　　　}
		If "_DOOR2"{
			StaticMove{
				Displacement = (0.0, 0.0, -0.6);
				PreAnimationDelay = 1.0;
				AnimationTime = 1.5;
				 PreReverseDelay = 0.5;
				ReverseTime = 1.5;
			}
			StaticMove{
				Displacement = (0.0, 0.0, -0.05);
				PreAnimationDelay = 2.5;
				AnimationTime = 0.5;
				 PreReverseDelay = 2.0;
				ReverseTime = 0.5;
			}
		}
		ApplySwitch "帯"{
			Case 1:
				TransformTexture = 1, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}

	Object3D "Doorrr"{
		ModelFileName = "Doorl.x";
		TransformTexture = 2, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0;
		Transparent = 5;
		If "電源"==0 && "客室照明"==0{
				ChangeMaterial{
					MaterialID = 0;
					Emissive = 1.0, 1.0, 1.0;
				}
　　　　　　　　}
		If "_DOOR2" {
			StaticMove{
				Displacement = (0.0, 0.0, 0.6);
				PreAnimationDelay = 1.0;
				AnimationTime = 1.5;
				 PreReverseDelay = 0.5;
				ReverseTime = 1.5;
			}
			StaticMove{
				Displacement = (0.0, 0.0, 0.05);
				PreAnimationDelay = 2.5;
				AnimationTime = 0.5;
				 PreReverseDelay = 2.0;
				ReverseTime = 0.5;
			}
		}
		ApplySwitch "帯"{
			Case 1:
				TransformTexture = 1, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0;
		}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
			AttachDir = (0.0, 0.0, -1.0);
		}
	}
	Object3D "Doorl"{
		ModelFileName = "../n_omtbn20_1/tojime.x";
		StaticRotation{
			RotationAxis = (0.0, 1.0, 0.0);
			RotationAngle = 180;
		}
		If "_DOOR2"{
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 180;
				PreAnimationDelay = 1.0;
				AnimationTime = 0.0;
				 PreReverseDelay = 2.5;
				ReverseTime = 0.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (1.41, 3.175, -0.45);
		}
	}
	Object3D "Doorr"{
		ModelFileName = "../n_omtbn20_1/tojime.x";
		If "_DOOR1"{
			StaticRotation{
				RotationAxis = (0.0, 1.0, 0.0);
				RotationAngle = 180;
				PreAnimationDelay = 1.0;
				AnimationTime = 0.0;
				 PreReverseDelay = 2.5;
				ReverseTime = 0.0;
			}
		}
		Joint3D "MainBody"{
			AttachCoord = (-1.41, 3.175, 0.45);
		}
	}
	Object3D "Shadow"{
		ModelFileName = "../n_omtbn20_1/Shadow.x";
		NoCastShadow = 0;
			ApplySwitch "簡易影"{
			Case 1:
			ChangeModel = "", 1.0;
			}
		Joint3D "MainBody"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	FrontCabin{
		Joint3D "MainBody"{
			AttachCoord = (0.0,0.0,0.0);
		}
	}
}

