Quantcast

Jump to content

» «
Photo

Pistol Whip Mod, camera problem

7 replies to this topic
Slasher_101
  • Slasher_101

    Player Hater

  • Members
  • Joined: 17 Jun 2010

#1

Posted 16 July 2014 - 07:44 PM

Hi, Im making it so that you can use pistol whip in the PC version of gtaIV. All it takes is modifying some xbox/ps controls to pc controls and bam, you can pistol whip. So the only problem I have now is that when you click the mouse to hit someone, the camera starts zooming in as if you were shooting the gun. I'm guessing that this is because mouse click is also shoot.

 

It looks to me like the only way to change this would be to somehow assign the xbox control to a keyboard button. The ControlMap.dat file is encoded so I cant see if there are unused xbox controls there. On PC we only get attack 1 & 2, but on xbox/ps there seems to be attacks 1 - 4 so Im hoping that if I can somehow assign a keyboard / mouse button to attacks 3 & 4 then I wouldn't have the camera problem.

 

Any advice?


byteMe420
  • byteMe420

    Fvck Everything

  • Members
  • Joined: 02 Jul 2014
  • United-States

#2

Posted 17 July 2014 - 06:11 AM Edited by byteMe420, 17 July 2014 - 06:11 AM.

well this is a coding forum so code a pistol whip mod to use another key


PlayPrey
  • PlayPrey

    string ScriptSkillLevel = "Low-Med";

  • Members
  • Joined: 02 Jul 2012
  • Norway

#3

Posted 17 July 2014 - 01:46 PM

What do you mean? Like hitting a nearby person with the under side of the pistol? (ammo location) 


Slasher_101
  • Slasher_101

    Player Hater

  • Members
  • Joined: 17 Jun 2010

#4

Posted 17 July 2014 - 04:43 PM

Yes, hitting them with the underside of the gun. OK sorry to ask such a simple question here, but how would you make an lua script that says when a key is pressed then do a primary attack or secondary attack or kick? All I know is IsKeyPressed(key)


byteMe420
  • byteMe420

    Fvck Everything

  • Members
  • Joined: 02 Jul 2014
  • United-States

#5

Posted 17 July 2014 - 05:06 PM Edited by byteMe420, 17 July 2014 - 05:07 PM.

Well I don't think many people code GTA in Lua... mostly people use c++ to write asi mods or .net (C# or VB so the shdn.asi will load)

 

1. You need to detect ped's within range and ensure player is armed with a weapon that could be used to pistol whip (smg's too)

2. When a ped is found play the pistol whip animation and most likely there is an animation for the victim when being hit, so u play at the same time on the victim.

3. Wait until the appropriate time in the animation to trigger blood ptfx and damage to the peds health

4. Optionally u can add sounds or apply force or whatever u can think of

 

There is no code to just do it, u have to recreate it. Bind all that to a keypress and ur done.


Slasher_101
  • Slasher_101

    Player Hater

  • Members
  • Joined: 17 Jun 2010

#6

Posted 17 July 2014 - 05:26 PM

Thanks for the reply

So are you telling me there's no way to code a keypress to do something like crouch or reload? Without actually coding all the animations etc over again. Like something that would effectively be binding a key to a control?


byteMe420
  • byteMe420

    Fvck Everything

  • Members
  • Joined: 02 Jul 2014
  • United-States

#7

Posted 17 July 2014 - 06:33 PM Edited by byteMe420, 17 July 2014 - 06:35 PM.

Thanks for the reply

So are you telling me there's no way to code a keypress to do something like crouch or reload? Without actually coding all the animations etc over again. Like something that would effectively be binding a key to a control?

The game is programmed to act a certain way when the binded control is pressed so if you are unable to go to the keybinds and make the correct edits then yeah i would just code what i needed and in a way to not conflict with the normal actions of the game.

 

Now is it possible to accomplish what u are intending... I am sure it is possible but I've never dealt with what you are trying to do so I don't know how that would work. Any behavior i need in a game I would just try to script it and load with the scripthooks.


InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#8

Posted 17 July 2014 - 07:44 PM Edited by InfamousSabre, 17 July 2014 - 11:38 PM.

A workaround would be to make the aim camera the same distance from the player as the usual game camera.
To change it, just press the camera button ('V') while aiming.

 

I would understand if that isn't acceptable though.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users