Quantcast

Jump to content

» «
Photo

[Q] [WIP] GTA IV Character Switcher

34 replies to this topic
Wheatley
  • Wheatley

    I'm living in High Pressure Days.

  • Members
  • Joined: 21 Aug 2010

#1

Posted 23 July 2013 - 05:39 PM

Hey there!

After seeing someone recreate the GTA V weapon HUD for GTA IV I thought I might take a gander at making the "Character Switch" mechanic for GTA IV since someones done it in San Andreas.

I haven't coded in a while so my C skills are not top-notch but I decided to do the "planning" in Pseudo-code:

1. Start
1.1 Set Player Model to Niko
1.1.1 Save Player Niko Location

1.2 Push Switch Button To Luis
1.2.1 Pull Camera down Y Axis
1.2.2 Move Camera Up X Axis
1.2.3 Move Camera Along Z Axis to Teleport location

1.3 Set Teleport location to random
1.3.1 Set Player Model to Luis

1.4 Save Player Luis Location
1.4.1 Push Button to Johnny
1.4.2 Pull Camera Down Y Axis
1.4.3 Move Camera Up X Axis
1.4.4 Move Camera Along Z Axis to Teleport location
1.5 Set Teleport location to random
1.5.1 Set Player model to Johnny

The way this works is that when players play as say Niko and push the Character Switch button, it will temporarily remove the player and save the location of where it is and move/teleport to a random spot, spawn Luis or Johnny and continue playing. When players switch back to Niko then it will remove the current model, move the camera upwards and along to the the saved location where Niko previously was.

I also want to see how if it's possible to make when you switch to characters they might teleport to Burger Shot and buy a burger or hailing a cab etc but if it's too hard then I might leave it.

Right now I'm taking a look at how the Simple Native Trainer works in switching models, teleporting and camera control. Should I pursue this and actually code this script? What do you think?




cp1dell
  • cp1dell

    Gangsta

  • Members
  • Joined: 04 Jul 2008

#2

Posted 24 July 2013 - 02:47 AM

I don't know much about the San Andreas version, but it doesn't make much sense. IV seems much more suitable for this considering it actually has three protagonists, albeit spread across three games. It's a very good idea. I'm not much of a coder, but I'm sure there has to be a way to load mission information - that way when switching characters their respectable missions will be available - or locked depending on what missions for other characters have been completed. But that's much more complicated, best to focus on the switching for now.

One thing I'm not sure about is how agility and handling is going to work. Handling for vehicles differs between IV and EFLC since the characters have different backgrounds. There is also the agility between them. For example, Niko runs much faster than Luis and Johnny. Johnny runs slow due to the bike accident he was in before the events of TLAD.

The different feel between the three protagonists is very big, and that's definitely something that should be achieved if you're going to be switching between them. I'm not 100% sure, but the agility might even be up to the engine, and how fast the running, climbing etc. animations are and Euphoria handles that. Regardless, they still need to feel different like they do between the three games. If not, it will just seem like this is some fancy script that teleports you and changes your skin. And you won't feel like you are actually [i]switching[i/] to another protagonist.

Wheatley
  • Wheatley

    I'm living in High Pressure Days.

  • Members
  • Joined: 21 Aug 2010

#3

Posted 24 July 2013 - 11:44 AM

QUOTE (cp1dell @ Wednesday, Jul 24 2013, 02:47)
I don't know much about the San Andreas version, but it doesn't make much sense. IV seems much more suitable for this considering it actually has three protagonists, albeit spread across three games. It's a very good idea. I'm not much of a coder, but I'm sure there has to be a way to load mission information - that way when switching characters their respectable missions will be available - or locked depending on what missions for other characters have been completed. But that's much more complicated, best to focus on the switching for now.

One thing I'm not sure about is how agility and handling is going to work. Handling for vehicles differs between IV and EFLC since the characters have different backgrounds. There is also the agility between them. For example, Niko runs much faster than Luis and Johnny. Johnny runs slow due to the bike accident he was in before the events of TLAD.

The different feel between the three protagonists is very big, and that's definitely something that should be achieved if you're going to be switching between them. I'm not 100% sure, but the agility might even be up to the engine, and how fast the running, climbing etc. animations are and Euphoria handles that. Regardless, they still need to feel different like they do between the three games. If not, it will just seem like this is some fancy script that teleports you and changes your skin. And you won't feel like you are actually [i]switching[i/] to another protagonist.

