Product Chat / Swimming tweaks

Author
Message
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 20th Jul 2020 06:08
Been messing around with GPC.lua.
Seeing what can be done about swimming. MUCH better techniques
could be produced if more parameters are freed up from the engine.
Adding ForcePlayer in UP == 'Y' would be GREATLY beneficial to the task.
OR-- just send the values of ForcePlayer 'X' and 'Z' to be called by scripts.
What that means is how ForcePlayer moves player 'X' amount, 'Z' amount-
which could be called every frame. So we can add it to SetFreezePosition.

BTW, how do you embed a script snipet, and I'll post some?
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 20th Jul 2020 18:46
You click on code
Select lua, then press Enter
then paste your script
select code and select lua again.
press enter again.
And that's it.
Windows 7 Professional 64-bit
Intel(R) Pentium(R) CPU G3260 @ 3.30GHz (2 CPUs), ~3.3GHz RAM 16GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 21st Jul 2020 02:28
How much different is the very latest GPC.lua to December 2019 build?
I have the Dec. 19 build still.
I can give you this code, but for some it might be difficult to plug it into
the right spot-- and I might get a lot of complaints if their GPC.lua is gone
into a mess?! It works kinda okay for me, even though as stated, with more
free data transfer from the engine, things could be much better.
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 21st Jul 2020 02:32 Edited at: 14th Mar 2023 20:39
Okay, this is what we got so far.
Back up your GPC.lua- do it now!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 21st Jul 2020 02:47
Credits to Teabone for working on the under-water FIRST.

The approx. location to set this code at is 1660, the previous code
is replaced until the Original line that says: "-- going under water"

I like to run and jump into the water... to break the suface...
While pressing 'W';
look up, move up
look down, move down

Press 'A' and 'D' for more forward strokes
The engine control to slow the player under water makes movement on the
surface of the water iffy. You might like it if you want speed. There is a fight
between horizontal movement and vertical movement because there is not
a smooth transition option in scripting the player ((unless exterior scripts to
control "riden objects" is utilized.))

Backup original scripts first of course.
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 21st Jul 2020 08:33
Try using and changing the inputs to the character controller itself (in the ‘gpc’ lua) rather than setposition and forceplayer. Do this when the player y position is below the water plane level and water is switched on. This uses the same physics capsule controller as for normal movement. This approach will give you smooth movement and transition.

Cheers.

GPU: GeForce RTX 2070 SUPER PassMark: 14817
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 22nd Jul 2020 03:26
Hi cybernescence, I hear ya. I'm sure that would be the best way to go.
How exactly to do it I'm not sure. Wishfully, if they could just add a 'Y'
(vertical) component to ForcePlayer(a,v) then that seems like that would
fit the bill beautifully.

As currently set in the code above, it makes a kind of swim stroke effect--
but ya to have it continuous without the break would make sense.
PM
Teabone
Forum Support
18
Years of Service
User Offline
Joined: 8th Jun 2006
Location: Earth
Posted: 22nd Jul 2020 04:01 Edited at: 22nd Jul 2020 04:02
I don't really poke too much at the swimming stuff anymore, but last place I left off was having it so that when you press W it will make the player rise and move forward rather than SPACE bar (which makes you rise straight up - which is a mechanic not in any game):



The best way to make swimming is to just make it so it detects if the player is looking above the horizon or below. Below would make the player swim downward and above would be upward. I'd even prefer it if your going down that it moves downward in internals to suggest swimming hand motions. Bugsy did do a great job making hand swimming animations, but I never got around to testing with them in game with this. I kind of was just hoping Lee would do it, so I can focus more on making my games Which is what i do now.
Store Assets - Store Link
Free Assets - Resource Link

i7 -2600 CPU @ 3.40GHz - Windows 7 - 8GB RAM - Nivida GeForce GTX 960

Login to post a reply

Server time is: 2024-11-23 16:15:29
Your offset time is: 2024-11-23 16:15:29