From e322e00e3d3dd7c034c88209b50e685c947f968d Mon Sep 17 00:00:00 2001 From: orwell96 Date: Wed, 25 Jan 2017 21:55:40 +0100 Subject: Document door animation parameters --- advtrains/advtrains/api_doc.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'advtrains') diff --git a/advtrains/advtrains/api_doc.txt b/advtrains/advtrains/api_doc.txt index da0bd8c..af9c071 100644 --- a/advtrains/advtrains/api_doc.txt +++ b/advtrains/advtrains/api_doc.txt @@ -45,9 +45,22 @@ advtrains.register_wagon(name, prototype, description, inventory_image) ^- Only allow getting on and off if doors are open. } } - assign_to_seat_group = {"default"} + assign_to_seat_group = {"default"}, ^- optional, like seat_groups. When player right_clicks the wagon, player will be assigned to the first free seat group in the list. + doors={ + ^- optional. If defined, defines door animation frames. Opposite door has to be closed during animation period. + ^- Remember, advtrains can't handle doors on both sides opened simultaneously. + open={ + [-1]={frames={x=0, y=20}, time=1}, -- open left doors + [1]={frames={x=40, y=60}, time=1} -- open right doors + }, + close={ + [-1]={frames={x=20, y=40}, time=1}, -- close left doors + [1]={frames={x=60, y=80}, time=1} -- close right doors + } + }, + wagon_span=2, ^- How far this wagon extends from its base position. Is the half of the wagon length. ^- Used to determine in which distance the other wagons have to be positioned. Will require tweaking. @@ -97,7 +110,8 @@ On a train, right-clicking the wagon will make you get off the train unless: In case there's no possibility, does nothing. In case there are multiple possibilities, will show a form. -If you can't enter or get off a train because the doors are closed, use shift-rightclick +If you can't enter a train because the doors are closed, any of the train's wagon owners or people authorized by them can open the doors(on the side they are standing) with shift-click. + ### Tracks Most modders will be satisfied with the built-in tracks. If cog railways, maglev trains and mine trains are added, it is necessary to understand the definition of tracks. Although the tracks API is there, explaining it would require more effort than me creating the wanted definitions myself. Contact me if you need to register your own rails using my registration functions. -- cgit v1.2.3