Document door animation parameters

master
orwell96 2017-01-25 21:55:40 +01:00
parent 54b566e7a7
commit e322e00e3d
1 changed files with 16 additions and 2 deletions

View File

@ -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.