Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Avoid camera "auto point" to ped


julionib
 Share

Recommended Posts

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:

 

 

SET_GAME_CAM_PITCH( 10.00000000 );

 

Link to comment
Share on other sites

idk would this help...

 

 

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

 

 

 

SET_CAM_TARGET_PEDSET_CAMERA_AUTO_SCRIPT_ACTIVATIONSET_CAMERA_CONTROLS_DISABLED_WITH_PLAYER_CONTROLSSET_CAN_TARGET_CHAR_WITHOUT_LOSSET_CHAR_NEVER_TARGETTEDSET_PLAYER_PLAYER_TARGETTINGALLOW_TARGET_WHEN_INJUREDIS_PLAYER_TARGETTING_ANYTHING

 

Edited by hardsty1e
Link to comment
Share on other sites

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

Link to comment
Share on other sites

thats nice, its working:

 

 

       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

Link to comment
Share on other sites

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

 

 

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

Link to comment
Share on other sites

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 ^^

Link to comment
Share on other sites

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

Link to comment
Share on other sites

 

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

 

 

DISABLE_PLAYER_LOCKON(GET_PLAYER_ID(), true);

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.