Scripts / Cut Scenes with lua?

Author
Message
gd
7
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 27th Oct 2016 20:47 Edited at: 15th Nov 2016 12:49
Hi guys, I know this is already in the voting board but very low on the list to see it in the near future.

The idea would be to get someone good at lua scripting to write a simple script that can be modified and updated for your map cut scene. Then just record with your screen capture app.

I'm sure this can be done, but I don't know lua that well to do it myself. This would beat using F9 and falling to your death while rotating your character.

How I would see it working is to set up all the variables like:

Starting point - x,y,z
Finishing point - x,y,z
Waypoints - x,y,z - WP1, WP2, WP3, etc
Speed - Speed between WP's and default speed
Screen zoom - if needed
Rotation - Maybe a few of these
etc.

Now all you need is the player following the waypoint.

What do you guys think?
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3

A new competition running for GG
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th Nov 2016 20:12
Working on it.

Going to adapt my platform script to move the player around instead, the only problem might be that the FreezeAngle command only allows 1 degree of resolution so it might be a bit jerky panning and tilting .

What you could do is record dolly sequences and fade between them or apply motion blur to the turns to hide the jerkiness (or Lee could just fix it like I keep asking him to do ).

I'll post back when I have something for you to try out.
Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 4th Nov 2016 22:55
https://vimeo.com/190320881

So as I expected, rotations are jerky, but is this the sort of thing you had in mind?
Been there, done that, got all the T-Shirts!
PM
gd
7
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 5th Nov 2016 07:34 Edited at: 15th Nov 2016 12:49
Hi AmenMoses, just seen your clip. I see what you mean with the jerking. I hope Lee can get this sorted soon. Maybe this would be a first stage to it being part of a GG interface or a fly through in editor mode to make thing smother.

I glad someone is taking up the challenge... I hope to see more soon.

Great work
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3

A new competition running for GG
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th Nov 2016 11:04
https://vimeo.com/190428928

I attached the lua script to a basket near the start point in the big escape fpm (replacing the radar script iow).

After starting the level and pressing E to get rid of the intro screen press Shift+C to trigger the script.

The first line of the script is the camera sequence list, this contains a series of strings describing the movements:

x<num> move <num> units in x direction
y<num> ditto for y
z<num> ditto for z
t<num> tilt camera
p<num> pan camera
s<num> sets speed of movement (actually specifies how long each subsequent movement entry takes to execute)
Any values less that 200 are assumed to be seconds, otherwise the value is milliseconds.
Setting to 0 means the movements occur straight away.
f<num> set fov to num, valid values are 0-50
w<num> pauses for the specified amount of time
h - halts (Shift-C to continue with next part of sequence)

so for example the one I've included contains:
"h" - halt, just waits until Shift-C pressed
"s0;y500" - instantly move up 500 units
"s5;x-1000;z-600;y-200" - in the next 5 seconds move -1000 in x direction and -600 in z and -200 in y
"x-1300;y-50" - in the next 5 seconds move -1300 in x and -50 in y
"s0;p-40;t10" - instantly pan camera 40 degrees left and 10 degrees down
"s3;x-800;z500;y250" - in the next 3 seconds move -800 in x and 500 in z and 250 in y
"w5" - pause for 5 seconds
"h" - halt (i.e. goes back to player)

Yo can add as many sequences as you like, each press of Shift-C will start the next sequence in line.

You can have up to 5 movement commands in each string, so for example "x100;z100;y100;p50;t20".

panning and tilting is jerky due to a bug in the engine, fov changes are jerky due to it being an integer value but if you set the speed high (i.e. 500 ms) then it appears a lot smoother.

The initial x,y,z position is set by the location of the entity you attach the script to, the initial camera pan and tilt values are set in the script as is the default speed.

Note that when the script returns control to the player you won't have a weapon, just press a number key to re-select the weapon as I couldn't figure out how to do it from Lua.

Remember if you set the speed to 0 (for example to change camera angles) that you need to set it back to some sensible value for the next movement sequence!


Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
cybernescence
GameGuru Master
11
Years of Service
User Offline
Joined: 28th Jan 2013
Playing: Cogwheel Chronicles
Posted: 6th Nov 2016 14:45
TransportToIfUsed would probably give you smooth pan capability until/if SetFreeze issue fixed. It used to work anyway for 'y' angle

If it's necessary to reapply weapon you can use something like lastWeapon = g_PlayerGunName, then ChangePlayerWeapon(lastWeapon) to reapply.


Cheers.


AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th Nov 2016 15:17
How does TransportToIfUsed work? Does is transport the player to an entities position and set the player position and angles to the same as the entity? I've not used that command before.

Is so then I could have an invisible entity which I manoeuvre around in 3d and just keep transporting the player to it.

Been there, done that, got all the T-Shirts!
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th Nov 2016 16:18
I've use "TransportToIfUsed" here: https://forum.game-guru.com/thread/215251#msg2548533

With a bit of modifications to fit my needs, but bassicaly is something like this:



Assuming you want to going from point A thru point B, so in point A properties "If Used" field = point B

hth

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

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 6th Nov 2016 19:17
Yep, that worked better than I thought!

https://vimeo.com/190462445

So in order to use this one you set the 'If Used' field to the name of the Entity.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
gd
7
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 8th Nov 2016 13:31 Edited at: 15th Nov 2016 12:50
Hi AmenMoses and all, this is so cool. I can see everybody's cut scenes looking so much better using this. It's a shame there is not an option in GG test level to make these cut scenes... maybe some time in the future.

Ctrl-Tab to enter cut scene mode in GG
Then you can record your sequence like in F9 mode, using fly mode then Shift-Tab to edit the fine tuning with speed, rotation, zoom, height, etc.
Next you can add the next sequence. Five would be good with a really easy GUI to use.

I can only hope but for now I will settle for AI's able to follow you up and down stairs lol

Thanks again.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3

A new competition running for GG
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 8th Nov 2016 19:25
Create a lua script that just prints out the location of the entity it is attached to, move the entity to where you want the camera to be and write down the values. Do this for each point along the path then just do some simple maths to work out the movement sequence in terms of x,y,z. Plug the values into the script and bobs your mums 'friend'.

Fine tuning just consists of adding speed, pan and tilt commands.

Personally I find the editor to be a right pain to use, can never seem to get anything to sit where I want it to be, I would prefer to be able to specify exact coordinates which is why I create so many scripts to locate things in real time (e.g. flames on candles and torches, walls and doors on lifts etc).
Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-04-30 18:39:17
Your offset time is: 2024-04-30 18:39:17