benjamin94 Posted February 13, 2016 Share Posted February 13, 2016 (edited) Hey guys, Im working on an offline 2 player mod. Where player 1 will just use mouse and keyboard like normal. Then when the mod is loaded there will be spawned a new random ped. Which can be controlled with an USB gamepad. I currently have the following features for player 2: Walking around Entering/exiting vehicles Controlling vehicles More to come! Mod: https://www.gta5-mods.com/scripts/twoplayermod-net Sick video : Source code: https://github.com/BenjaminFaal/TwoPlayerMod Please tell me what i should add or change! Edited February 25, 2016 by benjamin94 The BHD, Vulcade92 and Dock 3 Link to comment Share on other sites More sharing options...
InfamousSabre Posted February 13, 2016 Share Posted February 13, 2016 (edited) Are you doing split-screen, or single camera that zooms in and out keeping both players in the frame? If the former: How are you doing split-screen? If the latter: Controls for both players will need to be changed. How do you plan to accomplish this? With one player driving, and one player doing a drive-by, you'll have to limit the angle the drive-by player can aim so that the drive-by player doesn't aim at something outside the camera view and so that the direction the driving player is driving is never out of the view. Edited February 13, 2016 by InfamousSabre Link to comment Share on other sites More sharing options...
benjamin94 Posted February 13, 2016 Author Share Posted February 13, 2016 (edited) Are you doing split-screen, or single camera that zooms in and out keeping both players in the frame? If the former: How are you doing split-screen? If the latter: Controls for both players will need to be changed. How do you plan to accomplish this? With one player driving, and one player doing a drive-by, you'll have to limit the angle the drive-by player can aim so that the drive-by player doesn't aim at something outside the camera view and so that the direction the driving player is driving is never out of the view. Currently im doing nothing special camera wise, but i think its almost impossible to have split screen. That would be very nice though. Edited February 13, 2016 by benjamin94 Link to comment Share on other sites More sharing options...
jedijosh920 Posted February 13, 2016 Share Posted February 13, 2016 You can render a camera and display on screen. Link to comment Share on other sites More sharing options...
benjamin94 Posted February 13, 2016 Author Share Posted February 13, 2016 You can render a camera and display on screen. I know but also 2 at once? One for the player and one for the second player? Link to comment Share on other sites More sharing options...
jedijosh920 Posted February 13, 2016 Share Posted February 13, 2016 Yeah it's like drawing a rectangle on the screen lol. Link to comment Share on other sites More sharing options...
benjamin94 Posted February 14, 2016 Author Share Posted February 14, 2016 Yeah it's like drawing a rectangle on the screen lol. Im sorry, can you explain a bit more? Link to comment Share on other sites More sharing options...
benjamin94 Posted February 17, 2016 Author Share Posted February 17, 2016 I will upload the first test version tomorrow morning! Link to comment Share on other sites More sharing options...
InfamousSabre Posted February 18, 2016 Share Posted February 18, 2016 I will upload the first test version tomorrow morning! Upload a video of it being played as well. I'd like to see what you've got so far. Link to comment Share on other sites More sharing options...
benjamin94 Posted February 18, 2016 Author Share Posted February 18, 2016 I will upload the first test version tomorrow morning! Upload a video of it being played as well. I'd like to see what you've got so far.Here is the mod (pending approval): https://www.gta5-mods.com/scripts/twoplayermod-net And the video is here: Link to comment Share on other sites More sharing options...
benjamin94 Posted February 18, 2016 Author Share Posted February 18, 2016 (edited) Project is now fully open source: https://github.com/BenjaminFaal/TwoPlayerMod I dont have much time to maintain but i will let others make pull requests and then i can upload newer versions! Edited February 18, 2016 by benjamin94 ikt, SaucyPow3r and cp1dell 3 Link to comment Share on other sites More sharing options...
cp1dell Posted February 18, 2016 Share Posted February 18, 2016 Project is now fully open source You're a good guy. Kafonix 1 Link to comment Share on other sites More sharing options...
InfamousSabre Posted February 19, 2016 Share Posted February 19, 2016 Looks like you got steering to work? Yeah I'd actually like to help with this. I'm always wanting to play with friends, and I don't like online games. Link to comment Share on other sites More sharing options...
benjamin94 Posted February 19, 2016 Author Share Posted February 19, 2016 Looks like you got steering to work? Yeah I'd actually like to help with this. I'm always wanting to play with friends, and I don't like online games. Yeah man, take a look at the source code there is much room for improvement. Link to comment Share on other sites More sharing options...
LS Savage Posted February 19, 2016 Share Posted February 19, 2016 (edited) Very nice work, always wanted something like this , probably the first of its kind for gta v Yeah it's like drawing a rectangle on the screen lol. Would it be possible to resize the main game camera so the new one doesn't overlap? Edited February 19, 2016 by LS Savage Link to comment Share on other sites More sharing options...
InfamousSabre Posted February 19, 2016 Share Posted February 19, 2016 Looks like you got steering to work? Yeah I'd actually like to help with this. I'm always wanting to play with friends, and I don't like online games. Yeah man, take a look at the source code there is much room for improvement. Just checked an I see you're using C#. Not much I can help with there I'm afraid. I might try this in C++ at some point. If I find anything of use, I'll be sure to share. For now, I'd try making Player2 an actual Player instead of just a Ped and go from there. Might help a bit. Link to comment Share on other sites More sharing options...
benjamin94 Posted February 19, 2016 Author Share Posted February 19, 2016 Looks like you got steering to work? Yeah I'd actually like to help with this. I'm always wanting to play with friends, and I don't like online games. Yeah man, take a look at the source code there is much room for improvement. Just checked an I see you're using C#. Not much I can help with there I'm afraid. I might try this in C++ at some point. If I find anything of use, I'll be sure to share. For now, I'd try making Player2 an actual Player instead of just a Ped and go from there. Might help a bit. I understand what you mean and i tried it already but its not working, there is almost no way to 'add' that player to the game. Unless ofcourse you know something? Link to comment Share on other sites More sharing options...
InfamousSabre Posted February 19, 2016 Share Posted February 19, 2016 Looks like you got steering to work? Yeah I'd actually like to help with this. I'm always wanting to play with friends, and I don't like online games. Yeah man, take a look at the source code there is much room for improvement. Just checked an I see you're using C#. Not much I can help with there I'm afraid. I might try this in C++ at some point. If I find anything of use, I'll be sure to share. For now, I'd try making Player2 an actual Player instead of just a Ped and go from there. Might help a bit. I understand what you mean and i tried it already but its not working, there is almost no way to 'add' that player to the game. Unless ofcourse you know something? I don't know how you'd create a new Player. I was just thinking along the lines of Vehicles probably would work properly only if they had a Player in the driver's seat. Really not sure. Link to comment Share on other sites More sharing options...
benjamin94 Posted February 19, 2016 Author Share Posted February 19, 2016 Looks like you got steering to work? Yeah I'd actually like to help with this. I'm always wanting to play with friends, and I don't like online games. Yeah man, take a look at the source code there is much room for improvement. Just checked an I see you're using C#. Not much I can help with there I'm afraid. I might try this in C++ at some point. If I find anything of use, I'll be sure to share. For now, I'd try making Player2 an actual Player instead of just a Ped and go from there. Might help a bit. I understand what you mean and i tried it already but its not working, there is almost no way to 'add' that player to the game. Unless ofcourse you know something? I don't know how you'd create a new Player. I was just thinking along the lines of Vehicles probably would work properly only if they had a Player in the driver's seat. Really not sure. Unfortunately its not that simple, i think it requires some sort of native but to find that it would be really hard. Link to comment Share on other sites More sharing options...
ikt Posted February 19, 2016 Share Posted February 19, 2016 I think you could directly control a vehicle if you knew how to access their properties properly? What about spawning a vehicle, getting its' properties that matter and are exclusively related to user input (throttle, brake, steering) and let the script change those values? You'd spawn the vehicle, look at it's data when you do something, then spawn a driving bodyguard and see what a ped does (what instructions/functions write to these properties), and then to figure out how to pass user controls through to a non-player controlled vehicle. This way doesn't use many natives though, and it's a bit low level. You'd need to extract the MemoryAccess class, modify it and re-include it again in your .net script (or make it a library) and from there access the vehicle's memory structure. Link to comment Share on other sites More sharing options...
benjamin94 Posted February 19, 2016 Author Share Posted February 19, 2016 I think you could directly control a vehicle if you knew how to access their properties properly? What about spawning a vehicle, getting its' properties that matter and are exclusively related to user input (throttle, brake, steering) and let the script change those values? You'd spawn the vehicle, look at it's data when you do something, then spawn a driving bodyguard and see what a ped does (what instructions/functions write to these properties), and then to figure out how to pass user controls through to a non-player controlled vehicle. This way doesn't use many natives though, and it's a bit low level. You'd need to extract the MemoryAccess class, modify it and re-include it again in your .net script (or make it a library) and from there access the vehicle's memory structure. I understand your point but I don't have time to do all this. It seems you know quite much about it so I challenge you to do it if you want. The code is open source on github.com so. Link to comment Share on other sites More sharing options...
elsewhat Posted February 25, 2016 Share Posted February 25, 2016 Very interesting mod. Wasn't aware of the TASK_VEHICLE_TEMP_ACTION native you are using http://www.dev-c.com/nativedb/func/info/c429dceeb339e129 As part of the scene director mod I have implemented recording of actions which can then later be replayed. C++ source is available at https://github.com/elsewhat/gtav-mod-scene-directorand may be relevant here. When attempting to use the natives to replay actions you quickly run into limitations that can be hard to get workarounds for. So I agree with ikt suggestion that the best approach is to not use the natives for such a mod (but have not dwelved into the memory access area myself) Link to comment Share on other sites More sharing options...
benjamin94 Posted February 25, 2016 Author Share Posted February 25, 2016 Very interesting mod. Wasn't aware of the TASK_VEHICLE_TEMP_ACTION native you are using http://www.dev-c.com/nativedb/func/info/c429dceeb339e129 As part of the scene director mod I have implemented recording of actions which can then later be replayed. C++ source is available at https://github.com/elsewhat/gtav-mod-scene-directorand may be relevant here. When attempting to use the natives to replay actions you quickly run into limitations that can be hard to get workarounds for. So I agree with ikt suggestion that the best approach is to not use the natives for such a mod (but have not dwelved into the memory access area myself) I agree with the spamming native calls, therefore i added an instance variable which stores the latest vehicle action and checks if it differs in the current tick it will call the native otherwise it wont do anything. Link to comment Share on other sites More sharing options...
Jackoozy Posted March 24, 2016 Share Posted March 24, 2016 Yeah it's like drawing a rectangle on the screen lol. Im sorry, can you explain a bit more? This is something I'm really curious about also. The possibility of a split-screen experience is very exciting. Apologies for the bump. Link to comment Share on other sites More sharing options...
RonnyConny Posted May 26, 2016 Share Posted May 26, 2016 (edited) Got split-screen to work but the controls are f*cked up Edited May 26, 2016 by RonnyConny ffzero58 1 Link to comment Share on other sites More sharing options...
ffzero58 Posted May 27, 2016 Share Posted May 27, 2016 Got split-screen to work but the controls are f*cked up This would be a huge boon to the co-op crowd. Even for movie makers. A car chase for the ages. Thanks for the hard work put in so far. Link to comment Share on other sites More sharing options...
nkjellman Posted May 28, 2016 Share Posted May 28, 2016 Got split-screen to work but the controls are f*cked up I assume that the players can't get to far from each other ether, otherwise the map will start reducing in quality and collisions will disappear for the second player. Am I right? Link to comment Share on other sites More sharing options...
RonnyConny Posted May 31, 2016 Share Posted May 31, 2016 I have it running on two 50 inch LCD TV's. Player one that uses keyboard and mouse works perfect until the player on xbox controller mess it up by controlling them both with the xbox controller. Here is what i did: Made a copy of playGTAV.exe (name it whatever). Started one of the playGTAV.exe. Make sure auto sign-in is enabled and remember me. Disconnect from internet or block gta in the firewall. Start second playGTAV.exe in offline mode. Disable pause game when alt-tabbed (Settings). Change player name in the GTACOOPSettings.xml. Start the server.exe mod-file. Hit f9 and enter localhost under ip in both games and connect. Only problem is that my wireless xbox 360 controller controls both of the games. To solve that tried a cheap solution by using keysticks. I configured new keyboard keybindings in the non keyboard GTA game and configured the new keys in keysticks. It worked until I unfocused that game to control the other game with keyboard and mouse. How do I solve this? if only rockstar patched the game so gamepads can be disabled in game it would work flawless.. any other way around? injector? Link to comment Share on other sites More sharing options...
RonnyConny Posted May 31, 2016 Share Posted May 31, 2016 I stole the idea from Split Play. Smol_OG 1 Link to comment Share on other sites More sharing options...
Ghostt Posted December 11, 2016 Share Posted December 11, 2016 Please update. This mod was great but no longer works. Really wanna play this with friends Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now