Scripts / About new water LUA commands

Author
Message
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 10th Jun 2017 11:39
Hi guys
I had coded a very basic water script for testing purpose.



It works fine, except for a small detail, player died when underwater.

Since "command used by the default player control mechanism" do not tell nothing to me, I had used the most likely to be the accurate one "SetGamePlayerControlUnderwater()", with not to avail.

am I missing something?

Thanks in advance for all tips

3com


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
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Jun 2017 18:12
I would imagine you have to check out the control script and alter that to avoid death by drowning. I don't think there's a simple way to enable disable with those commands. I would think that the commands would be more for visuals or simple flags for the code to work with. I'd check out the gameplayercontrol script and look for the drowning part of the script to disable or delay drowning. The code to kill you exists there


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Jun 2017 18:25
Quote: "I don't think there's a simple way to enable disable with those commands"

Yes, I think so; anyway I want to be sure about. However would be cool to have one LUA command to enter in "swing mode".
Ty DVader for the tip.

3com
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
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Jun 2017 18:43
Just change this

DrownPlayer(-1,200)

to this

DrownPlayer(-1,0)

That will stop you drowning entirely You could also reduce it to drown more slowly. There's a timer command you could alter as well to slow/speed the breathing effect.


SPECS: Q6600 CPU. Nvidia 660GTX. 8 Gig Memory. Win 7.
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 11th Jun 2017 19:13
Quote: "DrownPlayer(-1,0)"

I've missed that command, definitelly I was missing something.
Ty again Dvader, it works.
Now I should work with breathing effect, even some kind of air bar metter, like FPS does.
And why not, an oxygen bottle that allows you to stay longer under water.

3com
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

Login to post a reply

Server time is: 2024-04-16 08:42:21
Your offset time is: 2024-04-16 08:42:21