Scripts / [SOLVED] Change player movement speed by LUA script

Author
Message
iiDenTiiTy
5
Years of Service
User Offline
Joined: 22nd Mar 2019
Location:
Posted: 23rd Mar 2019 16:06
Wondering if there is any way to change the players movement speed with the LUA scripting, any commands for getting the current max speed and altering it.
I am thinking of making some sort of player stat upgrade system which this would be useful for.

Thanks.

The author of this post has marked a post as an answer.

Go to answer
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 23rd Mar 2019 17:30
This post has been marked by the post author as the answer.
The global.lua file has all the available commands.

SetGamePlayerControlBasespeed:
RIP
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

New:
Intel(R) Core(TM) i5-8400 CPU @ 2.81GHz, 12GB RAM, Nvidia gtx1050ti 4gb, Windows 10 Home 64bit, Screen resolution 1920 x 1080. System Passmark 3774




iiDenTiiTy
5
Years of Service
User Offline
Joined: 22nd Mar 2019
Location:
Posted: 23rd Mar 2019 18:44
Quote: "The global.lua file has all the available commands."


My bad, didn't spot them when I looked for it earlier. Thank you though!
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 23rd Mar 2019 19:00
Its all good. Your welcome.
RIP
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

New:
Intel(R) Core(TM) i5-8400 CPU @ 2.81GHz, 12GB RAM, Nvidia gtx1050ti 4gb, Windows 10 Home 64bit, Screen resolution 1920 x 1080. System Passmark 3774




GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 24th Mar 2019 01:55
Nice. So I found SetGamePlayerControlGravityActive:
and wondered if anyone knew if this was a 0/1 on/off
or gravity strength setting?
PM
iiDenTiiTy
5
Years of Service
User Offline
Joined: 22nd Mar 2019
Location:
Posted: 24th Mar 2019 21:44
Quote: "Nice. So I found SetGamePlayerControlGravityActive:
and wondered if anyone knew if this was a 0/1 on/off
or gravity strength setting?"


The SetGamePlayerControlGravityActive() is 1/0, on/of.

Can't seem to find one than allows you to alter the gravity strength by use of LUA scripting.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Mar 2019 21:51
It would only make sense for physics objects anyhow, the player capsule and characters (at least until they ragdoll) aren't physics objects.

Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 8th Apr 2019 21:43
Aha, just thought of something, but haven't tested it.
How about reciprocating gravity? LOL That might be funny
if it works, or a way to vary gravity strength??

Wasn't sure why it's not settable in script, while it is
settable through properties... Radical!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 9th Apr 2019 02:54
SetGamePlayerControlGravityActive()

When I tested to see if this turned gravity off or on,
it seemed to have no affect on anything that I can see.

And I spotted a bug in the game engine.
If you set gravity very low (whatever you set it at),
the falling damage is always the same. (if the distance
of fall is equal).
But this does not jive with real world physics. If someone
went to Phobos and jumped off of a 15 meter tower,
it wouldn't be very painful- I'll bet, at least compared to the earth.

I think GG registers the hurt fall according to distance
fallen and not impact speed. That would be my guess.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 9th Apr 2019 09:24
There is no proper physics code in the engine for the player as (I keep saying) the player is *not* a physics object!

The gameplayercontrol.lua script probably contains the fall distance hurt stuff and it will not be anywhere close to being 'real world'.
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-04-26 04:55:50
Your offset time is: 2024-04-26 04:55:50