Commit Graph

196 Commits (master)

Author SHA1 Message Date
orwell96 8b576357ef Rework the privilege system completely
See privilege_guide.txt for information
2018-03-14 20:57:07 +01:00
Gabriel Pérez-Cerezo 481f6218a8 Log certain events in a logfile in the world directory
(also fix the output of /at_sync_ndb)
2018-02-21 20:03:34 +01:00
orwell96 4c512f1dc5
Allow wagon owners to drive their trains #2
The check was missing at check_seat_group_access
2018-02-20 16:39:31 +01:00
orwell96 e9322075a3
Allow wagon owners to control their own trains
...even without the train_operator privilege
This still doesn't allow them to control switches, but whatever...
2018-02-20 16:22:31 +01:00
orwell96 06cdb14f3d
Do not crash when player gets on a train while it`s turning 2018-02-07 22:29:08 +01:00
orwell96 c93a5bf390 Simplify /at_reroute
It is not necessary to reload the save files, because there already is a function to invalidate train routes e.g. when turnouts are switched
2018-01-23 13:14:40 +01:00
orwell96 418c026038 Correct discouple position
Discouple entity was falsely placed at the position of the wagon
instead of at its end
2018-01-22 22:44:55 +01:00
orwell96 8ef6e9a529
Fix crash
IDK why this happens, but it's not important.
2018-01-17 20:15:06 +01:00
orwell96 fa7f05fd0c
Actually use the static_save property
My PR on this was merged months ago, but i've just noticed that i'm not using it yet
2018-01-15 22:17:56 +01:00
orwell96 e9946d98ac Relayout Wagon Properties form
The button wasn't visible on the screen anymore
2018-01-15 14:45:51 +01:00
orwell96 11da67f426
Add "seat_access" to saved fields
Fixes seat access properties not being saved
Reported by Och_Noe in Linuxworks Server
2018-01-15 13:35:50 +01:00
orwell96 27afd89d1b
Use directory delimter constant
Reported by @kostett, probably the cause of buggy nodedb saving
2018-01-15 13:33:43 +01:00
orwell96 7507dbba3a Add train_operator privilege check on discouple 2018-01-09 22:04:25 +01:00
orwell96 79da249c3d Add bord computer to trains
Features:
- couple/decouple trains from a driver stand
- new couple lock system (owner based, overridable by 'train_remove' privilege)
- all train operators can now change the inside/outside text, allows for multilines
Accessible via right-click menu or by pressing Sneak+Jump keys
2018-01-09 21:30:56 +01:00
orwell96 33a8f0f570 Move driving_ctrl_access property to seat group
there's now a more strict check for the train_operator privilege
Also added custom reasons on getting on a train.
2018-01-09 18:30:29 +01:00
orwell96 ae88f29481 Don't use looped sounds on subway
(causes engine bugs with dangling sound handles)
2018-01-07 20:52:15 +01:00
orwell96 1f26781b6a Change controls for trains (again) 2018-01-07 20:41:48 +01:00
orwell96 07442cfe8f Decrease the amount of garbage saved in save files 2018-01-07 19:00:43 +01:00
orwell96 e3b7046968 Remove path invalidation statement.
Caused problems on multiple detector rails in a row, because paths got cleared in-between a train step
Also optimize some code
2017-12-18 23:44:01 +01:00
orwell96 8a51a10a61 Fix detector lookup in ATC rails 2017-12-18 23:26:01 +01:00
orwell96 09838252fe Do not spam the server chat with messages from /at_sync_ndb and trains going off_track
The off-track warning has moved into the info text of wagons
2017-12-18 23:20:29 +01:00
orwell96 46c4447da0 Rewrite rail connection system...
...to support an arbitrary number of connections for rails, which leads to these new features:
- switches now get recognized by the trackworker correctly
- ability to add real rail crosses
During this, I also rewrote the rail registering system and the conway function (important part of path prediction)
Note, developers: the track preset format changed, you might need to rewrite them according to the presets in tracks.lua if you wrote your own
(possibly breaks advcarts)
2017-12-18 23:09:23 +01:00
orwell96 faa60e2bd4 Use preferred rail orientation algorithm also for double connections 2017-12-18 12:39:38 +01:00
orwell96 cd0aaa53a0 Move train_load() function into advtrains_train_track 2017-12-18 12:21:54 +01:00
orwell96 e9c51dfab4
Make sure an old_velocity is always passed
Fixes crash on placing a new subway wagon
2017-12-06 21:27:04 +01:00
orwell96 dc67ff7226 Implement sound api and some sounds
- Level crossing bell
- Horns
- Subway train driving and door sounds
...to be continued...
2017-12-06 13:23:55 +01:00
orwell96 83df46d786 Change name of update_animation function
I will use this for sounds, and so it needs to be changed to a more general name
2017-11-29 17:20:46 +01:00
orwell96 7681de96c9
remove superfluous parameter
... from update_trainpart_properties call
Prohibits flipping of all wagons when extent_h wasn't set
2017-11-27 17:46:01 +01:00
orwell96 a3d3520fdb Do not modify rails that should not be modified
... when placing tracks, such as slopes
Fixes slopes being replaced by curves.
Also, check the node below for connection (does not check rely, but that would be uneccessary)
2017-11-24 12:31:46 +01:00
orwell96 ef076d6435 Merge branch 'master' of https://github.com/orwell96/advtrains 2017-11-24 12:07:23 +01:00
orwell96 3d29635a8f Correct yaw to preferred rail direction calculation 2017-11-24 12:06:46 +01:00
orwell96 7ea41df5d9
Preserve the player's looking direction
Contributed by @gpcf
2017-11-23 19:59:21 +01:00
orwell96 d78d07589d Add modifiable wagon extents
This will be required for advcarts
2017-11-23 17:00:39 +01:00
orwell96 5fc6cc7f5b Fix multiple track types not working simultaneously
Bug was caused by the drives_on table of every train and advtrains.all_tracktypes
sharing the same reference, which caused advtrains.all_tracktypes to become the
intersection of all train drives_on's in the world.
However, this did become empty, causing nothing to work anymore.
2017-11-22 23:13:42 +01:00
orwell96 2d4833b5a8 do not register wagons in the advtrains namespace automatically
One step towards advcarts compatibility
2017-11-22 22:16:08 +01:00
orwell96 409e2125c9 Make trackplacer align rails by any tracks, not just by tracks with the same nnpref
This finally fixes the need to rotate atc rails and bumpers.
Also prefers rotation that is closer to the player's look dir (placed bumpers will face the player)
2017-11-22 20:46:36 +01:00
orwell96 ce73643b10
Do not punch signs
For some reason, a sign text gets removed by a train when it drives by.
This should fix it.
2017-11-14 23:16:08 +01:00
orwell96 17ee62dc64
Fix occasional crash in discouple on_punch
I think the issue is caused by the new animal damage code...
2017-11-14 22:08:56 +01:00
orwell96 480011c781
Fix entity damage
Animals from mobs weren't damaged because they have the immortal group set.
Instead, we check for the existence of "fleshy".
2017-11-02 18:00:38 +01:00
orwell96 9294e770ca Change name of the node database group in order to clone node database code into a library mod
advtrains will keep its own node database code for reasons of crash recovery, with the handicap that improvements to nplib need to be manually backported.
2017-10-31 13:52:32 +01:00
orwell96 cac7753158 Punch non-player objects when they get overridden by a train. 2017-10-25 14:04:20 +02:00
orwell96 3659fa9e63 Fix subway train placer 2017-10-25 13:31:01 +02:00
orwell96 c5256fb3aa Some workaround fixes for Linuxworks server
Trains no longer get deleted when there's no rail
Fast item to create subway train
2017-10-25 12:34:49 +02:00
orwell96 f1a8b4f505 Implement multi-occupation in detector.on_node table to finally fix collisions 2017-10-25 11:49:34 +02:00
orwell96 1f9a9062e0 Replace many math.floor(x+0.5) calls (or math.floor calls that should be those) by custom atround() function 2017-10-25 10:51:19 +02:00
orwell96 c67770833b Fix coupling and collisions in certain cases
If a train moved towards another train, and the other train's step was executed after the first one's, the trains did eventually not collide.
Fix by moving the enter_node and collision check to step_b
Also change some couple behavior
2017-10-25 10:33:41 +02:00
Gabriel Pérez-Cerezo f228e2d30e Moved default train track to separate mod, for integration with advcarts. 2017-10-25 09:52:10 +02:00
orwell96 291da56aa2 Fix last commit 2017-10-23 14:02:40 +02:00
orwell96 850d8ac570 Fix continous object_property modification
This problem caused flickering of door animations on subways.
2017-10-23 13:56:59 +02:00
Gabriel Pérez-Cerezo 11d6a12ce7 Set wagon line number 2017-10-23 13:40:20 +02:00