Scripts / Flight Simulator!

Author
Message
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 22nd Dec 2015 20:36 Edited at: 22nd Dec 2015 20:39
I had a few drinks tonight. And this led me to think that, maybe.. just maybe... (despite my very limited Lua knowledge), I might be able to create a very basic flight simulator game by using the new sprite commands to place in-flight info on-screen and detecting keystrokes. My first test was getting the player airborne by pressing 'O'. But my script doesn't work.

The Player Marker is definitely entity no. 1.

Anyone have any ideas?

Thanks!

Julian
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 22nd Dec 2015 20:47
The script is attached to a dynamic barrel, always active with physics off.
Julian
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 22nd Dec 2015 22:23
GetScancode(1) should be written like this GetScancode()

you also need to turn off collision to move objects (and if you assign the script to the object there's no need for the object number, just use e)
also you will need a TransportToIfUsed(e) in there (with the name in the ifused property field) to actually move the player - i assume this is for moving the player?


life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 23rd Dec 2015 17:35
Thanks, SmallG.
Julian
PM
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 26th Dec 2015 20:30
I can get the player to fly around but I haven't been able to get it to resemble aeroplane flight. I've been trying to create a relationship between the angle of the player and the angle of the entity used. I can't seem to get it. Anyone have any ideas?


Julian
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th Dec 2015 21:02
it doesn't work yet, TransportToIfUsed(e) will automatically set the x angle back to 0.
i agree it would be nice to get the option to have one that allows us to use the entity angles instead (which is used to do) while also having another for using the player's angles.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11
lordjulian
10
Years of Service
User Offline
Joined: 10th Jan 2014
Location:
Posted: 27th Dec 2015 01:49
Oh, well. Never mind. Thanks for the heads-up, SmallG. At least I'm getting the opportunity to stretch my fledgling Lua wings. Seasons Greetings!
Julian
PM

Login to post a reply

Server time is: 2024-05-06 07:24:46
Your offset time is: 2024-05-06 07:24:46