I want to walk before I run so that means it will probably start out as a skin switcher at first but evolve to what you have said where animations would change, handling and voices too. That would take a long time and bug fixing due to how advance that would be, multiple things are being changed at once. This is also a major problem: optimization.





nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008

#4

Posted 24 July 2013 - 02:56 PM

nice idea! and who has made that weapon hud thing? where is it?

heres how i would do the char switch:

when keycombo is pressed, switch to custom cam which smoothly pans up in the air, in a wide bow down to the location the other player should be, while rotating the cam downward while flying up, and rotating it to the game cam pos again when going down.
maybe add some cool effect to the switch cam, like black&white etc, and some DoScreenFadeIn(50);
the location of the other player should be pretty random the first time you switch. but the script should remember the position of the player you switched from, and depending on how much time has passed, set the location at a logical random distance from where it was when the switch happened.
the simplest way to do the model thing, is just teleporting , disabling player control, using SetCharModel, then maybe some setcharstyle or something like that.

when all that is done, it can always be expanded with saving the specific weapons the players have, the health, money, wanted, etc.

looking forwards to more V features in IV!

Th3MaN1
  • Th3MaN1

    Gangsta

  • Members
  • Joined: 24 Apr 2011
  • Romania

#5

Posted 24 July 2013 - 03:29 PM

Sorry for the off-topic, but I just wanna ask, who makes a SA version of the character switch? A link would be much appreciated in a PM, thanks smile.gif.

Also, I dunno how this will work out, but if it's possible, then good luck with it!

Wheatley
  • Wheatley

    I'm living in High Pressure Days.

  • Members
  • Joined: 21 Aug 2010

#6

Posted 24 July 2013 - 05:04 PM

QUOTE (Th3MaN1 @ Wednesday, Jul 24 2013, 15:29)
Sorry for the off-topic, but I just wanna ask, who makes a SA version of the character switch? A link would be much appreciated in a PM, thanks smile.gif.

Also, I dunno how this will work out, but if it's possible, then good luck with it!

Here it is:




It works just like the V version.


cp1dell
  • cp1dell

    Gangsta

  • Members
  • Joined: 04 Jul 2008

#7

Posted 24 July 2013 - 05:53 PM

QUOTE (Wheatley @ Wednesday, Jul 24 2013, 11:44)
QUOTE (cp1dell @ Wednesday, Jul 24 2013, 02:47)
I don't know much about the San Andreas version, but it doesn't make much sense. IV seems much more suitable for this considering it actually has three protagonists, albeit spread across three games. It's a very good idea. I'm not much of a coder, but I'm sure there has to be a way to load mission information - that way when switching characters their respectable missions will be available - or locked depending on what missions for other characters have been completed. But that's much more complicated, best to focus on the switching for now.

One thing I'm not sure about is how agility and handling is going to work. Handling for vehicles differs between IV and EFLC since the characters have different backgrounds. There is also the agility between them. For example, Niko runs much faster than Luis and Johnny. Johnny runs slow due to the bike accident he was in before the events of TLAD.

The different feel between the three protagonists is very big, and that's definitely something that should be achieved if you're going to be switching between them. I'm not 100% sure, but the agility might even be up to the engine, and how fast the running, climbing etc. animations are and Euphoria handles that. Regardless, they still need to feel different like they do between the three games. If not, it will just seem like this is some fancy script that teleports you and changes your skin. And you won't feel like you are actually [i]switching[i/] to another protagonist.

I want to walk before I run so that means it will probably start out as a skin switcher at first but evolve to what you have said where animations would change, handling and voices too. That would take a long time and bug fixing due to how advance that would be, multiple things are being changed at once. This is also a major problem: optimization.

Well from what I've seen, changing the voice isn't that difficult. It's just a simple call of a native function. Though I've had issues with getting the pain voice working.

So is this going to be for the standalone version of EFLC? In my opinion it would be much better that way, since EFLC contains Niko's resources such as animations, voice, textures etc. That way for IV you don't have to package huge voice, animimation, texture, and model files for Johnny and Luis. With this being just for EFLC, it can just be a script.

Wheatley
  • Wheatley

    I'm living in High Pressure Days.

  • Members
  • Joined: 21 Aug 2010

