Author Topic: The "On-Rails" Issue  (Read 4344 times)

CamInHead

  • aka Roanoke
  • Jr. Member
  • **
  • Posts: 86
    • View Profile
The "On-Rails" Issue
« on: July 15, 2007, 05:26:02 PM »
I'm planning an old school, cell-shaded shooter in the same vein as the original Starfox/Wing. A kind of 3d homage to 2d shooters, though mine will be less restriained, more of a laugh and probably a little abstract story-wise, rather than a polished game.

Point is, have you fellas a system for restraining the direction the player travels in ?

I'm not sure if this is the done thing in the modding community, asking for trade secrets 'n' all......

Bobboau

  • Newbie
  • *
  • Posts: 37
    • View Profile
The "On-Rails" Issue
« Reply #1 on: July 15, 2007, 07:47:19 PM »
nope.

Axem

  • MRRFR MRRF!
  • Hero Member
  • *****
  • Posts: 2232
    • View Profile
    • http://www.sectorgame.com/axem/
The "On-Rails" Issue
« Reply #2 on: July 15, 2007, 07:54:36 PM »
Lies!

I mean, no! Maybe... kinda. Who knows...

:nervous:

Anyway your ideas intrigues me. I could provide some help with your endeavor if you're interested. ;)

CamInHead

  • aka Roanoke
  • Jr. Member
  • **
  • Posts: 86
    • View Profile
The "On-Rails" Issue
« Reply #3 on: July 15, 2007, 08:51:55 PM »
Quote from: Axem;76746
Lies!

I mean, no! Maybe... kinda. Who knows...

:nervous:

Anyway your ideas intrigues me. I could provide some help with your endeavor if you're interested. ;)


Well I haven't a working "modiing" PC as yet so it's all conjecture (sp?) at the moment.

Maybe I should look at WMCoolman's Scripting system. Wasn't it he who did a top-down mod a while back ?

Axem

  • MRRFR MRRF!
  • Hero Member
  • *****
  • Posts: 2232
    • View Profile
    • http://www.sectorgame.com/axem/
The "On-Rails" Issue
« Reply #4 on: July 15, 2007, 08:56:50 PM »
Yeah he was but the top down view wasn't done with that. That said however, the LUA scripting system is quite powerful and SoL is using it quite a bit for a few things.

takashi

  • Hero Member
  • *****
  • Posts: 1108
    • View Profile
The "On-Rails" Issue
« Reply #5 on: July 15, 2007, 09:21:20 PM »
what about a top down view, making the turn time for the y/x axis so long that it barely turns a pixel?

but then again, that would just be asteroids or space invaders....

CamInHead

  • aka Roanoke
  • Jr. Member
  • **
  • Posts: 86
    • View Profile
The "On-Rails" Issue
« Reply #6 on: July 17, 2007, 08:57:10 PM »
I've prodded tha' Coolman for a coders opinion about this before I get too excited.

WMCoolmon

  • Hero Member
  • *****
  • Posts: 891
    • View Profile
The "On-Rails" Issue
« Reply #7 on: July 18, 2007, 06:13:37 AM »
Well the 2D mission stuff is still in and working to my knowledge. I don't know if there's a checkbox in FRED in the Mission Specs dialog. There should be.

If top-down view isn't your thing, you can probably restrict the direction of travel in much the same way I did for the 2D mission stuff. Crack open a text editor and make a scripting.tbl using a recent CVS build with something along the lines of:
Code: [Select]
#Conditional Hooks
$State: GS_STATE_GAME_PLAY
$On Frame: [
     numShips = #mn.Ships
     for i=1, numShips do
          ship = Ships[i]
          phys = ship.Physics

          --Only let the ship turn on its y axis
          desiredRotVel = phys.RotationalVelocityDesired
          desiredRotVel.x = 0
          desiredRotVel.y = 0
          phys.RotationalVelocityDesired = desiredRotVel

          --Only let the ship turn on its y axis
          rotVel = phys.RotationalVelocity
          rotVel.x = 0
          rotVel.y = 0
          phys.RotationalVelocity = rotVel

          --Make sure the ship does not roll or pitch up or down
          orientation = ship.Orientation
          orientation.p = 0
          orientation.b = 0
          ship.Orientation = orientation

          --Don't let the ship slide up or down
          desiredVelocity = phys.VelocityDesired
          desiredVelocity.y = 0
          phys.VelocityDesired = desiredVelocity

          --Don't let the ship slide up or down
          velocity = phys.Velocity
          velocity.y = 0
          phys.Velocity = velocity
         
          --Keep the ship on the same plane (where y = 0)
          position = phys.Position
          position.y = 0
          ship.Position = position
     end
]
#End


I can't test that right now, but it should be ~90% correct and what you need.

DaBrain

  • Dude with micro shadows
  • Administrator
  • Hero Member
  • *****
  • Posts: 6000
    • View Profile
    • http://www.game-warden.com/starfox
The "On-Rails" Issue
« Reply #8 on: July 18, 2007, 08:43:36 AM »
Quote from: WMCoolmon;76935
Well the 2D mission stuff is still in and working to my knowledge. I don't know if there's a checkbox in FRED in the Mission Specs dialog. There should be.


I don't think there is one, but it there really should be one. You can still set it by eding the *.fs2 file.

Btw, you can get a pretty nice on plane movement with it, when you switch to the external camera.
Watch your shadow
-------------------
"the more i look at the shots the more i\'m becomming a..starfox fan :nod:"
-Dodger-


"Laziness is the first step to efficiency."
-DaBrain-


Official Q-Games fan

CamInHead

  • aka Roanoke
  • Jr. Member
  • **
  • Posts: 86
    • View Profile
The "On-Rails" Issue
« Reply #9 on: July 18, 2007, 08:45:18 PM »
Hey, that looks promising.

Shit, I wish my PC was working. I've some really cool ideas for this.

edit: thanks for the help, chaps.

CamInHead

  • aka Roanoke
  • Jr. Member
  • **
  • Posts: 86
    • View Profile
The "On-Rails" Issue
« Reply #10 on: July 19, 2007, 08:16:31 PM »
I'm going to spend some time playing SNES shoters for inspiration! Super Aleste, Axley, R-Type and Probotector spring to mind.

Bobboau

  • Newbie
  • *
  • Posts: 37
    • View Profile
The "On-Rails" Issue
« Reply #11 on: July 22, 2007, 09:16:55 AM »
so now that you have scripting like this, I'm thinking you might be able to figure out land vehicles, a script that locks rotation on all but the y axis, and if the object should ever find itself above it's desired hight simply increase velocity in the -y direction (if it is below set it to were you want it) that should allow for a very primitive vehicle that can hover momentarily.

depending on how complete the scripting system's model collision library is you could do more complex things as well.

takashi

  • Hero Member
  • *****
  • Posts: 1108
    • View Profile
The "On-Rails" Issue
« Reply #12 on: July 22, 2007, 07:37:08 PM »
can i have the script too?