Scripts / Still stuck with player up and down

Author
Message
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 30th Sep 2019 12:59
Hi all,
Don't know why but I've been trying to no avail with this and seem to have a mind block. I'm adapting one of my mech scripts for a space project and need the player to go up and down but for the life of me I cant get it to work ….grr any help would be appreciated thanks





Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 30th Sep 2019 20:50
What bit of that were you expecting to move the player?

Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 30th Sep 2019 23:23 Edited at: 1st Oct 2019 02:17
Sounds like for your project that it's best to take full control
and use TransportToFreezePositionOnly

That is if you want free //mouse// pan the camera view at the same time.
If you want the lateral movement frozen use TransportToFreezePosition.

The way to do the TTFPO is to put the script on any dynamic object
((you can hide this object)) Hide(e)
and control (the x,y,z) , and tie the player to that script with TTFPO
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 30th Sep 2019 23:46
BTW, you have no mechanics (math/ variable manipulation)
to move the player in your script, even if the used function where valid.

Use something like

jetup_y[e] = jetup_y[e] + 2
jetup_y[e] = jetup_y[e] - 2

SetFreezePosition(plyrx[e],plyry[e],plyrz[e])
TransportToFreezePosition()

And you don't have to, but I often use the i,j,k,l keys (experiment first)

Attachments

Login to view attachments
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 1st Oct 2019 13:20 Edited at: 1st Oct 2019 14:04
@ AM took those bits out m8 as I couldn't get them to work that's just the base script for the mechs and tanks. I tried using player height which doesn't seem to work now and a few other move commands but didn't get anywhere. I have a script to move an object and transport the player to that object but as I'm using a hud (see vid) I need to move the actual player up and down.
@ GubbyBlips ok m8 will have a try at that but think that was similar to what I just tried will give it another go maybe I missed something.


liberty fighter cockpit test


or of course using the 3rd person route



this is mainly atm for aesthetics for space 3d flight as I'm currently writing scripts for space trading to make a freelancer style project (those scripts I'm fine with ) just getting the ship to move up and down has my brain fogging :/
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 1st Oct 2019 13:39 Edited at: 1st Oct 2019 13:43
Nice one, wondering if we could get close to air combats like that

PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 1st Oct 2019 14:06
Yeah it would be very cool osiem80 I just don't get why we don't have a solid player up or down command? even just player up where we could use - + values I struggled with this as well when playing around with a super hero game getting the player to fly.
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 1st Oct 2019 14:21
https://forum.game-guru.com/thread/218590
Someone made a fly simulator 2 years ago
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 1st Oct 2019 14:34
Yeah saw that before shame they didn't share the code
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 1st Oct 2019 14:47 Edited at: 1st Oct 2019 14:49
I wrote a massage on hes yt account about the code, hes active, he uploaded a video yersterday, if u got luck he might help u.
And what about these one?
https://forum.game-guru.com/thread/214140
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 1st Oct 2019 18:19 Edited at: 9th Oct 2019 20:01
OK getting there found an old script I was using for a ww2 plane and after some editing its now kinda working (very twitchy) just need to change the controls to mouse rather than keyboard (except up and down which are r and q) posting them so if any of you guys can clean it up or get it to work nicely without errors please repost with the updated version
here it is in action the fighter ground goes on your grounded fighter always active etc you'll need to change the reference to whatever hud you want to use.
still think it would be far easier with a MovePlayerUp(e,v) command lol

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Attachments

Login to view attachments
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 1st Oct 2019 19:13
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 1st Oct 2019 23:22
Something like this?



Needs some polishing but it's a starting point.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 2nd Oct 2019 00:27 Edited at: 2nd Oct 2019 00:56
Nice, next time i see a flying case, i know thats u
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 2nd Oct 2019 04:29
@ AM
Love your plane, you can put the beers inside and good fly!
Nice one mate., thanks for sharing.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 2nd Oct 2019 10:19 Edited at: 2nd Oct 2019 14:50
PMSL fantastic totally what I and I'm sure loads of others will use (love the crate ) gonna test that on the aircraft now cheers AM.
Edit: Ok first test run results:
1/ first thing I noticed was the mouse cursor appears on the loading screen you can see it briefly in the vid, don't know if that would make any difference to anything but seems like the script is running at loading time.
2/ some camera control maybe? when I board the ship because of its size you cant see it like you can the crate I did shrink the ship and you can see it through various sizes giving various effects e.g from the cockpit or behind the ship but then the ship would look far too small when you go to board it.
3/ the control starts before you actually take off so I instantly started to spin before I knew what was going on lol freeze the ship position maybe?
4/ Keyboard control for left and right? making it more like an aircraft sim control.
5/ lastly so far the E (eject key) lol that ones self explanatory
loving it so far AM it's got me hooked again gonna take the missis shopping and have a play around with seeing if I can get some camera controls in and maybe the hud for first person although I think if it would work really nice in third (be nice to have both)
Edit2: ahh you have some camera controls in the script



ok adjusted the camera
flight test 2 (I see we still get the shaking when the speed increases)

Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 2nd Oct 2019 14:58
Nice, exactly what I contemplated doing- mouse control fly.
You know guys what AmenMoses has just ~ CRATED~ ?!

