Author Topic: A thought regarding swivelling engines  (Read 2974 times)

0 Members and 1 Guest are viewing this topic.

A thought regarding swivelling engines
Reading through the stuff about making thrusters that could be moved got me wondering! My modding background comes from flightsims, and one of the things I really found aided immersion was having detailed cockpits...with moving controls.

A flight control stick and 'rudder' pedals that moved when you moved your own joystick.

Could this code be used for the same thing? You would need to have a 'parent' part of the stick that rotated forwards and backwards as the ship pitched up and down, with a 'child' part that moved left and right as the ship rolled...assuming you can have a part rotate in this 'nested' fashion! Rudder pedals can then also be rotated when the ship is yawed left or right. The final icing on the cake would be a throttle control too :D

Is this possible ?

 

Offline redsniper

  • 211
  • Aim for the Top!
Re: A thought regarding swivelling engines
I'll bet that if it isn't already, it will be soon with all the scripting stuff available.
"Think about nice things not unhappy things.
The future makes happy, if you make it yourself.
No war; think about happy things."   -WouterSmitssm

Hard Light Productions:
"...this conversation is pointlessly confrontational."

 

Offline Bob-san

  • Wishes he was cool
  • 210
  • It's 5 minutes to midnight.
Re: A thought regarding swivelling engines
I'm guessing you're refering to features such as the 3D cockpit in MS FlightSim 9 (or if you got FSX:D which is what I want though I'm not getting-its already slow in FS9, and FSX would just slaughter my machine at any reasonable settings).

I would recommend against it, actually. One of the cool things about FreeSpace is the incredibly helpful and uncluttered cockpit. I find that stuff cool in FlightSim but not FreeSpace; Freespace is more efficent and its more about looking through your HUD then looking out the cockpit. BUt whatever... I don't use the cockpits from the game.
NGTM-1R: Currently considering spending the rest of the day in bed cuddling.
GTSVA: With who...?
Nuke: chewbacca?
Bob-san: The Rancor.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: A thought regarding swivelling engines
ive done this on one ship with cutting edge builds. so its very possible. my code is far from perfect and the scripting system is always subject to change. heres my code, it worked on bobs last build (which as far as i know is in cvs).

Code: [Select]
$Subsystem: stick_pitch, 1,1.0
$animation:script
[
Angs = stick_pitch.Orientation
d = Self.DesiredRotationalVelocity.x /60
if(Angs.p < d)then
Angs.p = Angs.p + Self.RotDamp * ba.getFrametime()
elseif(Angs.p > d)then
Angs.p = Angs.p - Self.RotDamp * ba.getFrametime()
end
stick_pitch.Orientation = Angs
]
$Subsystem: pilot_stick, 1,1.0
$animation:script
[
Angs = pilot_stick.Orientation
e = Self.DesiredRotationalVelocity.y /5
f = Self.DesiredRotationalVelocity.z /1
if(Angs.h < e)then
Angs.h = Angs.h + Self.RotDamp * ba.getFrametime()
elseif(Angs.h > e)then
Angs.h = Angs.h - Self.RotDamp * ba.getFrametime()
end
if(Angs.b < f)then
Angs.b = Angs.b + Self.RotDamp * ba.getFrametime()
elseif(Angs.b > f)then
Angs.b = Angs.b - Self.RotDamp * ba.getFrametime()
end
pilot_stick.Orientation = Angs
]
$Subsystem: copilot_stick, 1,1.0
$animation:script
[
copilot_stick.Orientation = Angs
]
$Subsystem: throttle, 1,1.0
$animation:script
[
Angs = throttle.Orientation
d = Self.DesiredVelocity.z*1.4 - 110
Angs.p = d * ba.getFrametime()
throttle.Orientation = Angs
]

now this is for what youd find on a passenger jet, flight yoke and throttle.

the throttle stick is just a subobject with the center at the pivot point. stick pitch is the point at which the stick columb rotates, the pilot and copilot yokes are children of the stick pitch. i havet done rudders cause you never be able to see them. its crude and might not work on every model without tweaking. post shaders wel be able to do animated panels with shader based rtt. 
« Last Edit: January 31, 2007, 03:01:19 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 
Re: A thought regarding swivelling engines
Are we talking about thrust vectoring engines like the vampire and panther have?
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: A thought regarding swivelling engines
those are possible too :D
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 
Re: A thought regarding swivelling engines
WOOHOOO now one of these days you'll have to show me how to get that to work  :nod:
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

  

Offline Bob-san

  • Wishes he was cool
  • 210
  • It's 5 minutes to midnight.
Re: A thought regarding swivelling engines
I have a few ideas for multi-axis control of ships... will the code actually make the engines change in direction partially? Like if the ship I have goes forward on the normal axis and I can straff to the left... will the engine be able to rotate the proper amount for the speed?
NGTM-1R: Currently considering spending the rest of the day in bed cuddling.
GTSVA: With who...?
Nuke: chewbacca?
Bob-san: The Rancor.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: A thought regarding swivelling engines
straifing is a ground attack flight manuver, i dont know how it became gamerspeak for moving left or right.

anyway you have all those physics vars toplay with. more than enough to animate like mad. i suggest you all start learning lua.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Bob-san

  • Wishes he was cool
  • 210
  • It's 5 minutes to midnight.
Re: A thought regarding swivelling engines
I know both meanings of it...

But anyways, Nuke... I don't know lua (and have no real reason to learn it) and I was wondering if I could have a ship that will maneuver with an engine at different angles. could be cool to do that with a next-gen ship.
NGTM-1R: Currently considering spending the rest of the day in bed cuddling.
GTSVA: With who...?
Nuke: chewbacca?
Bob-san: The Rancor.

 
Re: A thought regarding swivelling engines
I know both meanings of it...

But anyways, Nuke... I don't know lua (and have no real reason to learn it) and I was wondering if I could have a ship that will maneuver with an engine at different angles. could be cool to do that with a next-gen ship.

That would the be the vampire, panther  :)
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: A thought regarding swivelling engines
well ive done thrust vectoring on some ships. but to make it feel right it would need to be tweaked so as to manuver accordingly. you do have acess to the velocity vector, so that shouldnt  be too hard.

