Scripts / space

Author
Message
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 10th Mar 2016 23:05
Hi all, ive just been messing with go_indoors and it gives a nice space environment when set to a trigger, problem is I set grav to 0 and it seems like I'm not moving? whats the best way around this as I'm playing with modelling a proper Mothership that the player can fly to and dock and even maybe have contacts along the way...ideas?
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 10th Mar 2016 23:23
you could remove the default movement completely and set up your own using the g_KeyPressW etc and TransportToIfUsed(e)
you can then easily control acceleration and such but looking up & down gets broken due to the x and z angles getting forced to 0.
i've done it for a car racing game it works ok, i don't think GG can currently simulate a free roaming space game very well though.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 11th Mar 2016 15:51
well tbh I wouldn't really need up and down, as its just flying to a planet, could make that look like it is, gonna play about with it tonight thanks smallg
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 11th Mar 2016 18:43
well this is the basic of how i did it in my car game (obviously it wont work as is because there's more code in my script)

first you define the top speed, acceleration etc


then in the main script you just check update the speed based on the player holding w or s (my turning is done via the mouse)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 11th Mar 2016 19:33 Edited at: 11th Mar 2016 21:05
ok will give that a bash thanks smallg Edit: cracked it

Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 11th Mar 2016 21:31
now I just need to find a way to make the player fall or dies if they leave the hanger without the ship...kinda funny tho walking about in space
MChapman
9
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 12th Mar 2016 06:58
I commented on your other post about your current problem with the player leaving the hangar, I must say this is quite nice how you did this. you should make your acceleration increase over time or gradual. Sorry if I'm off topic but just an idea, instead of staying at one speed with the regular walk.
Markchapman10 is my Skype let's have some dev talk.
Honkeyboy
3D Media Maker
9
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 12th Mar 2016 10:59
It actually does I was just slowing it down for the video, the vehicle physics work pretty well

Login to post a reply

Server time is: 2024-12-22 15:13:03
Your offset time is: 2024-12-22 15:13:03