With some tweaks and prohibitions
THE PERFECT SWIMMING TOOL! Just add huds (well optional).

Inhibit speed-- and put in water level detection-- is about all I can see needs.
Pickup one of these gadgets and go! https://travelaway.me/underwater-gadgets/
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 2nd Oct 2019 15:27
Just been trying to add a cockpit HUD no joy as yet it would solve the juddering issue as you wouldn't see the ship, as to the speed its already quite slow (needs speeding up) so I think you'd be good to go on that
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 2nd Oct 2019 16:06 Edited at: 2nd Oct 2019 16:06
Good one, i was looking 4 something like that to make a drivible tank that can shoot
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 2nd Oct 2019 16:24 Edited at: 2nd Oct 2019 17:07
Tanks, Mechs and Infantry should all be on my thread here
https://forum.game-guru.com/thread/219571
for third person vehicles you could probably use the speeder scripts
https://forum.game-guru.com/thread/215480

any questions or if they don't work any longer just let me know I'm going to revamp them anyway

Edit: yep Tank works run out of cannon ammo though lol and need to swap it over to the other side of the tank



now you see where the aircraft come in
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Oct 2019 20:07 Edited at: 2nd Oct 2019 20:08
The juddering is probably due to the player capsule colliding with the ship, move the player further away, i.e. change the numbers in this bit:
SetFreezePosition( h.pos.x, h.pos.y + hoverHeight + 80, h.pos.z )

To increase the speed change the maximums in this bit:


And similar places.

Oh and pressing R is supposed to take you into the cab.
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Oct 2019 21:12
Added Yaw control (rudder iow). A/D keys for rudder.
Also changed way throttle works, W increased throttle but when you let go it stays at that setting. S to throttle back. (no reverse anymore, it is an airoplane after all!)
Also added gravity and lift. The faster you go the more lift. (probably want to disable that bit for spaceships!)

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Oct 2019 21:52
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 2nd Oct 2019 21:52 Edited at: 2nd Oct 2019 22:03
Oops

Ok I'll use this post for a bit of education.

GG started out as a First Person Shooter game maker so in the engine a lot of assumptions are made based on that premise, for example the 'player' is really just a capsule shaped thingy which is assume to always be upright (as soldiers very rarely are) and only rotating in one plane. Also the player view of the world is assumed to be pretty flat, you can only look up and down so far for example.

So for stuff like this where true three dimensional movement is required you have to take control of the camera your self, but this leads to a bit of a conundrum, i.e. what do you do with that player capsule thingy? You can't really switch it off, at least until Lee allows such a thing, so you really can only move it put of the way … but what happens when you switch back to the FPS view of things? You can't shove the player capsule completely off the map as then the engine will complain and probably kill you!

Best bet would be to allocate a small part of the map for the player capsule and stick it there whilst you muck around with camera views and stuff, then when done simply move the player capsule back to a sensible location to carry on with the game.

(I haven't actually done that here btw, instead the player capsule is trailing along just behind and above the aeroplane entity)

This latest toy is only possible btw due to fixes recently made by Preben in the engine! A year ago this would have looked a right mess.
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd Oct 2019 23:36
nice job, looks pretty smooth in the video
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 2nd Oct 2019 23:46
Battle of Britain
PM
yrkoon
20
Years of Service
User Offline
Joined: 14th Jan 2004
Location:
Posted: 3rd Oct 2019 11:00
Amen Moses, the GG-Master of air vehicles.
Only real flaw of the spitfire seems to be the slow rotation of the propeller; would it be possible to exchange the three bladed propeller model with a 9- 12 bladed, considerably blurred model to fake 4 times faster rotation, the moment the plane goes airborne ? (just an idea)
Lives of great men all remind us we may make our lives sublime
Core i7 4710 QM GTX 980 MQ 16GB RAM Win7
PM
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 3rd Oct 2019 11:51 Edited at: 9th Oct 2019 20:03
Ok had a fly around the map adjusted the max speed to 2000 lol much quicker what line is it for acceleration? Although I do like the 3rd person sometimes the craft is at slightly weird angles when going forward which is where the hud idea might eliminate this as you wouldn't see it maybe? so im kind of thinking maybe if you displayed the hud, hid the craft and had a fixed target sight then any guns would then just have a fixed point to fire at. same with third person really .. seems alittle weird with the sight moving around. just a thought gonna have a play around with it today love it so far though its very cool

something along these lines maybe with the view fixed until the craft leaves the ground (liberty Li_Elite fighter hud attached)




OK I now have the ship pretty much doing what I need for this (basically a rewrite of Galaxy) now the ship does what it should thanks AM I'll need to add some dials etc etc but its getting there, here's the snag atm as the ship approaches the station or the planet a script should run freezing the player asking if they would like to dock, playing a short video and then jump to level. I have the script partially written but FreezePlayer() doesn't work? would it be better to add names e.g Station, Planet to the aircraft script to freeze it and run that script or should it work from the station, planet side?
heres a vid showing where it should happen and what I have so far script wise




HUD UPDATE : now were cooking



also is there a way to start the player in the ship so as you could have the player click the ship in the hanger, play a vid of the ship leaving and then jump to the space level actually in the ship (running about in space loos abit odd pmsl
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-24 17:31:17
Your offset time is: 2024-04-24 17:31:17