#8

Posted 24 July 2013 - 07:15 PM

QUOTE (cp1dell @ Wednesday, Jul 24 2013, 17:53)
QUOTE (Wheatley @ Wednesday, Jul 24 2013, 11:44)
QUOTE (cp1dell @ Wednesday, Jul 24 2013, 02:47)
I don't know much about the San Andreas version, but it doesn't make much sense. IV seems much more suitable for this considering it actually has three protagonists, albeit spread across three games. It's a very good idea. I'm not much of a coder, but I'm sure there has to be a way to load mission information - that way when switching characters their respectable missions will be available - or locked depending on what missions for other characters have been completed. But that's much more complicated, best to focus on the switching for now.

One thing I'm not sure about is how agility and handling is going to work. Handling for vehicles differs between IV and EFLC since the characters have different backgrounds. There is also the agility between them. For example, Niko runs much faster than Luis and Johnny. Johnny runs slow due to the bike accident he was in before the events of TLAD.

The different feel between the three protagonists is very big, and that's definitely something that should be achieved if you're going to be switching between them. I'm not 100% sure, but the agility might even be up to the engine, and how fast the running, climbing etc. animations are and Euphoria handles that. Regardless, they still need to feel different like they do between the three games. If not, it will just seem like this is some fancy script that teleports you and changes your skin. And you won't feel like you are actually [i]switching[i/] to another protagonist.

I want to walk before I run so that means it will probably start out as a skin switcher at first but evolve to what you have said where animations would change, handling and voices too. That would take a long time and bug fixing due to how advance that would be, multiple things are being changed at once. This is also a major problem: optimization.

Well from what I've seen, changing the voice isn't that difficult. It's just a simple call of a native function. Though I've had issues with getting the pain voice working.

So is this going to be for the standalone version of EFLC? In my opinion it would be much better that way, since EFLC contains Niko's resources such as animations, voice, textures etc. That way for IV you don't have to package huge voice, animimation, texture, and model files for Johnny and Luis. With this being just for EFLC, it can just be a script.

The problem is that I don't own EFLC, only Grand Theft Auto IV. If I start making a simple skin switcher that moves the camera to a designated spot then that will allow others to step in and make it work for EFLC fully.


cp1dell
  • cp1dell

    Gangsta

  • Members
  • Joined: 04 Jul 2008

#9

Posted 24 July 2013 - 09:17 PM

QUOTE (Wheatley @ Wednesday, Jul 24 2013, 19:15)
The problem is that I don't own EFLC, only Grand Theft Auto IV. If I start making a simple skin switcher that moves the camera to a designated spot then that will allow others to step in and make it work for EFLC fully.

Ah alright.

DRUZZRIN12296
  • DRUZZRIN12296

    Part of the GTA V:IV modding team

  • Members
  • Joined: 04 Aug 2009

#10

Posted 24 July 2013 - 09:21 PM

I fortunately own all three sp I could be that guy smile.gif

hardsty1e
  • hardsty1e

    Snitch

  • Members
  • Joined: 02 May 2009

#11

Posted 24 July 2013 - 11:03 PM Edited by hardsty1e, 24 July 2013 - 11:11 PM.

QUOTE (nixolas1 @ Wednesday, Jul 24 2013, 14:56)
nice idea! and who has made that weapon hud thing? where is it?

heres how i would do the char switch:

when keycombo is pressed, switch to custom cam which smoothly pans up in the air, in a wide bow down to the location the other player should be, while rotating the cam downward while flying up, and rotating it to the game cam pos again when going down.
maybe add some cool effect to the switch cam, like black&white etc, and some DoScreenFadeIn(50);
the location of the other player should be pretty random the first time you switch. but the script should remember the position of the player you switched from, and depending on how much time has passed, set the location at a logical random distance from where it was when the switch happened.
the simplest way to do the model thing, is just teleporting , disabling player control, using SetCharModel, then maybe some setcharstyle or something like that.

when all that is done, it can always be expanded with saving the specific weapons the players have, the health, money, wanted, etc.

looking forwards to more V features in IV!

the weapon hud script - http://www.gta4-mods...a-4-0905-f22972

I found a video demo of character switching in gtaiv that looks really impressive

GTA V character switch system in GTA IV singleplayer, even shows a free mode version


