Scripts / Camera movement during animation

Author
Message
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 14th Aug 2020 13:21
Hi, how to make the camera move during weapon animations like in this video?
PM
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 14th Aug 2020 14:10
I doubt you can unless its included in the animations for the camera to move that way.
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Pirate Myke
Forum Support
13
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 14th Aug 2020 14:11 Edited at: 14th Aug 2020 14:12
This may be tough as you would have to script the camera action of the player to coincide with the weapons animation.

Not even sure if we have this kind of control.
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




osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 14th Aug 2020 14:27 Edited at: 14th Aug 2020 14:39
Hmm, there was a camera shake script from smallg, maybe i can synchronize that with the reload button?But all reload animations from every weapon would have the same camera movement, its possible to have the same button for reload and as a trigger for a script?There would be still the problem if the weapon runs out of ammo itself and no reload button is pressed
PM
Bored of the Rings
GameGuru Master
19
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 14th Aug 2020 14:40 Edited at: 14th Aug 2020 14:41
tricky one that, you could try checking which animation frame / set is currently being played (not sure if that can be done with the weapon system via any lua commands ) and then override the camera to get it to move in the appropriate way.
Professional Programmer: Languages- SAS (Statistical Analysis Software) , C++ VS2019, SQL, PL-SQL, JavaScript, HTML, Three.js, others
Hardware: ULTRA FAST Quad Core Gaming PC Tower WIFI & 16GB 1TB HDD & Win 10 (x64), Geforce GTX1060(3GB). Dell Mixed Reality VR headset, Aerodrums 3D
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 14th Aug 2020 15:00 Edited at: 14th Aug 2020 15:19
Quote: "you could try checking which animation frame / set is currently being played (not sure if that can be done with the weapon system via any lua commands ) and then override the camera to get it to move in the appropriate way."

i have no idea how to do that, can u show me?
Maybe i could somehow disable the self reloading of the weapons if they run out of ammo?
edit
i tried it, it looks terrible cuz i cant get the camera move smoothly to the side up and down

what i should edit here to make it good?
PM
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 14th Aug 2020 16:29 Edited at: 14th Aug 2020 16:51
Doesn't the camera move a little when reloading in GG? I rarely use it for FPS games, but seem to remember it doing so. Although in honesty, unless your game is finished and you are merely polishing it, I wouldn't worry about it ;p You will probably have bigger issues to fix first!

Oh but in answer to if it is possible. I imagine you could just rotate the camera a tiny amount in a set way when the reload state is triggered.
SPECS: Ryzen 1700 CPU. Nvidia 970GTX. 16 Gig Memory. Win 10.
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 14th Aug 2020 21:20 Edited at: 14th Aug 2020 21:22
@ osiem80.... mate you always point really high... it 's gameguru ...remember mate... i know you love battlefield.. but here it's only gameguru..


btw in unity i made animations like you posted even with camera shake during anim... and it was a breeze,,, but unity is another level and another freedom than gameguru

btw i agree with @DVader... too many other things needs to be ironed out in a GG game before you should worry about this LOL
PC 1 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB



PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
osiem80
5
Years of Service
User Offline
Joined: 24th Jan 2019
Location: Poland
Posted: 14th Aug 2020 21:25
I dont think its too hard, i am sure the proble is somewhere here
SetPosition(e,g_PlayerPosX,g_Entity[e]['y']-g_PlayerPosY+600,g_PlayerPosZ)
SetRotation(e,g_PlayerAngX-math.random(vertical_low,vertical_high),g_PlayerAngY+math.random(horizontal_low,horizontal_high),g_PlayerAngZ)
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 14th Aug 2020 22:19
Yeah, IDK- it might move, can't remember as I also don't put
weapons into my script testing...
Specific movement, like the kind you are looking for would
indeed be a challenge- if possible?
But for a generic movement--
It might take a couple minutes to write up that script--
should we do it in the scripts forum?
You would have to supply the trigger (see if reload is active)
since I have no idea about that.
BTW, just checked-- there is no camera movement on reload-
I checked the shotgun, sniper and magnum.

It's about 150 lines of code- no trigger checks.
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th Aug 2020 00:20
Bobble head script (aka generic camera)...
[[ It's just a framework to modify and use for your specific tasks ]]

I probably can't help make it do those //-animation specific uses-//
for example, but see what can be done with it.

Also- if you don't like my 'eccentric' scripting style-- well sorry!
I'm sticking with that style for the mean-time-- you can re-do it!

PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th Aug 2020 00:29

A> Originally I tried to make this work with SetCameraAngle(....)
so the player can keep moving while the camera moves- maybe?
Too many issues with the conflict of Qangles vs Eangles.

B> There's a spot left open for 'Z' movement- it's almost there,
just not activated. This might provide a little extra atmosphere,
if you want to use it- throw it in!
PM
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 15th Aug 2020 21:25
@GubbyBlips .. only for the sake of cusriosity... how this script should to be used?
PC 1 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB



PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th Aug 2020 22:09
Did you test it?
Press 'B' for turn camera bobbing on- in direction player is looking.
Press 'N' for turn it off.
The camera (aka player) will jostle around like for reload, etc.

You need to figure out how to customize it to your needs.
PM
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th Aug 2020 23:27 Edited at: 16th Aug 2020 00:03
**First of all, it might not be as useful with FreezePlayer as SetCameraAngle**
because that freezes the player (player slows up on reloading anyhow IDK?)
But other than that;
The easiest way to activate this for your level (reload weapon)
for example-- if you can ever find how weapon reload is set...
......... >>found a little effect<<.........
.........>>changed script<<.........
new trigger is // g_runcamerabob = 1 //

I found; SetGamePlayerStatePlrReloading(1)
in GamePlayerControl.lua

Now I have gotten camera to bob when 'R' is pressed, just can't find
out where auto reload is triggered...
Any ideas?

If anyone wants to locate the method that auto-reload is triggered,
might be in separate WeaponControl scripts? But then we could have
the full effect-- hats off to you.
PM

Login to post a reply

Server time is: 2024-04-25 06:39:38
Your offset time is: 2024-04-25 06:39:38