From ffc49f097224b028c1d4c70c7e21a22ed127a367 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Wed, 25 Jan 2017 21:23:54 +0100 Subject: Rewrite seating system Players no longer need to worry where to sit down. --- advtrains/advtrains_train_japan/depends.txt | 3 +- advtrains/advtrains_train_japan/init.lua | 83 +++++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 4 deletions(-) (limited to 'advtrains/advtrains_train_japan') diff --git a/advtrains/advtrains_train_japan/depends.txt b/advtrains/advtrains_train_japan/depends.txt index 6f00bf6..1fb6665 100644 --- a/advtrains/advtrains_train_japan/depends.txt +++ b/advtrains/advtrains_train_japan/depends.txt @@ -1 +1,2 @@ -advtrains \ No newline at end of file +advtrains +intllib? \ No newline at end of file diff --git a/advtrains/advtrains_train_japan/init.lua b/advtrains/advtrains_train_japan/init.lua index ad26fd1..ffe169f 100644 --- a/advtrains/advtrains_train_japan/init.lua +++ b/advtrains/advtrains_train_japan/init.lua @@ -13,11 +13,49 @@ advtrains.register_wagon("engine_japan", { seats = { { name=S("Driver stand"), - attach_offset={x=0, y=10, z=0}, + attach_offset={x=0, y=8, z=13}, view_offset={x=0, y=0, z=0}, driving_ctrl_access=true, + group="dstand", + }, + { + name="1", + attach_offset={x=-4, y=8, z=0}, + view_offset={x=0, y=0, z=0}, + group="pass", + }, + { + name="2", + attach_offset={x=4, y=8, z=0}, + view_offset={x=0, y=0, z=0}, + group="pass", + }, + { + name="3", + attach_offset={x=-4, y=8, z=-8}, + view_offset={x=0, y=0, z=0}, + group="pass", + }, + { + name="4", + attach_offset={x=4, y=8, z=-8}, + view_offset={x=0, y=0, z=0}, + group="pass", }, }, + seat_groups = { + dstand={ + name = "Driver Stand", + access_to = {"pass"}, + require_doors_open=true, + }, + pass={ + name = "Passenger area", + access_to = {"dstand"}, + require_doors_open=true, + }, + }, + assign_to_seat_group = {"dstand", "pass"}, doors={ open={ [-1]={frames={x=0, y=20}, time=1}, @@ -42,11 +80,50 @@ advtrains.register_wagon("wagon_japan", { max_speed=20, seats = { { - name=S("Default Seat"), - attach_offset={x=0, y=10, z=0}, + name="1", + attach_offset={x=-4, y=8, z=8}, + view_offset={x=0, y=0, z=0}, + group="pass", + }, + { + name="2", + attach_offset={x=4, y=8, z=8}, + view_offset={x=0, y=0, z=0}, + group="pass", + }, + { + name="1a", + attach_offset={x=-4, y=8, z=0}, + view_offset={x=0, y=0, z=0}, + group="pass", + }, + { + name="2a", + attach_offset={x=4, y=8, z=0}, view_offset={x=0, y=0, z=0}, + group="pass", + }, + { + name="3", + attach_offset={x=-4, y=8, z=-8}, + view_offset={x=0, y=0, z=0}, + group="pass", + }, + { + name="4", + attach_offset={x=4, y=8, z=-8}, + view_offset={x=0, y=0, z=0}, + group="pass", + }, + }, + seat_groups = { + pass={ + name = "Passenger area", + access_to = {}, + require_doors_open=true, }, }, + assign_to_seat_group = {"pass"}, doors={ open={ [-1]={frames={x=0, y=20}, time=1}, -- cgit v1.2.3