GTA V systems:character switch in free mode


and if you want to set screen effect :
"SET_TIMECYCLE_MODIFIER"

to clear effect :
"CLEAR_TIMECYCLE_MODIFIER"


Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#12

Posted 25 July 2013 - 09:11 AM

Lol i know how to do it ,really it is not hard.
I can effect, i can make animation for camera, load physics and object in that area.
This is not problem.
Problem is my time... I spend many hours to testing and make GTA 5 HUD wheel better.
Mayby that - i will make a script and You will test it. Hour per hour, thing behind thing...
What do You people think about it? smile.gif

Someone want to see my point of view? How to do that in "behind scene"?

pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#13

Posted 25 July 2013 - 01:25 PM

QUOTE (Michael Wojtanis @ Thursday, Jul 25 2013, 09:11)
Lol i know how to do it ,really it is not hard.
I can effect, i can make animation for camera, load physics and object in that area.
This is not problem.
Problem is my time... I spend many hours to testing and make GTA 5 HUD wheel better.
Mayby that - i will make a script and You will test it. Hour per hour, thing behind thing...
What do You people think about it? smile.gif

Someone want to see my point of view? How to do that in "behind scene"?

Are ok with upload your project to google code (or any other SVN repository), anyone can work on it and share with you. I would definitly, you just need the method for that.

Wheatley
  • Wheatley

    I'm living in High Pressure Days.

  • Members
  • Joined: 21 Aug 2010

#14

Posted 28 July 2013 - 08:42 PM Edited by Wheatley, 28 July 2013 - 08:49 PM.

QUOTE (pedro2555 @ Thursday, Jul 25 2013, 13:25)
QUOTE (Michael Wojtanis @ Thursday, Jul 25 2013, 09:11)
Lol i know how to do it ,really it is not hard.
I can effect, i can make animation for camera, load physics and object in that area.
This is not problem.
Problem is my time... I spend many hours to testing and make GTA 5 HUD wheel better.
Mayby that - i will make a script and You will test it. Hour per hour, thing behind thing...
What do You people think about it? smile.gif

Someone want to see my point of view? How to do that in "behind scene"?

Are ok with upload your project to google code (or any other SVN repository), anyone can work on it and share with you. I would definitly, you just need the method for that.

I think once the main code is done for GTA IV, it'll be published on here so others can step in and move it to EFLC for full functionality.

Someone has seemed to already accomplished the moving camera and teleporting aspect but what needs to be accomplished is the model switcher. Native Trainer already as the ability to switch models but doesn't change the voices (which I've been told is not that hard to accomplish) so that's a great start.

Check it: http://www.gtaforums...howtopic=568325


nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008

#15

Posted 28 July 2013 - 11:25 PM

I will try to clean up my code a bit, then maybe more people can contribute to the coding part. One problem might be that I'm doing C++, while many are doing .NET, so if everyone wants to contribute and work together, we would have to make two mods, with different features, one made in c++ and one in .net

I'll post my code tomorrow!

One difficult part is the square radar. I don't know of any way of displaying a partial sprite/texture natively in GTA (to cut off the part of the map thats not inside the square), and if we want to make it 3D, like in V, we WILL have to use some external stuff, like directx. The newest OpenIV has a 3D map thing, which probably could be ported to IV.

And can someone post/make the textures for char switch? like the little wheel thing.

Cheers!

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#16

Posted 29 July 2013 - 04:31 AM

Someone need me?
smile.gif Can i help?

nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008

#17

Posted 29 July 2013 - 11:41 AM

Here is my code, as promised!

http://puu.sh/3OugV.zip
http://pastebin.com/tgQfHB2L

we need you Wojtanis! check the GTA IV:V post, or if you want to help me with my c++ project, send me a mail on zezizima (a) gmail com

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#18

Posted 29 July 2013 - 02:23 PM

How You import C++ into game?
I thought only C# or VB can be used in ScriptHookDotNet.

nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008

#19

Posted 29 July 2013 - 02:32 PM

I use the normal ScriptHook by Arun ;P It was the one that was made first.

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013

#20

Posted 29 July 2013 - 02:33 PM

Uh, and there You can use only C++?

nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008

#21

Posted 29 July 2013 - 03:04 PM

Yup...

