Jump to content

[Question]Railway system


TheGamerXD

Recommended Posts

Hi ! So im a little bit new at this scripting stuff (done 5-6 resources and 2 GM :) ) And as i`m trying to make a 3rd gamemode , i was wondering if i can make something like a railway system . That means that i would map some traks in different zones of the map , and if i can make the normal "ronud" train system go to other places (like making it go to Ocean Docs ) . My question is : Is it possible to do something like this ( the player choses the direction trough a switcher script and so on .

Link to comment

If it's even possible it requires a lot of effort as there's no standard functions to create custom railroads, you can however create your own system with nodes and force free train objects to follow the patterns, that's pretty much how the current system works but rewriting it all in Lua could would be pretty complicated tho. You'll also need to implement the standard functions for your system like the ability for trains to derail, attach cars, justify the speed based on keyboard input and output and stuff like that.

If you intend to write an automatic train system which is completely controlled by bots it's probably easier to, then you just need to find a way to spawn a free train object which aren't bound to any track and then force it to move between certain custom nodes at a certain speed, guess you could create it as an object to accomplish that.

I've heard a rumor long ago regarding custom train tracks to be built in to mtasa that says there's a branch or something where someone attempted to add support for something like this, it was seriously buggy tho but as it's all open source I think that would be easier to fix than building this from scratch hin Lua. I'm interested in that feature myself so I guess I could take a look at it when I get some time over. https://github.com/multitheftauto/mtasa-blue

Update: Here it is: https://github.com/multitheftauto/mtasa-blue/tree/custom-train-tracks, well I guess it does exist a branch for custom train tracks then.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...