Jump to content
duda123

Advanced Train Simulator (ATS)

Recommended Posts

5 hours ago, jacknorrisuk said:

Not that I have any idea how you developed this, but - if you achieve Chernarus compatibility, does that mean that the large gauge CUP tracks will work on other maps too? I'm working on a UK terrain with the CUP tracks and would love to get ATS up and running on it. :)

 

Yes, as long as they are terrain objects, they should work.

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, beeper said:

Bug found on Chernarus Redux:

 

The same bug with all bridges is on original Chernarus!

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the report - I'll look into it!

  • Like 4

Share this post


Link to post
Share on other sites

Hallo :D

 

Is there a script ore a nother way to get random trains driving around tanora?

Share this post


Link to post
Share on other sites

@duda123, this really is an amazing mod.  But I'm not a train driving enthusiast myself.   I think your user base for this mod would triple or more if you add in script driven trains.  You already have "auto-pilot" where player can jump off moving train and train keeps moving.   It seems like that could be extended to be a script driven train.   If the current code base works completely by player input controlling train's speed and switching tracks (left, right), etc., maybe that can be exploited without disturbing your core code too much (if you wrap those player input calls into calls callable by a script).  Mission Designers could then script "simulated player input" to make same calls that player uses when pressing your defined train control keys.  Maybe a Game Logic could be created to be the AI controller of the train (in place of player).  Mission designer could put markers near junctions and sense when to issue call to turn train left/right, and markers for where to stop train, etc..  A Script API with calls to Start, Stop, Acellerate, Decelerate, Turn Left, Turn Right would be amazing.  With those building blocks, us mere mortal scripters could then create all kinds of scenarios...

  • Civilian trains with scheduled stops, where players and scripted AI units could board, disembark
  • Troop trains moving troops, supplies and vehicles
  • Train ambush and sabotage
  • Staging a raid by riding a train into a town or compound
  • Running battles between train riders and vehicles
  • Strafing trains from the air
  • Blowing up tracks and bridges and watch trains derail and fall
  • Etc.

A guy can dream anyway!  :)

 

Of course, this mod is beautiful as it is, so don't take this as a criticism in any way.  I took a peek at the code a few months ago and was super impressed and intimidated by it, and promptly closed the files....  :)

  • Like 9

Share this post


Link to post
Share on other sites
On 3/13/2018 at 1:32 PM, johnnyboy said:

@duda123, this really is an amazing mod.  But I'm not a train driving enthusiast myself.   I think your user base for this mod would triple or more if you add in script driven trains.  You already have "auto-pilot" where player can jump off moving train and train keeps moving.   It seems like that could be extended to be a script driven train.   If the current code base works completely by player input controlling train's speed and switching tracks (left, right), etc., maybe that can be exploited without disturbing your core code too much (if you wrap those player input calls into calls callable by a script).  Mission Designers could then script "simulated player input" to make same calls that player uses when pressing your defined train control keys.  Maybe a Game Logic could be created to be the AI controller of the train (in place of player).  Mission designer could put markers near junctions and sense when to issue call to turn train left/right, and markers for where to stop train, etc..  A Script API with calls to Start, Stop, Acellerate, Decelerate, Turn Left, Turn Right would be amazing.  With those building blocks, us mere mortal scripters could then create all kinds of scenarios...

  • Civilian trains with scheduled stops, where players and scripted AI units could board, disembark
  • Troop trains moving troops, supplies and vehicles
  • Train ambush and sabotage
  • Staging a raid by riding a train into a town or compound
  • Running battles between train riders and vehicles
  • Strafing trains from the air
  • Blowing up tracks and bridges and watch trains derail and fall
  • Etc.

A guy can dream anyway!  :)

 

Of course, this mod is beautiful as it is, so don't take this as a criticism in any way.  I took a peek at the code a few months ago and was super impressed and intimidated by it, and promptly closed the files....  :)

 

All great ideas! Have you tried out the dev build of ATS yet? It's headed in this direction :) Even has train derailments.

 

Creating trains and moving them is possible via script in the dev build. However, I'd imagine editor module-based config would be better for most users.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
21 minutes ago, duda123 said:

All great ideas! Have you tried out the dev build of ATS yet? It's headed in this direction :) Even has train derailments.

 

Creating trains and moving them is possible via script in the dev build. However, I'd imagine editor module-based config would be better for most users.

