Moving Rail Carts

Post » Fri May 27, 2011 9:49 pm

Recently, I have been making improvements on a mod I have made. It is NoM Compatible and I added on a new region below the Histaang Forest region. I named this the Histaang Sea. I built a special player fortress where there is a quest to access. I have been thinking, is it possible to create an underground mine Rail system that ACTUALLY MOVES? I was also wondering if it could even turn at certain points. It would be AMAZING if someone could help. If this is possible, I would happily share the design. I havn't finished it all yet, but I am trying to get it don asap. A recommendation on what type of interior to use that when a player is riding, that they do't collide with the ceiling of an interior cell. Thanks.
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Sat May 28, 2011 4:20 am

Yeah, it's doable. I think that Steampunk mod had moving underground trains, maybe check that out?

You can use SetPos to move the cart and the player. Something like this (completely untested, not even tried to compile it):
Spoiler
short statefloat myXfloat myYfloat myZfloat speedXfloat speedYfloat speedZfloat timerfloat tempif ( OnActivate )   set state to 1    set myX to GetPos, X   set myY to GetPos, Y   set myZ to GetPos, Z   set speedX to 40.0   set speedY to 0.0   set speedZ to 0.0    set timer to 0endifif ( state == 1 )   set timer to GetSecondsPassed   set temp to speedX / timer ; Keep it moving at a constant speed, irrespective of fps   set myX to myX + temp   player->SetPos, X, myX   set temp to speedY / timer   set myY to myY + temp   player->SetPos, Y, myY   set temp to speedZ / timer   set myZ to myZ + temp   player->SetPos, Z, myZ   setpos, X, myX   setpos, Y, myY   setpos, Z, myZ   if ( turning_activator->GetDisabled == 0 ) ; This is an invisible activator at the turning point. editor_marker.nif, I think.      set temp to (turning_activator->GetPos, X - myX ) ; Are we inside a box 200 units to a side?      if ( temp < 100 ) ; I can’t remember, does (temp < 100) && ( temp > 100 ) work? If so, combine these.      if ( temp > -100 )          set temp to (turning_activator->GetPos, Y - myY )          if ( temp < 100 )          if ( temp > -100 )              set temp to (turning_activator->GetPos, Z - myZ )              if ( temp < 100 )              if ( temp > -100 )                 turning_activator->Disable                 set speedX to 0                 set speedY to 40                 SetAngle, Z, 90 ; or whatever              endif              endif          endif          endif    endif    endifendifend

User avatar
Sudah mati ini Keparat
 
Posts: 3605
Joined: Mon Jul 23, 2007 6:14 pm

Post » Fri May 27, 2011 8:53 pm

Okay, I am posting the rail length to have others, like you, create a script.
Y-AXIS: 42560 -> -2880 = -45440 units on the Y axis ( This track does not turn, but it seems that it goes off the edge of an interior cell? I activated water, for I was using a mounhold sewer. The water just.... Stopped. Will it still work? I also tried to access through khuul, and it blacked out and closed. It's supposed to go all over the place, long and fast to balmora, Vivec, Vos, and other places. No warning box or anything.) Thanks
User avatar
Luna Lovegood
 
Posts: 3325
Joined: Thu Sep 14, 2006 6:45 pm


Return to III - Morrowind