Wheatley
  • Wheatley

    I'm living in High Pressure Days.

  • Members
  • Joined: 21 Aug 2010

#22

Posted 30 July 2013 - 04:36 PM Edited by Wheatley, 30 July 2013 - 07:45 PM.

Looks like someone already beat us to the punch, folks.


http://www.youtube.c...e&v=1xeGxWJETNc

Damn. It appears that all the major gaming news sites are reporting about this guys mod. D:

nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008

#23

Posted 30 July 2013 - 09:03 PM

Well, dosnt matter too much, thats JulioNIB. May the best mod win tounge.gif I think my cam effects look nicer, but he has made the char model switch, and 3 different buttons.
today ive made different things happen when you change, like theres a chance you'll be in a heli when you switch, or driving a car, while being wanted by the police.
the worst thing that can happen is that we take longer because we're working on the same stuff, but im working on a lot of stuff, so dosnt matter.

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#24

Posted 30 July 2013 - 09:13 PM

turn.gif
im sorry if i caused some inconvenience to you guys, i just dont want to loose my job that i started some days after GTA V first gameplay trailer, i saw that a GTA V Hud was a success so i decided to finish this mod, but i dont will release it officially, so, when you release your version there will not be a competition, will be only yours

pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#25

Posted 31 July 2013 - 02:32 AM

QUOTE (julionib @ Tuesday, Jul 30 2013, 21:13)
Well, dosnt matter too much, thats JulioNIB. May the best mod win tounge.gif I think my cam effects look nicer, but he has made the char model switch, and 3 different buttons.
today ive made different things happen when you change, like theres a chance you'll be in a heli when you switch, or driving a car, while being wanted by the police.
the worst thing that can happen is that we take longer because we're working on the same stuff, but im working on a lot of stuff, so dosnt matter.

turn.gif
im sorry if i caused some inconvenience to you guys, i just dont want to loose my job that i started some days after GTA V first gameplay trailer, i saw that a GTA V Hud was a success so i decided to finish this mod, but i dont will release it officially, so, when you release your version there will not be a competition, will be only yours

Why aren't you guys working together, until then it's a fight nevertheless.

Great work from both anyway.

nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008

#26

Posted 31 July 2013 - 11:54 AM

I've invited anyone to work with me, but since I do my coding in C++, the .NET guys can't collaborate with me directly, though they can work on other stuff on the list in the GTA IV:V post.

One question JulioNIB, have you managed to spawn Niko in tbogt? if so, can you tell me how, and give me the model hash?

I've been working on my mod:
Ammo display added
When you switch you can be in a car or heli or bike or on foot, and have wanted. all random.
Better camera stuff.


One big issue is still the square minimap. Not sure how to solve that one.

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#27

Posted 31 July 2013 - 03:26 PM

we have an model called ig_niko in EFLC, im using this one

we need to export this model and replace or add as ped in gta iv to have a normal looking niko after switch to luis or johnny

pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#28

Posted 31 July 2013 - 05:44 PM

QUOTE (nixolas1 @ Wednesday, Jul 31 2013, 11:54)
I've invited anyone to work with me, but since I do my coding in C++, the .NET guys can't collaborate with me directly, though they can work on other stuff on the list in the GTA IV:V post.

One question JulioNIB, have you managed to spawn Niko in tbogt? if so, can you tell me how, and give me the model hash?

I've been working on my mod:
Ammo display added
When you switch you can be in a car or heli or bike or on foot, and have wanted. all random.
Better camera stuff.


One big issue is still the square minimap. Not sure how to solve that one.

Just one thing about GTA V trailer, I don't think characters will have random wanted levels and such.

At least when looking on the original IV missions, they ma have random situations you can found them in, but that is almost sure to be only during storyline gameplay. But I'm not sure about this, just thought it was worth sharing.

About the square radar, what is really the issue with it ? The blips ?

I can only help with .NET too..


SomeLegitPlayer
  • SomeLegitPlayer

    1337_Alpha

  • Members
  • Joined: 18 Jul 2013

#29

Posted 31 July 2013 - 06:46 PM

Well, if someone need some help on coding, etc i'm here, but be aware im only good at C++ not at .net ^^

luis95
  • luis95

    The Viper

  • Members
  • Joined: 05 Nov 2009
  • Romania

#30

Posted 31 July 2013 - 07:01 PM





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users