| Author |
Topic: Trains in map |
|
|
|
| Slayer2746 |
General Member Since: Oct 13, 2006 Posts: 70 Last: Oct 28, 2009 [view latest posts] |
|
|
|
|
| Slayer2746 |
General Member Since: Oct 13, 2006 Posts: 70 Last: Oct 28, 2009 [view latest posts] |
|
|
|
|
| Birdyman |
General Member Since: Nov 14, 2005 Posts: 55 Last: Nov 23, 2011 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Friday, Jan. 11, 2008 01:01 pm |
 |
Slayer2746 writes...Quote: Ok well I like the tutorial from sunday, but when i tried to do the same thing with anthoer model at the corner it turned 90 degress then at then end it went down in the ground ![[confused]](images/BBCode/smilies/confused.gif)
Also my other train which was the same urs turns over on its side, would patches be the problem or having it go down a little ways be bad>? ![[sniper]](images/BBCode/smilies/sniper.gif)
can somebody tell me wich where i can find this train tutorial where this guy is talking about? ![[confused]](images/BBCode/smilies/confused.gif)
i have allready search the whole forum for it but cannot find it |
 |
|
|
| The_Caretaker |
General Member Since: Jun 8, 2004 Posts: 11625 Last: Jul 7, 2009 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Friday, Jan. 11, 2008 02:51 pm |
 |
Most likely either this tutorial (for moving things) or this tutorial (about flying stukas).
What do you want to know exactly? Because that way we can help you better. |
 |
|
|
| TexasRebel |
General Member Since: May 1, 2006 Posts: 373 Last: Aug 20, 2013 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Friday, Jan. 11, 2008 07:15 pm |
 |
A long time ago when i was trying to make an entire map with a moving train I decided to throw together a small sample of one for the public. Here is the download for it
http://www.modsonline.com/Downloads-full-3753.html
The 90 degree problem the other person mentioned was because of how i positioned the models, and therefore i needed to subtract 90 degrees to get the train to go around the curve. Most likely the person just copied and pasted it without changing it to his needs.
The other problem he experienced was because his waypoint origin was below the origin of the train.
If you have any questions Ill be more than happy to help ya out.
|
 |
|
|
| Birdyman |
General Member Since: Nov 14, 2005 Posts: 55 Last: Nov 23, 2011 [view latest posts] |
|
|
|
|
| TexasRebel |
General Member Since: May 1, 2006 Posts: 373 Last: Aug 20, 2013 [view latest posts] |
|
|
|
|
| Scratchy |
 |
General Member Since: Feb 10, 2006 Posts: 276 Last: Mar 16, 2009 [view latest posts] |
|
|
|
Category: CoDUO Mapping Posted: Sunday, Jan. 13, 2008 10:15 pm |
 |
Been working on this code. Hope it can help someone.
Code: Main()
{
//Versatile Train
//Thanks to |TM|TexasRebel for his train move script, and Playername for help with debugging
//By Scratchy
//
//Needed in Map:
//-A Script Brushmodel or Script Model that will be the train. Needs to have these value...
//Key: targetname Value: train
//
//-Anything with an origin can be used for the waypoints, as long as they have the value...
//Key: targetname Value: waypoints
//
//-If you want the train to wait at a waypoint give it this value...
//
//Key: waittime Value: (time you want the train to stop in seconds)
//
//-The waypoints will also need to be numbered with this value...
//Key: track Value: 1
//
//^Start with 1, and go up from there. The train with follow by track number.^
//
//What Does it do?
//
//-This script will take a train, and make it follow a series of waypoints in the map.
//After completing predefined loop, the trains stops.
Train = getent("targetname","train");
Waypoints = getentarray("targetname","waypoint");
Wheels = getentarray("targetname","wheels");
Spawn = getentarray("track","1");
Wheels linkto(Train);
Train moveto((Spawn),0,0,0.05);
//How many times you want the train to loop the track.
//1 for one go around. Do not enter 0 or negative integer.
Loop = 1;
speed = 150;
//If you want the train to never stop, then change this next line to...
//While(1)
for(j=0;j<Loop;j++)
{
for(i=1;i<Waypoints.size;i++)
{
wayStart = getent("track", i);
wayEnd = getent("track", i+1);
thread Wheels Wheels_spin(Speed);
Train_Move(wayStart, wayEnd, Speed);
}
}
}
Train_Move(wayStart, wayEnd)
{
if(isDefined(wayStart.waittime))
wait(wayStart.waittime);
dist = distance(way1Start.origin,wayEnd.origin);
time = (dist / speed);
angles = vectortoangles(wayEnd.origin - wayStart.origin) - (0,90,0);
train rotateto((angles),0.001);
train moveto((wayEnd.origin),time);
train waittill("movedone");
}
Wheels_spin(Speed)
{
dist = distance(way1Start.origin,wayEnd.origin);
time = (dist / speed);
circum = 50 * 3.14;
spin = dist / circum * 360;
self rotatevelocity ((0,0,spin), time);
} |
 |
|
|
| TexasRebel |
General Member Since: May 1, 2006 Posts: 373 Last: Aug 20, 2013 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|