Great news Duda!  I read the first post and skimmed the last pages of the thread and saw no mention of scripted train control.  Anyway, I will wait until you are ready to publish these features, as I have too much on my plate with my JBOY Dog mini-campaign right now.   My dog wants to ride your trains!  I greatly look forward to your scripted trains.   :hyper:

 

BTW, your tumbleweed script is off the freakin' hook!!!

  • Like 2

Share this post


Link to post
Share on other sites

Sorry, published to the wrong steam workshop item. The steam item above is now updated.

Share this post


Link to post
Share on other sites

Using the dev version, here are some scripts you can use:

 

1. Create a train via script and give it some speed (place this in the init field of any train engine object placed on the map):

this call {
	_train = [_this] call ATRAIN_fnc_createTrain; 
	for "_i" from 0 to 5 do 
	{ 
		[_train, "ATS_Trains_AE_Wagon"] call ATRAIN_fnc_attachTrainCar; 
	}; 
	_train setVariable ["ATRAIN_Remote_Cruise_Control_Enabled", true, true]; 
	_train setVariable ["ATRAIN_Local_Velocity", 12]; 
	_train setVariable ["ATRAIN_Remote_Velocity", 12, true];
};

2. Derail the train (assumes the name of the editor-placed engine is TRAIN)

[[TRAIN] call ATRAIN_fnc_getTrain] call ATRAIN_fnc_derailTrain

3. Control who can get in the train:

[{some code that returns true or false. _this select 0 is the player},"You need a license to drive this train"] call ATRAIN_fnc_setTrainDriveCondition;
[{some code that returns true or false _this select 0 is the player},"You need a license to ride this train"] call ATRAIN_fnc_setTrainRideCondition;

 

 

  • Like 3

Share this post


Link to post
Share on other sites
On 6/1/2018 at 9:34 PM, duda123 said:

Using the dev version, here are some scripts you can use:

 

1. Create a train via script and give it some speed (place this in the init field of any train engine object placed on the map):


this call {
	_train = [_this] call ATRAIN_fnc_createTrain; 
	for "_i" from 0 to 5 do 
	{ 
		[_train, "ATS_Trains_AE_Wagon"] call ATRAIN_fnc_attachTrainCar; 
	}; 
	_train setVariable ["ATRAIN_Remote_Cruise_Control_Enabled", true, true]; 
	_train setVariable ["ATRAIN_Local_Velocity", 12]; 
	_train setVariable ["ATRAIN_Remote_Velocity", 12, true];
};

2. Derail the train (assumes the name of the editor-placed engine is TRAIN)


[[TRAIN] call ATRAIN_fnc_getTrain] call ATRAIN_fnc_derailTrain

3. Control who can get in the train:


[{some code that returns true or false. _this select 0 is the player},"You need a license to drive this train"] call ATRAIN_fnc_setTrainDriveCondition;
[{some code that returns true or false _this select 0 is the player},"You need a license to ride this train"] call ATRAIN_fnc_setTrainRideCondition;

 

 

Hey man, I love using this but I do have one question, I'm not sure what type of tracks Esseker uses but they look like the same tracks that are given in ATS... Every time I place a train however, it doesn't connect at all and/or most times it just explodes... Any fix for this? I'm trying dev mode now to test further...


Update: Does not work with dev build either, and actually the train just doesn't connect to the tracks this time... 

Share this post


Link to post
Share on other sites

Absolutely amazing mod. One of the best I've ever seen. When a train is on auto-cruise control is there any way for it to select a certain direction when the track diverges? Like make it always turn right or something.

Share this post


Link to post
Share on other sites
51 minutes ago, pognivet said:

Absolutely amazing mod. One of the best I've ever seen. When a train is on auto-cruise control is there any way for it to select a certain direction when the track diverges? Like make it always turn right or something.

Honestly I dont think so... Its considered a prop that just happens to move right now... 

Share this post


Link to post
Share on other sites
1 hour ago, socs said:

Honestly I dont think so... Its considered a prop that just happens to move right now... 

Is there a way to attach an object or a unit to a traincar such as the default A3 tanoa one?

Share this post


Link to post
Share on other sites

SO i downloaded the mod and can not get in any train or spawn anything in the editor i went through all the files could not find a single train. What do i do?

Share this post


Link to post
Share on other sites

@duda123, this mod is so awesome! Thank you sir! My boys are going nuts about driving trains! :'D

 

Such a great mod...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×