and lua was a fairly easy language to learn. the manual sucks but the lua wiki makes up for it. after looking at a few examples and by tweaking them i managed to learn quite abit.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: A thought regarding swivelling engines
Most of the physics variables should be in the physics class. But it is perfectly possible for redundant variables to exist, I just greatly dislike it. I know that I changed some of the stuff Bobb imported to CVS for similar reasons, other stuff I just grimaced and left in because I didn't feel strongly enough about it to take it out or change ti.
-C

 
Re: A thought regarding swivelling engines
I can see I am going toDoes have to delve into the scripting Wiki when I get in from work tonight!

I will set up the model hieracrchy, and have a go at this. Do the parts need to be arranged in any particular way, or should they all just be child objects of the cockpit model?

 
Re: A thought regarding swivelling engines
Ok question and thought time  :lol:

Ok what build do you need to do scripting? (whats the best build yet?) link please  :)

second from what it looks the scripts go into the table presumably in the subsystems, correct?

third the actually script for the vampire as a start, could somone write the script, i think nuke's got the right idea but i have no clue on the actually code and vectors. 
  • a roll to port will cause the port engine to pitch down and the starboard engine to pitch up
  • a roll to star will cause the port engine to pitch up and the starboard engine to pitch down
  • pitch down will cause both engines to pitch up
  • pitch up will cause both engines to pitch down
  • I'm guessing the engine change angles would be opposite to ships change angle.
  • I'm also guessing that the only difference between the port and starboard scripts would be that the angle would be negative of each other (i.e. if one is going 20 degrees the other is going -20 degrees

for those wondering or don't know what the vampire is

That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: A thought regarding swivelling engines
I can see I am going toDoes have to delve into the scripting Wiki when I get in from work tonight!

I will set up the model hieracrchy, and have a go at this. Do the parts need to be arranged in any particular way, or should they all just be child objects of the cockpit model?

mine are set up as child of the ship i think. sence they are subobjects they will render properly behind the glass.

*edit*

btw this thread should have the builds you need to get my code to work.

*edit again*

just tested it and theres a possibility this may also work under one of wmcs latest scripting builds with some modifivations. mainly the self.insertphysicsvarher needs to be changed to self.Physics.insertphysicsvarhere
« Last Edit: February 02, 2007, 04:11:10 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN