Quantcast

Jump to content

» «
Photo

Avoid camera "auto point" to ped

9 replies to this topic
julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#1

Posted 22 June 2013 - 11:41 PM

My problem:

Use custom cam to aim and set targets but need to avoid the auto-lock feature that we have when the player is unarmed

if we use in the tick player.character.task.clearall we avoid this, the problem is that i have tasks that must still when aim is down (TASK_PLAY_ANIM_SECONDARY_UPPER_BODY)

one solution is give an object to player, but then we need to avoid the aim animations and make sure that player have the object tounge.gif



one detail: i cant use mouse movements to set new camera angles because when player releases aim the game camera can have very different angle if compared to last custom cam angle.


also if someone knows how to use this method in all gta versions, it should fix my issue smile.gif

SET_GAME_CAM_PITCH

it always set to 0, dont matter what kind of value we set on that, this is how it seems to be usd based on SCOCL:

CODE
SET_GAME_CAM_PITCH( 10.00000000 );

hardsty1e
  • hardsty1e

    GLITCHED

  • Members
  • Joined: 02 May 2009
  • None

#2

Posted 23 June 2013 - 12:45 AM Edited by hardsty1e, 23 June 2013 - 12:54 AM.

idk would this help...

CODE
Private Sub SetRotateCam(ByRef rotVect As Vector3)
       If pointedRotCam Is Nothing Then : Dim pc As Ped = Player.Character : Dim gc As Camera = Game.CurrentCamera
           pc.Visible = False : oldPedHead = pc.Heading : oldPitch = gc.Rotation.X
           Native.Function.Call("SET_GAME_CAM_HEADING", 0) : Native.Function.Call("SET_GAME_CAM_PITCH", oldPitch)
           Wait(50) : pointedRotCam = New Camera : pointedRotCam.TargetPed(pc)
           pointedRotCam.FOV = gc.FOV : pointedRotCam.Position = gc.Position
           pointedRotCam.Rotation = gc.Rotation : pointedRotCam.Activate()
       End If : Dim gm As base.Mouse = Game.Mouse
       Dim mmove As Drawing.PointF = New Drawing.PointF(gm.Movement.X * rotChangeVal, gm.Movement.Y * rotChangeVal)
       If Game.isGameKeyPressed(GameKey.SeekCover) Then
           rotVect += New Vector3(mmove.Y, mmove.X, 0)
       Else
           rotVect += New Vector3(mmove.Y, 0, mmove.X)
       End If
   End Sub

   Private Sub DoAimMove()
       If Game.isGameKeyPressed(GameKey.Aim) Then : Dim pc As Ped = Player.Character : Player.WantedLevel = 0
           If GetWeaponType(pc.Weapons.CurrentType) <> WeaponTypes.Melee Then
               If Game.isGameKeyPressed(GameKey.Action) Then
                   Select Case spawnType
                       Case SpawnTypes.Objects : SetRotateCam(aimRotation)
                       Case Else : aimHeadOffset += 90 : If aimHeadOffset >= 360 Then aimHeadOffset = 0
                   End Select
               Else : DeactivateRotateCam() : End If


CODE
SET_CAM_TARGET_PED
SET_CAMERA_AUTO_SCRIPT_ACTIVATION
SET_CAMERA_CONTROLS_DISABLED_WITH_PLAYER_CONTROLS
SET_CAN_TARGET_CHAR_WITHOUT_LOS
SET_CHAR_NEVER_TARGETTED
SET_PLAYER_PLAYER_TARGETTING
ALLOW_TARGET_WHEN_INJURED
IS_PLAYER_TARGETTING_ANYTHING

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#3

Posted 23 June 2013 - 02:43 AM

thx

i guess that wont work because of the use of SET_GAME_CAM_PITCH

i will do some tests with the native listed in the end of your post, maybe the SET_CHAR_NEVER_TARGETTED can be used to make all peds around(15) (for example) be not targeted

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#4

Posted 23 June 2013 - 09:23 AM

thats nice, its working:

CODE

       If bAimDown Then
           For Each p As Ped In World.GetPeds(Player.Character.Position, 15)
               If Exists(p) AndAlso Not aimlockAvoidList.Contains(p) Then
                   aimlockAvoidList.Add(p)
                   Native.Function.Call("SET_CHAR_NEVER_TARGETTED", p, True)
               End If
           Next
       End If


now its just use an timer to avoid over processing and use a timer to remove the property when ped gets away from player


thx again

hardsty1e
  • hardsty1e

    GLITCHED

  • Members
  • Joined: 02 May 2009
  • None

#5

Posted 23 June 2013 - 05:56 PM

nice dude, glad you found out a way to do it.

CODE
GTA.Native.Function.Call("ALLOW_LOCKON_TO_RANDOM_PEDS", Player.Character, 1);
GTA.Native.Function.Call("ALLOW_LOCKON_TO_FRIENDLY_PLAYERS", Player.Character, 1);


your halk mod looks like fun too, cant wait Shifty41s_beerhatsmilie2.gif

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#6

Posted 23 June 2013 - 07:16 PM

lol, i think that i tested this last two methods, cant remember now, i will test again, if they work i can avoid that big code ^^

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#7

Posted 23 June 2013 - 07:27 PM

yep, those last two dont work, at least in patch 1.0.7.0, didnt tested in older patchs

hardsty1e
  • hardsty1e

    GLITCHED

  • Members
  • Joined: 02 May 2009
  • None

#8

Posted 27 June 2013 - 07:26 PM

QUOTE (julionib @ Sunday, Jun 23 2013, 19:27)
yep, those last two dont work, at least in patch 1.0.7.0, didnt tested in older patchs

one more to throw at ya tounge.gif maybe others might need it as well

CODE
DISABLE_PLAYER_LOCKON(GET_PLAYER_ID(), true);

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#9

Posted 28 June 2013 - 10:52 AM

yep, i tryed this one too

nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008
  • None

#10

Posted 29 June 2013 - 07:10 PM

I'm guessing all/most of those are for MP lock-on / xbox-controller lock-on.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users