ChooChoo Trains Script

So first up the train is installed but I think I messed up somewhere because this happens:

trainwipeout.jpg


I also had the code in the sqm file for the sound but I got an error relating too

Code:
_cur_mp.chernarus
on line 148 which was referencing the #include

I am still all new to this but some advice on what I may of done wrong. Thank you
 
Been playing with this script:

The key difference with this is that the script I am working on finds the track from the server and decides the next one to use. Damn setVelocity command has driven me to pulling my hair out though, can find and choose the next bit of track, getting the train onto it though is another thing entirely, BIS better have a special padded room prepared for me by the time i finish this..

The video shows the train at about Prigorodky, have had the train going past Elkrozavodsk and beyond. You can see how slow and jerky it is, I think I may have an idea as to the cause..

Benefits from having the train choose it's own track is then having the ability to make decisions at the points, so the train could be diverted (a long way off yet tho), no reason why a player couldn't be attached to the train and have some control over it.

I have made the train server side and the sounds client side, a big light on the front is next, obviously :) credits to Hangender and Zonekiller for their previous work on this..


Anymore progress on that yet? Did you ever get the jerky problem fixed?
 
Have spent weeks on this. Have been trying to get the track detection working, probably should have gone with a map, been stitched up by 'fnc bis relative dir to' as it doesn't return a value between 0 and 360.

Also some of the tracks are randomly placed in the opposite direction, just to make things more interesting. Don't mention points to me. Gave up for a bit to save my sanity.
 
Can anyone help me guys , Trains work fine but when I add the

class CfgSounds
{
sounds[] = {};
class NoSound
{
name = "NoSound";
sound[] = {"", 0, 1};
titles[] = {};
};
#include "Scripts\Train\sounds.hpp"
};
my server wont run and when I take it out I get no engine sounds, Pretty new to this where am I going wrong as I think they are awesome. Just need sounds now :)
 
Potentially yes. The main issue I had, and gave given up with this script for a while, was trying to map the train tracks in real time on the server.

Am going to throw the towel in, which I should have a long time ago, and create a worldspace point map of all of the tracks and reference those. I can mark out points so if, by driving, you mean turning at points and beeping the horn, stopping and starting then yes is doable :)
 
sorry, my fault. What i mean was that i dont wanna drive the train, i only wanna be a "guest". i tried and get on the last, but the train drive und my feet away, so i fall down from it.
 
Hey, the Train works fine - great work, thx !
I just wonder why i get @ Epoch 1.0.2.3 get:
12:52:58 "CLEANUP: KILLING A HACKER Username B 1-1-C:1 (Username) REMOTE IN KORD_high"

but still can use the Gun on the Train @ Epoch 1.0.1.5

any ideas?
 
awesome, glad it's working for someone ;) have had immense hassle with this script.. Though have been trying to get it to do things is just not designed for :) one day I will nail it..

Is in servercleanup.fsm where that killing a hacker is..
 
yeah axeman i realised this in servercleanup.fsm and will now try this one:

Code:
    /*%FSM<STATE "vehicle_cleanup">*/
    class vehicle_cleanup
    {
      name = "vehicle_cleanup";
      init = /*%FSM<STATEINIT""">*/"_safety = dayz_serverObjectMonitor;" \n
      "" \n
      "//Check for hackers" \n
      "// {" \n
      "//  if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"" && (vehicle _x getVariable [""Sarge"",0] != 1)) then {" \n
      "//    diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
      "//        (vehicle _x) setDamage 1;" \n
      "//        _x setDamage 1;" \n
      "//    };" \n
      "// } forEach allUnits;" \n
      "" \n
      "dayz_serverObjectMonitor = _safety;"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links

EDIT:
not tryed yet, just wondering why it working on epoch 1015 without the comments - but now try if it work and give a response
 
So first up the train is installed but I think I messed up somewhere because this happens:

trainwipeout.jpg


I also had the code in the sqm file for the sound but I got an error relating too

Code:
_cur_mp.chernarus
on line 148 which was referencing the #include

I am still all new to this but some advice on what I may of done wrong. Thank you

I don't think you have done anything wrong. is the train adjusting to the next bit of track. There is a bit in the code that times each update, it doesn't compensate for server lag. This is something i am working on for another project. Also I wouldn't attach the carriages to the main train.

Will definitely be picking this script up again soon..
 
finally i realised that @ epoch 1.0.2.3 the Train Gun is usable as long as the train stands on his stop - if he starts, the gun will despawn and you will fall of the wagon.
My solution:
-disable gun on train and ride on the ladders with it ;)
also i renable (entcomment) the Hackercheck - hope u understand what i mean xD
 
Back
Top