IPB

Welcome Guest ( Log In | Register )


 
Reply to this topicStart new topic
> How to create a fully working train transport (**), with working passenger wagons
Lin Kuei Ominae
post Sep 2 2010, 05:12 PM
Post #1


Stealth Tank
Group Icon

Group: Members
Posts: 1,065
Joined: 14-November 06
From: Germany
Member No.: 281
Alliance: CABAL
Favorite game: Tiberian Sun



During a short excursion of mine into mapping to see the capabilities of this kind of modding, i gave myself a try at scripting a working train using the already existing tutorial How to add a moving train to your map.

Knowing of the many problems other people had while doing intensive train research, i wanted to give it a try myself too and create a working train transport. And luckily i found a solution. dance.gif

How to create a working train transport:

1. Create a working train course with a train consisting of a locomotive (assigned to Group 0), 2 wagons (wagon1 as Group 11 and wagon2 as Group 12) and a cargowagon (Group 13). Then make sure the whole train is connected via the follow IDs. (see the tutorial in the first link)
Make sure the whole train is house Neutral.

excl.gif Neutral is necessary, so the train doesn't stops for any unit on the tracks (which it would do if it belongs to Special house) and simply ignores and crushes them. excl.gif

2. Give the train course 2 waypoints (in my example waypoints 10 and 11).
These will later be the train-stations at which the train unloads its passengers and allows others to enter it.

excl.gif It is important that all train-stations are either diagonal or vertical/horizontal. excl.gif
Due to the different distance between diagonal adjacent cells and vertical/horizontal adjacent cell, do the wagons get problems to stop exactly on the cell when the train reaches the next different oriented train-station, thus causing trouble with them allowing to enter/unload passengers.

3. Create one new Local Variable.
A variable with the name "Train Wagons Unload" with Preset value 0.

4. Create 3 new Taskforces.
One "Train task force" with one LOCOMOTIVE as the only unit
One "Wagon task force" with one TRAINCAR as the only unit
One "CargoWagon task force" with one CARGOCAR as the only unit

5. Create 2 new Scripts.

One "Wagon Unload script" that has the following Action:
0: Unload... 3 Lose Transports, Lose Units

One "Train script" that has the following Actions:
0: Move to waypoint... 10
1: Change House... 3 Special
2: Unload... 1 Keep Transports, Lose Units
3: Set Local... "Train Wagons Unload"
4: Guard Area (timer ticks)... 30
5: Change house... 2 Neutral
6: Move to waypoint... 11
7: Change House... 3 Special
8: Unload... 1 Keep Transports, Lose Units
9: Set Local... "Train Wagons Unload"
10: Guard Area (timer ticks)... 30
11: Change house... 2 Neutral
12: Jump to line #... 1

Explanation: At each train-station we change the house from Neutral to Special so units see the train as an allied unit and can enter the transport.
The local variable is used to trigger the unload of the wagons (see point 7).
The train guards the area for some time, to give the player time to let his infantry units enter the train transport.
The train house is changed back to Neutral, so it ignores units on the track and won't stop it's running script.

The house changing is done for the whole train automatically. Unfortunately is this not true for the Unload command, why we have to do the workaround with the local variable that triggers each wagon to be assigned to an individual team with its own unload script.

6. Create 4 new Teamtypes.
One "Train teamtype", House Neutral and with the "Train task force" assigned. Give this one Group 0 and as Script the "Train script".
One "Wagon1 teamtype", House Special and with the "Wagon task force" assigned. Give this one Group 11 and as Script the "Wagon Unload script".
Another "Wagon2 teamtype", House Special and with the "Wagon task force" assigned. Give this one Group 12 and as Script the "Wagon Unload script".
One "CargoWagon teamtype", House Special and with the "CargoWagon task force" assigned. Give this one Group 13 and as Script the "Wagon Unload script".

Make sure that all of these have Loadable checked and no other ability.

7. Create 2 new Triggers.
A "Train" Trigger Type 0 for house Neutral with the Event "AnyEvent" and the one Action 0 "Create Team" with the "Train teamtype" assigned.

This Trigger is run only once in the beginning and starts the train following its script.


A "Train Wagons Unload" Trigger Type 2 (repeating) for house Special with the Event "36 Local is set..." and the variable "Train Wagons Unload". Give this one 4 Actions:
Action 0: "57 Local Clear..." as variable "Train Wagons Unload"
Action 1: "4 Create Team..." with the teamtype "Wagon1 teamtype"
Action 2: "4 Create Team..." with the teamtype "Wagon2 teamtype"
Action 3: "4 Create Team..." with the teamtype "CargoWagon teamtype"

This Trigger creates at each train-station for each wagon a team with the Unload command. Since the train would be disconnected if wagons and locomotive would be in different teams, the Unload command is using the 4th option "Lose Transports, Lose Units" as this way the wagons are also freed from their individual team again.
I've tried to use only one team with 2 wagons and the cargowagon too, but unfortunately is this not reliable and very often the wagons team wasn't created. However if their team was created, only one of the 3 wagons unloaded the passengers.

8. Test the train ingame.


If you've done everything right, the train should now be able to load and unload your troops in a multiplayer map.
If following these steps takes too long for you, you can take a look at my attached example map, that has the working train included.
Train testmap:Attached File  LKOtrainTestmap.zip ( 24.61K ) Number of downloads: 278


