Posted: Thu Sep 12, 2019 7:54 am Post subject:
Help with Trains
So, I was testing out the "hack" to make train bridges from the Terrain Expansion work (all you have to do is simply change the Image= of either BRIDGE1 and BRIDGE2 or BRIDGEB1 and BRIDGEB2 to RAILBRDG with the TX installed) and script a train to move through it.
Now, here's my issue: the train itself is not working correctly, and for some reason is not MindControllable!.
The train engine spawns and moves over the bridge like in TS, no problems there.
My problem is that the nothing but the Locomotive shows up on the map, and that locomotive gets crushed by a freshly spawned locomotive instead of being recruited.
So pretty much a Trigger/Team/Script issue. I think.
A little help please?
_________________ One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done.
If you want a train with multiple sections then it has to be pre-placed on the map & linked together, spawning it with triggers wont work.
Also multi section trains cant be used by the player, only individual ones work as they will lose their connection with each other once the player has control.
If you want to the player to be able to use trains then I'd suggest making a "train factory" instead.
If you want a train with multiple sections then it has to be pre-placed on the map & linked together, spawning it with triggers wont work.
I know that. My question is how to set up the triggers and teams and scripts and taskforces appropriately so things won't blow up and the front of the train moves.
See the attached map and look at its triggers and what-not.
Mig Eater wrote:
Also multi section trains cant be used by the player, only individual ones work as they will lose their connection with each other once the player has control.
That's interesting...
Doesn't explain what the issue with the YURIPR is to prevent him from mind controlling the locomotive even after ImmuneToPsionics=no tho.
Mig Eater wrote:
If you want to the player to be able to use trains then I'd suggest making a "train factory" instead.
Instructions unclear, built War Factory instead QUICK_EDIT
Made the changes to the map:
- Loop uses line number, not index.
- Use create team. Re-inforcement team doesn't recruit.
- Train parts should use follow ID correctly.
Also for this to work, change WoodBridgeSet = 152 ;101 in urbanmd.ini. Can use only two high bridges.
Can't say why it explodes before reaching the destination waypoint. May be terrain problem.
LOCOMOTIVE has FOLLOWS_INDEX 1, TRAINCAR 2 & 3, CARGOCAR -1?
Shouldn't it be the other way around? LOCOMOTIVE -1, TRAINCAR 1 & 2, CARGOCAR 3?
Either way, doesn't FOLLOWS_INDEX take the 0-based ID?
The order of the train cars is:
1: LOCOMOTIVE,256,32,57
2: TRAINCAR,256,32,56
3: TRAINCAR,256,32,55
4: CARGOCAR,256,32,54
The new Follows_ID values make no sense...
E1 Elite wrote:
For this to work, change WoodBridgeSet = 152 ;101 in urbanmd.ini. Can use only two high bridges.
It works even if I haven't... All I did was change the graphics used by the game and FA2.
What's the effect of changing it?
EDIT: both trains and units pass over normally only with this, else they get stuck somewhere on the bridge.
Next question: what about the other terrain INIs? What's their set number or when can I get it from? QUICK_EDIT
It is more of a follower ID, which takes the index of the next following unit from the list. FA2 wording follows ID gives opposite meaning.
TX terrain INIs have the IDs in front of TrainBridgeSet which wont work, get those and put it in WoodBridgeSet, if you are replacing the high wooden bridge. QUICK_EDIT
TX terrain INIs have the IDs in front of TrainBridgeSet which wont work, get those and put it in WoodBridgeSet, if you are replacing the high wooden bridge.
Would overriding the wooden bridge SHPs with the train bridge SHPs do the trick? By actually renaming the files instead of relying on Image=.
https://ppmforums.com/viewtopic.php?p=571949#571949 QUICK_EDIT
I copy pasted your code for the rules. Art already had the entries. It works in both FA2 and Game.
If you are replacing wooden bridge graphics with train bridge ends tiles, like Mig Eater mentioned in that thread, then it will work without replacing the tileset numbers in terrain INIs. QUICK_EDIT
If you are replacing wooden bridge graphics with train bridge ends tiles, like Mig Eater mentioned in that thread, then it will work without replacing the tileset numbers in terrain INIs.
Nope, it won't. At least not for urban. I just tested.
The train and other player controlled units get stuck somewhere before the bridge ends.
Player units also will refuse to use the bridge at all unless you more or less force them to after several retries.
I'll go and remake the bridge, see if the problem lies in an unfinished bridge, but I doubt it.
EDIT: Exception handler fired when forcing player units over!
Exception C0000005 at 00583232 should you opt for simply renaming the railbrdg.urb to bridgeb.urb. QUICK_EDIT
OK, here's what I got: replacing the wooden bridge with the train bridge with the methods described above works...
Except for newurban. There only player-controlled units can move over, but not scripted trains.
Also, the TX theatre INIs are a real mess... why did they opt for creating entirely new tilesets instead of reusing the existing ones that had simply been coded by WW to not included anything? Would have saved a precious few KBs
Attached is the test map in newurban and the urbannmd.ini I'm using.
After 5 frames/seconds have passed, the train moves close to the start of the bridge on the bottom/southern cliff edge. If it stays there then the bridge doesn't work.
The train will go in a nice loop if it does work.
_________________ One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done.
Also, the TX theatre INIs are a real mess... why did they opt for creating entirely new tilesets instead of reusing the existing ones that had simply been coded by WW to not included anything? Would have saved a precious few KBs
Because when you change TileSets, you break all existing maps that use this or any following TileSet.
That's why mods add new TileSets and don't touch the original ones.
That's why mods mostly set TilesInSet = 99 for their new sets, because changing that later breaks maps as well and modders want to keep room for future additions. _________________ SHP Artist of Twisted Insurrection: Nod buildings
The new urban train bridge tiles in TX don't have the correct terrain type set for the track cells like in tovrps06.ubn or tovrps06a.ubn, the track cells have been set with terrain type number 11 instead of 6. You can correct those by using XCC TMP Editor 1.05. Check with say tovrps06.tem and set the same for tovrps06.ubn. I didn't check all the remaining tiles. QUICK_EDIT
Does anyone have a link for the meanings of all the Terrain Type numbers?
Google and rules(md) are not helping me here. I've also tried Bing, but nothing.
All I know now is that 6 stands for rails, 15 is impassable and unbuildable, 11 is passable and can be built on. _________________ One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done.
What did I do (or didn't do) this time..? _________________ One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done.
As the train with the carriages moves, the carriages behind it go boom as they're crushed one by one.
I've already tracked the problem down to the Speed and Acceleration settings.
My current problem is what values they should be, since the carriages still go boom even after all the speed settings are the same...
In my case the values are straight from the TS LOCOMOTIVE:
Code:
Speed=8
MovementZone=Crusher
SlowdownDistance=700
DeaccelerationFactor=0.001
AccelerationFactor=0.01
Locomotor={4A582741-9839-11d1-B709-00A024DDAFD1}
;;tho I'm sure ^this^ is the only one that trains will work with anyway
With SpeedType not defined/explicitly stated, I guess this means the default Track is used since we have a Crusher=yes VehicleType.
I haven't tested to see how the trains would behave if none of them accelerate/deaccelerate with custom factors and instead use the default ones, so maybe that'll work.
My idea is to make it so that sharp turns can still be made...
I wonder if setting the carriages' speed to 7 or 6 while the locomotive stays at 8 would fix it and/or cause the carriages to decouple when going a straight line for a while. QUICK_EDIT
I'm hoping the lack of response to this topic is because of everyone loving trains so much, they want it to be perfect, and they still haven't managed it yet
Now, here's what I have. I'm not sure if it's completely perfect, but for the test map with the slightly sharper than usual turns, here's what you can do:
A) add a waypoint just before a sharp turn and make sure the waypoint is included in the train's script. (theoretically)
That way, you prevent the locomotive from stopping and turning, with the carriages right behind it still moving, and thus the locomotive and carriage occupying the same cell and the carriage outrunning the locomotive, thus triggering the train and making it crush the carriage that was supposed to be right behind it.
Well, in theory, anyway.
B) mess with the acceleration and train ROT.
Spoiler (click here to read it):
Code:
[LOCOMOTIVE]
ROT=20 ;;5
;;^^this has to be high enough to avoid the locomotive wasting too much time at sharp turns and making it possible for the cars to catch up to the engine, and thus causing some booms no-one wants, for once...
SlowdownDistance=1 ;;700
;;not sure if ^^this can remain 700. Might be more realistic, but might break the train sooner rather than later...
DeaccelerationFactor=0.001
AccelerationFactor=0.9999 ;;0.01
I wonder if setting the carriages' speed to 7 or 6 while the locomotive stays at 8 would fix it and/or cause the carriages to decouple when going a straight line for a while.
The train does "decouple". But in RA2/YR/Ares this just means that the distance between locomotive and carriages grows bigger, until eventually the locomotive catches up to its cars and blows them up.
Details:
Spoiler (click here to read it):
As the train is faster than the cars, the distance between the cars (assuming they all have the same speed so they don't presumably crush each other) and the locomotive simply grows.
The cars will still "follow" the engine, but at distance.
This means that if your script has the locomotive heading for a waypoint and stopping there, the cars will "follow", until the engine reaches the waypoint in its script and wait.
As soon as it reaches the waypoint and starts waiting, so do the cars:
The just stop the instant their engine does, and don't move until their locomotive moves, regardless of where they are.
I'm guessing this means that the "follow" logic as WW implemented it (or maybe Ares had a hand or two in it), is for the "followers" to just do what their "leader" is doing, as opposed to "don't stray more than one cell away from him".
To be fair, the former would've been easier to implement...
But I'm sure the veterans here already knew or had an inkling...
I've always just used the same speed, ROT & acceleration settings on both the locomotives & carriages, never had or heard of anyone else having any problems with them crushing each other :/ _________________
The turns have to be so sharp, the locomotive actually has to stop and turn for a few frames. If done a few times in succession, the cars will eventually catch up to and outrun the locomotive.
What values were/are you using? _________________ One and only developer of the Command & Conquer Dune "C&C D" mod.
m7 wrote:
I tend to release things I create so that assets are never lost to hard drive problems, accidental deletion, or me having to pretend to care about rippers taking things from my project when it is done.
Ah so the problem is that you're not laying out the tack correctly, there should always be a vertical/horizontal section in the middle of every corner. Trains can only do a 1/8 turn per cell so if you dont have the extra track section they get stuck & as you have discovered collide & blow up. Fiddling with the speed or acceleration setting wont fix it, what you need to fix is the tracks. _________________
multi section trains cant be used by the player, only individual ones work as they will lose their connection with each other once the player has control.
This quote is not quite a lie but not a truth either. Trains are a bit more broken than that.
Also, my earlier observation regarding train wagons "decoupling" seems to be wrong. See for yourself.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum