The train will die based on the conditions your set in your script. If you say "When Bridge is destroyed", then that's when it will happen. Getting the train to crash will be hard to do as it is following the waypoint path and not actually on the bridge. Making an explosion though would be easy. Just add an area at your bridge and a waypoint to spawn your bomb. Then make a script like this.
*** IF ***
Unit 'Bridge1' has been destroyed.
*AND* Unit 'Engine1' enters area 'BridgeArea'
*** THEN ***
Spawn unit of type 'NukeBomb' on Team 'teamPlyrCivilian' at waypoint Waypoint 'Bomb1'
Unit 'Engine1' is removed from the world.
Unit 'Traincar1' is removed from the world.
Unit 'Traincar2' is removed from the world.
Unit 'Traincar3' is removed from the world.
You'll find the bomb under civilian/system.
EDIT: Idea...
One way you might do this is to have the train removed when it gets to the hidden area as I explained earlier. Then have a new train start moving on a DIFFERENT pathway which merges to follow the same path when it comes back into view. Keep these paths separate by never letting your waypoints join when you're laying them out. Have this second track end below the bridge and don't name the "Tunnel" waypoint as you did on the main track line so the second train will fall. Make the "BridgeArea" small enough so that the train needs to fall first before the explosion.
Then use a script like the one above to spawn your bomb.
*** IF ***
Unit 'Engine2' enters area 'BridgeArea'
*** THEN ***
Spawn unit of type 'NukeBomb' on Team 'teamPlyrCivilian' at waypoint Waypoint 'Bomb1'
You might see if "The Bomb" will destroy the second train.
Edited by user
17 years ago |
Reason: Not specified