Trains and wagons to Chernarus rails

allavett

New Member
This is an addition to Arma 2 Chernarus map

To see what it contains check out this Youtube video (video is older then the picture):

To apply "trains and wagons" to your missioon after downloading.
1. You have to place the whole folder that You downloaded (trains_and_wagons) to Your arma missions folder.
2. Start Arma 2 Editor.
3. Open up the mission You want to add these fabulous trains.
3. Select merge.
4. In merge window select trains_and_wagons.
4.1 If you can not see trains_and_wagons in merge window You must have placed it in the wrong missions folder.
5. Klick OK and Enjoy!

The reason I did not add .sqf file was because .sqf did not like setVectorDirandUp command. So all the wagons that were rolled were standing like nothing had happened. Cool story, I know..


Update: After some serious testing by Mr.Weegley, I am proud to present Trains and Wagons SQF version.
You can get it from here: https://docs.google.com/file/d/0B40-a1SVTfqMaGRJM2dXUGk0SU0

When using it you have two options to make it work without people getting kicked.
  1. Make changes to filters - otherwise a lot of people (everyone) will be kicked.
  2. Comment out first object (_logic) in SQF - this will result in some objects not being destroyed. Therefore the trains and wagons on the crashsite will be sticking through fences. But filters don't have to be edited.
There may be another option that might work. But I am not sure at the moment if it even works and sadly don't have enough time to test it. In a nutshell it involves changing mission.sqm.
 
Last edited:
I've added a lot of stuff to my server, so I'm pretty knowledgeable, but you kinda lost me when you said to open the mission I want to add these trains to, and to merge them. I'm not sure I understand what you are talking about?
 
At the moment I do not have much time to go in details or to describe it any better. But..
You have to start Arma 2 DayZmod select multyplayer->new->lan->Chernarus:New Editor ->Play ->Load->dayz_1->OK->Merge->trains_and_wagons->OK->Save->give a unique name and save.
This will create only mission.sqm file. You have to replace the old one in dayz_1 with the new one. And you should be ready to roll ;)
If I get the time and there is need for it, I might do a quick videoTut. But at the moment I hope that helps you out ;)
 
Well, based on that, couldn't I just add the "class Vehicles" section of the mission.sqm in your download to the mission.sqm of my server, ensuring the numbers are changed to be in sync with my missions.sqm?
 
Hmm.. I suppose. But I have not tried this way. But from the sound of it merging seems less tidious.
Ah, and one more thing.
..OK->Save->give a unique name and save.
This will create only mission.sqm file. You have to replace the old one in dayz_1 with the new one..
You do not have to save it with a new name. Saving as dayz_1 (or whatever the missioon folder name is) will just replace the missioon.sqm in there.
 
The easier way would be to just post the sqf file instead of the sqm so we can just call it from our init.sqf...
 
As I mentioned in the first post:
The reason I did not add .sqf file was because .sqf did not like setVectorDirandUp command. So all the wagons that were rolled were standing like nothing had happened. Cool story, I know..
Ofcourse I did it with a converter and not by hand. I don't know if there are any other solutions. If there is, let me know and if it isn't too much work, I will make it into sqf ;)
 
Kinda strange - i've added this via server.pbo, but lots of players get setpos restriction kick when they login. next try and later everything is ok.
 
Kinda strange - i've added this via server.pbo, but lots of players get setpos restriction kick when they login. next try and later everything is ok.
Hmm.. strange. Have not tested or updated this "addon" for a while now. Most likely it is something to do with BE filters. Just trace it from the log and add it to filters so it doesn't kick players.
This ^^^^^^^^
Just give us the SQF please.
I will look into it. Maybe I am able to work it out how to convert it to .sqf. As I mentioned in the first post. SQF did not seem to like setVectorDirandUp command. Did not google too much at the time of the OP. Maybe there is an easy solution?
 
Hmm.. strange. Have not tested or updated this "addon" for a while now. Most likely it is something to do with BE filters. Just trace it from the log and add it to filters so it doesn't kick players.

I will look into it. Maybe I am able to work it out how to convert it to .sqf. As I mentioned in the first post. SQF did not seem to like setVectorDirandUp command. Did not google too much at the time of the OP. Maybe there is an easy solution?

1st: the strange thing is that Client tries to setpos them:confused: But they are spawned serverside.
2nd: If you don't mind, i will post it cinverted to sqf: trains_wagons.sqf (will add link on your permission) - all works perfectly(actually, i did not check setvectordirandup result). Except of battleye kicks, but i don't have time now to debug it.
UPD: Kick line:
Code:
19.05.2014 18:02:46: kick-ass (x.x.x.x:10946) xxxxxxxxxxxxxxxxxxxxx - #0 2:2164 Land_wagon_box [10320,2097,7]

Think that root of the problem is in setvehicleinit..
 
Last edited:
1st: the strange thing is that Client tries to setpos them:confused: But they are spawned serverside.
Strange indeed. If you are using sqf, maybe it runs on client also? I have seen ArmA doing some weird shit on client side if you don't force the code to run only on server..
2nd: If you don't mind, i will post it cinverted to sqf: trains_wagons.sqf (will add link on your permission) - all works perfectly(actually, i did not check setvectordirandup result). Except of battleye kicks, but i don't have time now to debug it.
If setvectordirandup works as should, I would really appreciate your contribution :)
UPD: Kick line:
Code:
19.05.2014 18:02:46: kick-ass (x.x.x.x:10946) xxxxxxxxxxxxxxxxxxxxx - #0 2:2164 Land_wagon_box [10320,2097,7]
The same line for all, it kicks everybody during first ~3mins. I think it's a time that it takes to finish spawning everything (Database objects and map additions). After that - no kicks.
Log seems to point at a single object. [10320,2097,7] are coordinates maybe? Could be something wrong with that certain wagon?
Sadly tonight I dont have any time to investigate. I'm able to look through the code tomorrow, but no testing ingame until the end of the week. I hope the solution comes (you are able to find it) sooner :D

Update:
Did a really simple check with just notepad:
strange_zps636d2781.png

It seems as though the kick indeed is caused by this single object. Maybe you can try removing it from the script and see if the kick notification persists or changes?
Ofcourse there is a possibility that my high-end debugging technique might be wrong :D
Also!!
I don't believe that spawning all these wagons takes 3 minutes. They all should spawn as soon as 1st player loads the world.

!!
Just noticed your new update:
Think that root of the problem is in setvehicleinit.."
Could you maybe elaborate?
 
Last edited:
Strange indeed. If you are using sqf, maybe it runs on client also? I have seen ArmA doing some weird shit on client side if you don't force the code to run only on server..

If setvectordirandup works as should, I would really appreciate your contribution :)

Log seems to point at a single object. [10320,2097,7] are coordinates maybe? Could be something wrong with that certain wagon?
Sadly tonight I dont have any time to investigate. I'm able to look through the code tomorrow, but no testing ingame until the end of the week. I hope the solution comes (you are able to find it) sooner :D

Update:
Did a really simple check with just notepad:
strange_zps636d2781.png

It seems as though the kick indeed is caused by this single object. Maybe you can try removing it from the script and see if the kick notification persists or changes?
Ofcourse there is a possibility that my high-end debugging technique might be wrong :D
Also!!
I don't believe that spawning all these wagons takes 3 minutes. They all should spawn as soon as 1st player loads the world.

!!
Just noticed your new update:

Could you maybe elaborate?

I'm testing just now. About setvehinit- HERE it's stated that:
Multiplayer:
The statement will be sent to clients connecting after the command has been executed. Note that the statement will be executed automatically by JIP clients before Init.sqs or its SQF counterpart has been executed.

UPD 1:
  • setvectordirandup seems to work good. Will test several more objects.
  • I've amended your vehinits to look like:
    Code:
    _this setVehicleInit "if (isserver) then {this setpos [(getpos this select 0), (getpos this select 1), (getpos this select 2)+ 0.15];};";
    First run gave no kicks. will continue testing.
UPD 2: Still no kicks, and all seems to be on place. Think the problem is solved.
UPD 3: 1 day running. No kicks.
UPD 4:
I don't believe that spawning all these wagons takes 3 minutes. They all should spawn as soon as 1st player loads the world.
I have Pentium D 945 (Presler) And not the fastest HDD there :)
 
Last edited:
Good to hear!
I have done some testing myself and indeed everything should work without problems. But I noticed one issue with wagon_box positioning. All of them seem to be placed a bit higher and not exactly on rails.
Have you noticed something like this?
 
They are missaligned from little to neglible values. But it's only visible from below them.
arma2oa 2014-05-24 13-25-58-33.png
arma2oa 2014-05-24 13-26-04-33.png
arma2oa 2014-05-24 13-27-29-16.png
As you can see their missalignment is visible when you are under them only. Also it's too small offset to worry about.

UPD 1:
Also checked about SetVectorDirAndUp
This loco:
Code:
_vehicle_201 = objNull;
if (true) then
{
  _this = createVehicle ["Land_loco_742_blue", [7102.12,3174.18,0], [], 0, "CAN_COLLIDE"];
  _vehicle_201 = _this;
  _this setDir 110.911;
  _this setVehicleInit "if (isserver) then {this setpos [(getpos this select 0), (getpos this select 1), (getpos this select 2)- 1.3 ]; this setvectordirandup [[-1,-1,0],[-5,0,-1]];};";
  _this setPos [7102.12,3174.18,0];
};

Looks:
arma2oa 2014-05-24 13-41-51-05.png
arma2oa 2014-05-24 13-42-08-73.png
 
Last edited:
This looks really good!
I assume you used better converter than I did. Or did you do it by hand? That would be crazy..
Could you maybe upload it somewhere? Then I could change OP and add the link there and give you the credit for making it?
 
After some serious testing by Mr.Weegley, I am proud to present Trains and Wagons SQF version.
You can get it from here: https://docs.google.com/file/d/0B40-a1SVTfqMaGRJM2dXUGk0SU0

When using it you have two options to make it work without people getting kicked.
  1. Make changes to filters - otherwise a lot of people (everyone) will be kicked.
  2. Comment out first object (_logic) in SQF - this will result in some objects not being destroyed. Therefore the trains and wagons on the crashsite will be sticking through fences. But filters don't have to be edited.
There may be another option that might work. But I am not sure at the moment if it even works and sadly don't have enough time to test it. In a nutshell it involves changing mission.sqm.
 
Can you please explain the filters ?
Whats needs to be removed / added ?
Neversober, Sunday at 8:39 AM

If it is kicking people for battleye restrictions find out which type of kick (eg publicvariable, setpos, script, etc)
Find the Logs for that type of filter in your Battleye folder. Once you found the right log with the kick in it you can create an exception for it. Example if it said kicked for <setDamage> or <charID = nil> (I just made those up) you could make and exception like this !="setDamage" or !="charID = nil". If you are lucky, once you have got this far and decide to open up your filters and add the new exception, it will be obvious where to add it.

(HINT: If it kicks you for publicvariable #0 then most likely you need to add the exception to the first line under //new. if it said #1 it would most likely be the next line underneath and so on else you may recognize your exception looks a lot like the first word on a line and decide to add an exception beside it. Putting, an exception in the wrong place shouldnt hurt too much in most cases, try adding it to every line if you are having a hard time)

If not, it might take a little more research or some trial and error but thats making an exception for battleye filter in a nutshell.

Maybe it helps someone
 
Back
Top