Spaceship Controls / Vehicle Movement

Have any questions in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

If you are getting an bug or error, please report it to the Bug and Error Reporting forum section instead.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.
User avatar
Kraven4382
Member
 
Joined: Fri Jul 17, 2015 9:56 pm

Spaceship Controls / Vehicle Movement

Postby Kraven4382 » Sun Mar 19, 2017 9:55 pm

Hello,

I would like to make controls for a spaceship but I would like it to fly more like a spaceship than the standard vehicle coding. Does anyone know if it's possible to set a vehicle to rotate without forward movement? Something like that would probably be sufficient.

Ideally, I would like the controls to be...

Up (Forward Thrust)
/\
|
|
Left <---- (Rotate Ship Left) (Rotate Ship Right) ---> Right
|
|
\/
Down (Reverse Thrust)

The ship also having inertia and continuing to move in the same direction even while rotated to a different direction when the thrust is off would also be super cool.
An example of this mechanic is used in the game "Starsector" https://www.youtube.com/watch?v=RecflKfP828

If anyone knows how to make this work and has a few minutes to share I would really appreciate it.

Thanks! Kraven

twitchcoe
001 Subscriber
 
Joined: Sat Oct 03, 2015 8:40 pm
Location: Fraser, CO

Re: Spaceship Controls / Vehicle Movement

Postby twitchcoe » Mon Mar 20, 2017 2:57 am

This is absolutely possible! I am using this type of control setup in my space game, though the knowledge behind the math came from Mr. Numbers ;)

You can rotate an actor with Actor("ActorName").DirectionAngle. That can be set up using something simple like this:

Turn Left (The right control is the same, I just add +0.2 instead of -0.2)


The inertial movement is another little chunk of scripting using custom events and a Push to move the actor after some calculations, though I will have to type up something more detailed to explain that part once I am a bit more awake, but it is absolutely possible!

User avatar
Kraven4382
Member
 
Joined: Fri Jul 17, 2015 9:56 pm

Re: Spaceship Controls / Vehicle Movement

Postby Kraven4382 » Mon Mar 20, 2017 10:36 pm

Thanks so much, I can't wait to test this out!

(updated) Works fine for what I need, thanks!


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users