aboutsummaryrefslogtreecommitdiff
path: root/advtrains_train_subway/init.lua
Commit message (Collapse)AuthorAge
* subway trains: display up to two digitsHume22020-07-25
| | | | | | Additionally, as an addition by gpcf, trains having an S as the first letter of their LN get the number behind the S displayed as a line number
* [BREAKING] Use client-side translations instead of intllib; add zh_CN ↵ywang2020-07-19
| | | | | | | | translations * Client-side translations is used instead of intllib. [Breaks MT4 compat] * Existing locale files have been moved to advtrains/locale and named with the format advtrains.[lang].tr * Add zh_CN locale. (requires a font that supports CJK text)
* Get rid of the "Subway Train" item (was an ugly hack anyways, and is ↵orwell962020-03-08
| | | | obsolete now)
* Merge branch 'mt5-fixes'orwell962020-01-04
|\
| * Move attachment positions down 1 nodeorwell962019-12-05
| |
* | Remove fullbright (H#140)orwell962019-12-18
|/
* Add "X" line symbol for subway trains terminating/service tripsorwell962019-02-05
|
* Fix "subway train" itemorwell962019-01-22
|
* Remove superfluous "tarvelocity" assignmentsorwell962018-11-20
|
* Make "Line" property accessible from OBC and gettable via LATC, change ↵orwell962018-11-20
| | | | subway wagon texture handling
* Fix bugs found while testingorwell962018-06-14
|
* Revert assign_to_seat_group order on subway trainorwell962018-01-15
| | | | as train_operator on Linuxworks, it often happens that you accidentally manually drive a subway train. This is more effort to get to the drivers seat, but is how the behavior was for the last 6 months
* Add bord computer to trainsorwell962018-01-09
| | | | | | | | 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
* Move driving_ctrl_access property to seat grouporwell962018-01-09
| | | | | there's now a more strict check for the train_operator privilege Also added custom reasons on getting on a train.
* Don't use looped sounds on subwayorwell962018-01-07
| | | | (causes engine bugs with dangling sound handles)
* Change controls for trains (again)orwell962018-01-07
|
* Rewrite rail connection system...orwell962017-12-18
| | | | | | | | | ...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)
* Try to fix occasional crash when placing wagonsorwell962017-12-17
|
* Implement sound api and some soundsorwell962017-12-06
| | | | | | | - Level crossing bell - Horns - Subway train driving and door sounds ...to be continued...
* Fix subway train placerorwell962017-10-25
|
* Some workaround fixes for Linuxworks serverorwell962017-10-25
| | | | | Trains no longer get deleted when there's no rail Fast item to create subway train
* Remove zip release files, move mod to root, exclude assets from Makefile (#92)rubenwardy2017-09-20
|
* Restructure mod directoryorwell962017-01-04
|
* remove train type concept and calculate train's capabilities based on used ↵orwell962016-12-22
| | | | wagons
* Turning mod into a modpack and separating the trains from the core modorwell962016-12-20
="hl com"> This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef ENVIRONMENT_HEADER #define ENVIRONMENT_HEADER /* This class is the game's environment. It contains: - The map - Players - Other objects - The current time in the game - etc. */ #include <set> #include "common_irrlicht.h" #include "player.h" #include "map.h" #include <ostream> #include "utility.h" #include "activeobject.h" class Server; class ServerEnvironment; class ActiveBlockModifier; class ServerActiveObject; typedef struct lua_State lua_State; class ITextureSource; class IGameDef; class ClientMap; class Environment { public: // Environment will delete the map passed to the constructor Environment(); virtual ~Environment(); /* Step everything in environment. - Move players - Step mobs - Run timers of map */ virtual void step(f32 dtime) = 0; virtual Map & getMap() = 0; virtual void addPlayer(Player *player); void removePlayer(u16 peer_id); Player * getPlayer(u16 peer_id); Player * getPlayer(const char *name); Player * getRandomConnectedPlayer(); Player * getNearestConnectedPlayer(v3f pos); core::list<Player*> getPlayers(); core::list<Player*> getPlayers(bool ignore_disconnected); void printPlayers(std::ostream &o); u32 getDayNightRatio(); // 0-23999 virtual void setTimeOfDay(u32 time) { m_time_of_day = time; m_time_of_day_f = (float)time / 24000.0; } u32 getTimeOfDay() { return m_time_of_day; } float getTimeOfDayF() { return m_time_of_day_f; } void stepTimeOfDay(float dtime); void setTimeOfDaySpeed(float speed) { m_time_of_day_speed = speed; } float getTimeOfDaySpeed() { return m_time_of_day_speed; } protected: // peer_ids in here should be unique, except that there may be many 0s core::list<Player*> m_players; // Time of day in milli-hours (0-23999); determines day and night u32 m_time_of_day; // Time of day in 0...1 float m_time_of_day_f; float m_time_of_day_speed; // Used to buffer dtime for adding to m_time_of_day float m_time_counter; }; /* Active block modifier interface. These are fed into ServerEnvironment at initialization time; ServerEnvironment handles deleting them. */ class ActiveBlockModifier { public: ActiveBlockModifier(){}; virtual ~ActiveBlockModifier(){}; // Set of contents to trigger on virtual std::set<std::string> getTriggerContents()=0; // Set of required neighbors (trigger doesn't happen if none are found) // Empty = do not check neighbors virtual std::set<std::string> getRequiredNeighbors() { return std::set<std::string>(); } // Trigger interval in seconds virtual float getTriggerInterval() = 0; // Random chance of (1 / return value), 0 is disallowed virtual u32 getTriggerChance() = 0; // This is called usually at interval for 1/chance of the nodes virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n){}; virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n, u32 active_object_count, u32 active_object_count_wider){}; }; struct ABMWithState { ActiveBlockModifier *abm; float timer; ABMWithState(ActiveBlockModifier *abm_); }; /* List of active blocks, used by ServerEnvironment */ class ActiveBlockList { public: void update(core::list<v3s16> &active_positions, s16 radius,