Scripts / Slower speed after getinng hitted

Author
Message
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 21st Feb 2019 12:23 Edited at: 6th Oct 2019 19:54
Hi, is there a script to make the player slower through get hitted by the enemy?Like in CSGO.
I mean not all the time slower only the 0,5 second after get hitted.I hope i described it good, those who play cs sould know what i mean.
It would be much more realistic and cooler.
as example a video, minute 2:37
PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 22nd Feb 2019 13:32
Ok in this thread i find out thats not possible to change the player walk speed via scripting
https://forum.game-guru.com/thread/213354
But the thread is 4 years old, has something changed since that?(question to smallg and amenmoses)

PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 22nd Feb 2019 16:06
I try to make somethink similar, with editing smallgs camera shake script(i hope its okay 4 u)
I wanna a camera shake while getting hitted effect, i replaced the press e triggeer with Hurtplayer but there is a error"then expected near state", where is the problem?
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 22nd Feb 2019 16:49 Edited at: 22nd Feb 2019 17:08
im no expert but as far as i know you need a then in your if statement.
also not sure if you can use HurtPlayer() in the if .

line 26
if HurtPlayer() then
state = "shake"
end

Ps . this is what you were looking for. SetGamePlayerControlTopspeed(v)
https://forum.game-guru.com/thread/220087?page=1#msg2606112
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
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 22nd Feb 2019 17:19
thank you the error is gone but the script doesnt work, your was right i cant use hurtplayer in if, i think the reason ist thats not defined in the script, i could it use in "then".Seted also (e,1) after hurtplayer but nothing.
Quote: "Ps . this is what you were looking for. SetGamePlayerControlTopspeed(v)
https://forum.game-guru.com/thread/220087?page=1#msg2606112"

Yes, amenmoses sendet it me already.But now i try to do the shake effect, any idea how to do that?

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Feb 2019 17:54

Been there, done that, got all the T-Shirts!
PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 22nd Feb 2019 18:20 Edited at: 22nd Feb 2019 18:27
not working

is g_PlayerHealth holding the players current health?
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Feb 2019 18:37 Edited at: 22nd Feb 2019 19:08
Yes.


change it to:
Been there, done that, got all the T-Shirts!
PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 22nd Feb 2019 19:01
Sorry doesnt work, it works for u?
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Feb 2019 19:09
Even when it is working though the effect is horrible.
Been there, done that, got all the T-Shirts!
PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 22nd Feb 2019 19:41
yes but they are changable with this properties

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Feb 2019 20:30
It's way to juddery, it would be better to take control of the camera directly rather than the way the script does it, and have the movements smoothed out over multiple frames rather than just jumping instantly like it does.
Been there, done that, got all the T-Shirts!
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 23rd Feb 2019 05:13
Interesting idea. Might take a go at it sometime...? Maybe they could
look down to the ground for a second?
BTW, this might be realistic, but if you're in a heavy gunfight, and you
keep getting hit- being slowed up is that last thing you want! lol
but yeah, see your point.
PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 23rd Feb 2019 12:44 Edited at: 23rd Feb 2019 12:48
Quote: "Interesting idea. Might take a go at it sometime...? Maybe they could
look down to the ground for a second?
BTW, this might be realistic, but if you're in a heavy gunfight, and you
keep getting hit- being slowed up is that last thing you want! lol
but yeah, see your point."

I dont think thats possible to make such heavy gunfights /mass combats in GG and besides, the shake effect would be very little, should not disturb in battles .For example like here at minute 2:33.Just a s u sayed, look up or down for a part of second.

This effect should be standard for the player in GG, maybe with the next updates they bring it(i hope lee reading this thread )
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 23rd Feb 2019 13:27
A while back I was trying to track down a bug in GG whereby a custom weapon I was working one had some strange sound effects going on that weren't coming from my weapon samples, turned out to be bullet impact sounds and worse some faked echo sounds.

Totally unrealistic and I couldn't for the life of me imagine why the engine has this behaviour hard wired into the default weapon system, now I've watched the video I can see where the idea comes from, personally I hate all those fake hollywood touches, when at an indoor range you do sometimes hear impact sounds (especially when you miss the target), but outside in the middle of a battle, even at close range you wouldn't hear anything.

Funny story time, once when testing out an old air rifle I'd heavily modified I heard a strange buzzing noise like an angry wasp followed by a faint tink sound after each shot, I could see I'd hit the cardboard target so was a bit puzzled to say the least. I looked over my shoulder to see the range warden waving his arms to get my attention. Turned out my pellets were bouncing off the wall behind the target, coming back down the range past my head and hitting the range wardens hut behind me! He wasn't too happy with me.

Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 23rd Feb 2019 23:21
so it's fake and unrealistic to hear bullets miss and/or impact... followed by a story of the time you heard exactly that?

joking aside i understand your point and agree you wouldn't be able to hear such things in a real gun fight as there's just too much other noise etc but i think games having such things are fine though whether it's realistic or not, you don't get the "real" sense of combat from a game so anything that can be added to increase that sense of being in danger is good.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 23rd Feb 2019 23:59
Verdun gives a real sense of combat, i.e. you leave the trench to run at the enemy and you're either dead within a few seconds or you end up completely lost in a muddy wasteland with no idea of where the enemy are, who the enemy are or whether any of your 'team' are still alive.

As to reality it all depends on what you are shooting and what you are shooting at, fire off a few rounds from a Desert Eagle and you are completely deaf for about an hour or so, an SLR same thing except you also have an aching shoulder, probably a bruised face and if you fire off a whole magazine plenty of minor burns to worry about.

The more modern small calibre weapons are very quiet in comparison but the small rounds tend to penetrate so well that very little impact sound is made unless firing at hollow steel barrels or something.

Why on earth anyone would expect a sniper to hear the impact sound is beyond me though, unless you are firing at Big Ben or something.


(and you may have noticed I was firing an air rifle, in an empty indoor range, on my own, with no ear defenders. In all my many hours in the range with different weapons like Brownings, SMG, SLR etc I can't honestly say I've ever registered any sound of the bullet impacts! Swearing from NCO's, ringing in the ears and screams of pain from fellow masochists I've heard plenty of mind!)


Been there, done that, got all the T-Shirts!
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 24th Feb 2019 00:56 Edited at: 24th Feb 2019 01:01
Amens absolutely right, you very rarely hear the bullet actually hitting the object unless it's a ricochet, or sniper missing you from a distance with a silencer (i still remember the day i went up against 1 para on a field exercise at yardley chase and managed to take down their sniper without a chot fired, silly bugger took his eye away from the night sight without closing it first, was able to track him down by the little green light reflection off his eye lol ), although he is exaggerating a little bit about the deafness, unless you're stupid and do it too often it's only a few seconds of ringing in the ears, at least it is for the SLR, spent many a session on the range with .303's, SLR's, and SA80's, got my marksman and range officer certification at bassingbourn barracks (little known fact, bassingbourn was where the first part of full metal jacket was filmed, that wasn't even an american barracks lol), even spent a whole day firing a Bren non-stop to get rid of ammunition when we were decommissioning them, did you know if you don't use short bursts with a Bren the barrel literally melts? Great fun lol

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Feb 2019 01:12 Edited at: 24th Feb 2019 01:14
303's, my god someone older than me!

Played with an SA80 once, just before I joined civvy street, felt like a bloody toy gun to use.
I know the numbers say it's an effective weapon but it just didn't feel like one to me. My brother was on the team that evaluated it for operational use and he said that after 2 days of simulated combat none of the weapons they had been issued with were still in one piece, he assumed they would scrap the idea but no, it became standard issue!
All I know is if push comes to shove and you've run out of ammo I'd much prefer an SLR as a club than an SA80!
Been there, done that, got all the T-Shirts!
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 24th Feb 2019 10:46 Edited at: 24th Feb 2019 10:48
Totally agree, slr's were like the AK's of the brittish army, worked well and lasted forever. They had to completely redesign the working parts of the SA80 after Afghanistan, turned out they were constantly jamming up because of the sand lol

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 2nd Mar 2019 22:03
Seems like the shake effect must be directly linked with the "bullet reduce players health" function, from a weapon script maybe?Or either a enemy script?
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 31st Jul 2020 23:46 Edited at: 31st Jul 2020 23:49
osiem80; I noticed you need a camera shake script.
Was in the process of starting one, but when I went
to save it, there was already one in the folder!

smallg has already supplied a camera shake script;

Edit-- just saw you already have it. Good work!
PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 3rd Aug 2020 19:20
the problem is, i wanna to shake the camera if the player get hit, i dont know which script contains this information
PM

Login to post a reply

Server time is: 2024-12-22 03:26:55
Your offset time is: 2024-12-22 03:26:55