firestorm_56
17 years ago
hiya i need a little bit of help, im making a map with a train going through it but when it get to the bridge insted of going over the bridge it ends up going through and under it anyone have an idea why thats happening?

if its something to do with a script please be somewhat detailed i havnt used the scripting to much yet
Sponsor
Drummin
17 years ago
Add "Bridge" to the end of the waypoint name of the last waypoint before the bridge. This will keep the train at the same elevation. Here's an example:
Waypoint236Bridge

You would do the same type of naming for "Station" and "Tunnel" as well.

No scripting is needed.
firestorm_56
17 years ago

Add "Bridge" to the end of the waypoint name of the last waypoint before the bridge. This will keep the train at the same elevation. Here's an example:
Waypoint236Bridge

You would do the same type of naming for "Station" and "Tunnel" as well.

No scripting is needed.

Drummin wrote:



ah i would have never thought about that. thank you

Edited: ummm its still happening i got the name as Waypoint 35Bridge and its right before the bridge starts. do i need to type bridge at the first way point after the bridge to? (i got one right before and after the bridge)

lol my troops are on the bridge when the train comes and there not being run down either.


Edited: *Dances* yaaaay i got it working. i had to change the name from waypoint to bridge 1 tunnel. though thank you so much for the help
Drummin
17 years ago
My apology,
I thought Bridge would work. I know that Tunnel will hold altitude. Give that a try.

EDIT

i had to change the name from waypoint to bridge 1 tunnel.


I know I've read in posts that they always made a point of leaving the waypoint name intact and adding Tunnel or Station at the end of it. I guess because you have Tunnel though it's working for you. That's great.
firestorm_56
17 years ago
oh yeah with that working how it is does the train die if the bridge is destoryed?

ummm another random question wtf happened to my train its not coming up as a engin,flat,rocket cars. its coming up as an alpine ones
Drummin
17 years ago
This takes scripting.

Name your bridge, train and any cars.

There's several options but something like this.

*** IF ***
Unit 'Bridge1' has been destroyed.
*** THEN ***
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 might want the train to be removed when it's out of sight. Just label an area and have the train removed when it get to that location. Your script might look like this.

*** IF ***
Unit 'Bridge1' has been destroyed.
*AND* Unit 'Engine1' enters area 'HiddenZone'
*** THEN ***
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.


ummm another random question wtf happened to my train its not coming up as a engin,flat,rocket cars. its coming up as an alpine ones


IF you placed an engine, flat car w/rocket etc it should be just that. Did you make a map.ini file for the train?
firestorm_56
17 years ago

This takes scripting.

ummm another random question wtf happened to my train its not coming up as a engin,flat,rocket cars. its coming up as an alpine ones

Drummin wrote:


IF you placed an engine, flat car w/rocket etc it should be just that. Did you make a map.ini file for the train?



ummmm honestly i no idea about the map.ini file, i never have had this problem before with the train not coming up how i want it to
Drummin
17 years ago

i never have had this problem before with the train not coming up how i want it to

Try some different engines and see if the one you want shows up in the game.
firestorm_56
17 years ago

i never have had this problem before with the train not coming up how i want it to

Drummin wrote:

Try some different engines and see if the one you want shows up in the game.



i tried that already and its still coming up the same why, though i think i gota reinstall generals to i never had this much trouble with it when i had it installed last time

edited: ok another 2 questions does the train stay till it gets to the bridge or does it die where it is when the bridge is destoyed ?

if its at the bridge is there a script to have the train go up into a nuke explosion ?
Drummin
17 years ago
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.
firestorm_56
17 years ago

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.

Drummin wrote:



hehe thank you

im going to use that for a couple of different things (i dont want to spoil the surpize for those parts)
firestorm_56
17 years ago
ummm do i gota place a nuke bomb first ? i cant find it in the script part
Drummin
17 years ago
Generals or Zero Hour?

You should find Unit/Spawn/Spawn at waypoint.
firestorm_56
17 years ago

Generals or Zero Hour?

You should find Unit/Spawn/Spawn at waypoint.

Drummin wrote:



generals closest im finding is the radation field itself
Drummin
17 years ago
OK... took awhile to load "Generals" WB and game. Sorry for the delay. You're right:( Not in generals.

Try this instead.

*** THEN ***
Spawn Unit 'bombtruck' of type 'CargoTruckNuke' on Team 'teamPlyrCivilian' at waypoint Waypoint 'bomb'
Unit 'bombtruck' takes 100 points of damage.

So you'll spawn a named unit called bombtruck then the second script line deals some damage to make it explode.
firestorm_56
17 years ago

OK... took awhile to load "Generals" WB and game. Sorry for the delay. You're right:( Not in generals.

Try this instead.

*** THEN ***
Spawn Unit 'bombtruck' of type 'CargoTruckNuke' on Team 'teamPlyrCivilian' at waypoint Waypoint 'bomb'
Unit 'bombtruck' takes 100 points of damage.

So you'll spawn a named unit called bombtruck then the second script line deals some damage to make it explode.

Drummin wrote:



its fine im just starting the second script for that now

YAAAAAAAY it works thank you so much for the help
Drummin
17 years ago
No Prob.

Enjoy!