This post has been edited by Lin Kuei Ominae: Sep 3 2010, 11:01 AM


--------------------
Co-Leader of Twisted Insurrection
my public units for you
Nod units:____________________________GDI units:
Nod Scorpion__________________________GDI 3A Kodiak
Nod Tachyon Tank______________________GDI Medusa (Triple Cannon Mech)
Nod Goliath___________________________GDI Behemoth (medium size Mech)
Nod Cobra (fast medium mech)__________GDI Battleship Aurora
Nod Siegebot (light MG-Mech)__________GDI Fortress Tower (Heavy Base Defense)
Nod Redeemer (4 legged heavy Cyborg)__GDI Triton (Titan support Mech)
Nod/Scrin WotW Tripod_________________GDI Exciter
______________________________________GDI Ion Charge Collector
Misc and Fun units:
X-Mech Calendar 28 SHP Units
Star Wars Mechs ATAT/ATST
Cyborg Barrack on PPM_________________Mech Factory
Mutant Tiberium Flyer
yt1300 (Millenium Falcon + BIG version)

if you use my units in your mod, please credit me.if you want to use my units on your website please ask me before.
Go to the top of the page
 
: | +Quote Post
Rampastring
post Sep 3 2010, 01:39 PM
Post #2


Tick Tank
Group Icon

Group: Members
Posts: 690
Joined: 4-June 07
From: Finland
Member No.: 957
Alliance: Nod
Favorite game: Tiberian Sun



Nice. Seems to be a lot of steps for a single train though, but you don't usually place many of them on a map.


--------------------
Go to the top of the page
 
: | +Quote Post
Aro
post Sep 3 2010, 05:18 PM
Post #3


Cyborg Commando
Group Icon

Group: Members
Posts: 1,695
Joined: 22-November 06
From: Birmingham, UK
Member No.: 314
Alliance: Nod
Favorite game: Tiberian Sun



You sir, are a genius.


--------------------
Aro - Leader of Twisted Insurrection and Evolution.

Tiberian Sun: UMP
Tiberian Sun: Modding Tools
Tiberian Sun: Mapping Tools

"Aro is OP." - TiberianFuture
"Aro for Dictator!" - Droke
"Aro for President!" - CL4ymOr3
"You're Aro, you always win." - daTS
"He's referred to as The Aro because he really is that f*cking awesome!" - Fenring
"Only members of the A.R.O. Society are allowed to use :WAT and related terms (TAW:, :BIGV, etc.)." - Crimsonum
"To Aro, founder and leader of TI, the best public relations and mod manager, great friend, modder and mapper." - Lin Kuei Ominae
Go to the top of the page
 
: | +Quote Post
Lin Kuei Ominae
post Sep 3 2010, 07:32 PM
Post #4


Stealth Tank
Group Icon

Group: Members
Posts: 1,065
Joined: 14-November 06
From: Germany
Member No.: 281
Alliance: CABAL
Favorite game: Tiberian Sun



Thanks. smile.gif
QUOTE (^Rampastein @ Sep 3 2010, 01:39 PM) *
Seems to be a lot of steps for a single train though, but you don't usually place many of them on a map.

Most of these steps you have to do anyway when creating a moving train.
Only the second Trigger using the local variable and the special wagon teams are new to previous solutions.


Though i think the additional work is it worth, as the complete train offers a big strategic change, since you can transport well protected a whole infantry army over a long distance (also partially hidden from the enemies view).

@Aro: i hope to see some time in future a TI map that extensively takes usage of this technique. I see some kind of big 200x200 8 player map with each player location being connected by 2 ring trains, driving along the map-border clock- and counterclockwise to each player location, with additional straight diagonal train lines connecting the opposite players over a big train-station in a city in the centre of the map.
Also additional civil bus lines and orca transports would be cool.

This post has been edited by Lin Kuei Ominae: Sep 3 2010, 07:47 PM


--------------------
Co-Leader of Twisted Insurrection
my public units for you
Nod units:____________________________GDI units:
Nod Scorpion__________________________GDI 3A Kodiak
Nod Tachyon Tank______________________GDI Medusa (Triple Cannon Mech)
Nod Goliath___________________________GDI Behemoth (medium size Mech)
Nod Cobra (fast medium mech)__________GDI Battleship Aurora
Nod Siegebot (light MG-Mech)__________GDI Fortress Tower (Heavy Base Defense)
Nod Redeemer (4 legged heavy Cyborg)__GDI Triton (Titan support Mech)
Nod/Scrin WotW Tripod_________________GDI Exciter
______________________________________GDI Ion Charge Collector
Misc and Fun units:
X-Mech Calendar 28 SHP Units
Star Wars Mechs ATAT/ATST
Cyborg Barrack on PPM_________________Mech Factory
Mutant Tiberium Flyer
yt1300 (Millenium Falcon + BIG version)

if you use my units in your mod, please credit me.if you want to use my units on your website please ask me before.
Go to the top of the page
 
: | +Quote Post
Crimsonum
post Sep 4 2010, 06:15 PM
Post #5


Tick Tank
Group Icon

Group: Members
Posts: 672
Joined: 21-October 06
From: Finland
Member No.: 32
Alliance: Nod
Favorite game: Tiberian Sun



This adds a whole new section of strategy to TS, great job!
Go to the top of the page
 
: | +Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 28th March 2024 - 07:59 PM


XGhozt.com