Log in to reply
 

[SCRIPT] [RELEASED] On-Foot Cinematic Cam



  • @turtlevan said in [SCRIPT] [RELEASED] On-Foot Cinematic Cam:

    @LeeC2202 Looking forward to the on-foot update. sohcahtoa. This mod seems to require a lot of skills & effort...

    I thought it could be as simple as just assigning the vehicle cinematic camera to the player... lol. wish i knew how to create thesethings

    It could be that simple... I just couldn't work out how to do that, so I took this option. I tried creating cinematic cameras, I tried turning cinematic mode on, but the game refused to do anything unless you were in a vehicle... but I could have been doing it wrong. I'm pretty sure that there's someone out there, sat laughing at my posts thinking "Hmmm, this native, that native, this bit of code... done!".

    One thing I am wondering though, is if I turn on the cinematic mode flag when I am on foot, if you climb into a vehicle, you should continue in vehicle cinematic mode and then when you exit, go straight back into on-foot cinematic mode. Or that's my theory anyway.

    This is my first time modding GTA, so there is just so much I don't know, whereas those who have been modding since GTA:SA or whenever, already know the tricks of the trade so to speak. My alternative to doing this, is to sit staring at walls for X hours per day getting bored, so I'll take the brief moments of interest when they come. And if other people get some benefit out of that, then that's all the better.



  • Staring at code to deal with angles & vectors and my brain is throwing a tootiredtoreadtrigonometry exception. Early night I think, start again tomorrow... so much for releasing that new version today. :(

    Trigonometry is my major Achilles heel, no matter how many times I read it, no matter how many times I write it, next time I do it, I will have forgotten it all completely... and you know what they say about old dogs and tricks. woof!



  • Really starting to get frustrated with this now... chasing crashes where there shouldn't be any and fighting with nonsense rotation values. :angry:

    I fixed the fallen over bike problem last night, so I might upload that version as it's a really unpleasant glitch.



  • Just a small update to let people know that this project is still alive. Personal issues have added to the woes this week, so it's been a zero progress week... well, apart from me having to write a debug window and log system to try and keep track of where things are falling over. Bit of a pain on that one that the UIText.Caption is limited to what appears to be 99 characters. Then again, I can't imagine them ever believing it was going to be used how I wanted to use it... but at least I have a better way of seeing exactly what's going on, rather than having to rely on UI.Notify calls to display debug info.

    It would be nice to have a version free of that limitation but I have to be careful as I already use a custom NativeUI.

    More updates as and when they happen, but this is still alive.



  • Good lord.. what a day. Get things working... check! Make a small change that breaks it all... check! Spend ages trying to work out which part of the changes break it all... check! Forget what all those changes were... check. :blush:

    Fix it all again... check! Talk about walking to the brink of throwing the towel in... jeez!!

    Anyway, the end result of all that is that V2.0 is almost done and just to give you an idea of what it all now looks like, here's a taster.

    Some things I will explain.

    To maintain control consistency, the camera is always attached to a probe that is circling the player. I have created a variety of orbit types to try and keep things as varied as possible. The camera will never just be dropped in a position... that's just how this system works.

    Combat is difficult to initiate because the game wants to look for someone in the direction the camera is facing... so expect some missed punches in this view.

    The system requires two keys to function... one to turn the whole system on and off and a second to turn the walking cam on and off.

    Because of the nature of where you can walk, it is very possible to get into a situation where the camera just cannot find a free probe... in this instance, the system will deactivate. The reason for this is when you are in a tight space, it can easily get very confusing as the probes are switching, to know which way you're facing. Dropping back to normal view just gives you chance to reorient yourself.

    Because of how close you tend to walk near things, compared to being in a car, the camera will switch far more often than the vehicle cinematic mode. It doesn't change when blocked by Peds or vegetation and things like chain-link fences don't cause a switch either. I have done this to try and cut down camera changes in the city.

    The camera will switch as a probe gets blocked. If you are in a clear area, it will switch every 3 seconds automatically. You can also see from the video that when both systems are on, it cuts seamlessly between walking and vehicle/melee cameras.

    At this point in time, the vehicle and melee cams are not using the probe system to find a camera position. Now the walking cam is working, I will work on moving those two to use the new system.

    You will also note that the hud doesn't get switched off when walking. I found it just gives you a better sense of direction when you can see the map.



  • Oh, but just to throw a spanner in the works, I have found a car that seems to simply teleport you into the car when you try and enter it. I haven't seen hat before and I have no idea why it does it. It's just round the corner from Trevor's desert house, under a carport.

    It's like when you drive into a garage and the game gets you out of the car without you having to press anything... small things that cause big problems.



  • Hmmm, I sense a trend forming towards a familiar situation, I'd better get this finished quickly before it blows up completely. The perils of spending your life involved with computers and game development is a desire to help and advise... but it can get bite you on the ass if you're not careful. So I'll stick to making comments only in this thread, before I cause more trouble. :(

    I've got an issue to fix with you swimming in the water and then I will release this so that people can have a play with it and offer some feedback... if there's still anyone out there of course... you might have all got fed up of waiting for an update by now.

    I did have another idea for an alternate probe type this morning and a way of implementing it, which means an expansion beyond the basic "orbits the player" type cameras... we shall see how far that gets.



  • Okay, so version 2.0 is now waiting for approval, change notes in the description... I hope it provokes more discussion on where it could be improved etc... I still have a lot planned for this, so this is by no means the end of the road. I just wanted to get this into people's hands so that they could have a play with it.



  • One day and already having to upload a new version to fix a MASSIVE bug... not good, damn this headache. :(

    The bug appeared when you switched players and the camera would totally screw up. Switching now works as it should, although at this point in time, I have deactivated the on-foot camera when the switch takes place. This is mainly because you cannot tell where the new player will be in the world, so this just avoids any further screw ups.

    What you can also do, now I have handled that bit of code properly, is switch models with a trainer and use this camera. At the moment, it has to be done while the on-foot camera is off, so using the normal gameplay camera. I can probably fix that but my head is pounding and getting the bug fix out there was my primary goal. But it means that if you want to walk the streets as your favourite hooker, you can and you can do it in cinematic glory. :D

    This also opens another opportunity that I was playing with yesterday, that failed because of this bug... more on that as I work out if it is now possible or not.

    Hope these bugs aren't too inconvenient... I'm on them as quick as I can find them.



  • @LeeC2202 Awesome work man, all around. You really should take a moment to look at what you've done and don't sweat any hiccups too much, you've made amazing progress. I didn't think the cinematic camera could be pulled off all the time but as of 2.0 I stand corrected and am enjoying every second of gameplay using it! The cuts between passive angles versus action angles (like fistfights) is very fluent and non-jostling on both the keyboard and controller, plus the timing sometimes makes scenes almost look like scripted cutscenes!

    An issue I've spotted is if you manage to force the system to shut down by backing into a tight corner or whatever, you can't restart the script or anything until you refresh ScripthookDotNet entirely. I don't know if this was the intended purpose of the failsafe, but it's kinda a pain when you have a shitton of scripts to refresh each time. Again, at the end of the day it's only ten seconds or so of waiting, but idk, just pointing things out in case you aren't aware.

    I've taken some pictures of gameplay, note none of these have been touched besides by my ReShade, etc. All camera work was done by your mod:

    alt text
    alt text
    alt text
    alt text
    alt text
    alt text

    Bravo, sir, this is definitely one of the most unique scripts to come to GTA V, or a GTA game ever.



  • Oh yeah, the ability to manually change the camera angle cut like the original vehicle cinematic camera via flicking the right analog stick or moving the mouse would be dope as well. Also, shooting seems to be bugged when the system is active; do you think you could simply have it automatically disable so the normal aiming camera can fire, or is that not possible?



  • @Zippo-Raid Thank you for those comments, they are very much appreciated. I must confess, this has come a lot further than I thought I could get it and the further it gets, the more I believe is still possible. Now that I have some core systems in place, expanding them should open up more possibilities.

    One thing I am not overly happy about, is how something like a lamppost can trigger a change. What I'd like to do is to trip a timer that says "The view is blocked, but hang on for a second before we change, just to see if it's something thin blocking the view". I'm not sure how that will impact going behind walls and things, so I'll have to have a play with that. If I could find out what object was blocking the view, that might help, so I'll look into it.

    Backing into a corner is a real problem but it should clean itself up better than that. As I develop things in general, I tend to add the functionality, then go back and refine it. That problem is definitely one of the things to be cleaned up, so it is on my TODO list.

    I didn't know you could change the vehicle cinematic camera manually. I'll have another play with that and see how they have done it... shouldn't be too hard to do the same thing. The way the changes work are a timer is set for the chosen time period. Once that timer has run down, it triggers an event that says "I'm done, pick a new clear probe". All I have to do is set the timer to zero when you press a key/move the stick etc... and the next time it updates, it will trigger a change.

    Shooting is a problem until I look at detecting which weapon the player is using. I don't have any code to do that at the moment, so that's another set of natives I have to look into. I have a whole list of natives commented out at the bottom of my main class, that I think might be useful... they keep me on my toes. :D



  • @LeeC2202 Dunno if you have found this bug yet....when you get in the Valkyrie's turrent seat,the camera seems to be lasting too long.I remember you saying that the camera ends once the game detects the player in the vehicle or once the vehicle's engine starts?
    I'm not sure if there's the same problem for the Insurgent and the Technique's turrents though,better check ;)



  • @Elope The camera ends when the player is sat in the vehicle with the engine running. I hadn't realised there were vehicles with turrets you could sit in... do you actually drive it from those positions?



  • @LeeC2202 no you dont :P



  • @Elope I'm just booting up with my debug version so I can see what the game thinks you are doing in those vehicles.



  • @LeeC2202 maybe end the camera when you shoot a bullet from the turrents?that's okay for me :P



  • @Elope How do you get into the Valkyrie turret seat? When I entered the vehicle, I got in the pilot's seat.



  • @LeeC2202 by pressing the F longer,like how you get in a taxi



  • @Elope Okay, just tried that. It does register you as sitting in the vehicle, but it takes a long time before it does so... like seven seconds long and it doesn't start the engine. That means it waits the default length of 10 seconds before it switches. I had to set it longer to cater for some of the aircraft where you had to open the doors, drop the steps, walk the length of the aircraft etc...

    What kind of vehicles are the Insurgent and Technique, I can't find them in the Simple Trainer spawn list? Catering for them on a specific basis won't be a problem, although it means that any addon vehicles with turrets will suffer the same fate.



  • Doh... spawn by name... derp! :blush:



  • @LeeC2202 the insurgent and the technique is in the Offroad category I think
    By the way which name does it take in the ini file for addon vehicles?the vehicle's model and texture name?



  • @Elope Try this... this is just the dll file in a .7z file. I don't like doing this but I'll let you be the tester as a special treat. ;)

    https://drive.google.com/file/d/0B7LFvItVrwd0VG1iOXJwNF9hcUk/view?usp=sharing

    That has the Insurgent set to 5 seconds, Technical and Valkyrie set to 4 seconds and everything else left as it was.



  • @LeeC2202 Thx :) I'll notify you the result on my end



  • @LeeC2202 Hmmmm strangely it's still like 10 seconds for me ...Do I need to take out the ini file?...And from my count,I take it 3 seconds for valkyrie,4 seconds for technique and 8 seconds for the insurgent.Oh and there's actually 2 valkyries ingame,dont forget the other one ;) the model name is valkyrie2,it's actually a valkyrie without the front turrent which is explosive


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.