Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Summer Special
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA 6

      1. St Andrews Cathedral
    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    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. DYOM
      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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
Phnx

[Q] Change camera via lua-script?

Recommended Posts

Phnx

Is it possibe to center the camera behind Niko and in the car center the camera behind the car, not Niko, using a lua-script?!

Share this post


Link to post
Share on other sites
Phnx

Noone knows the variables for the camera??? sad.gif

Share this post


Link to post
Share on other sites
GAK

Hello,

To get the game's camera ID use this :

 

PushVarPtr()CallNative("GET_GAME_CAM_CHILD")IDCam = GetIntParam(0)

 

then use "SET_CAM_ROT" like that :

 

PushInt(IDCam)PushFloat(AngleX)PushFloat(AngleY)PushFloat(AngleZ)CallNative("SET_CAM_ROT")

 

Share this post


Link to post
Share on other sites
Phnx
Hello,

To get the game's camera ID use this :

 

PushVarPtr()CallNative("GET_GAME_CAM_CHILD")IDCam = GetIntParam(0)

 

then use "SET_CAM_ROT" like that :

 

PushInt(IDCam)PushFloat(AngleX)PushFloat(AngleY)PushFloat(AngleZ)CallNative("SET_CAM_ROT")

 

Thank you very much! You couldn't write a script for me that centers the camera, could you?! smile.gif I have no idea of lua. sad.gif

Share this post


Link to post
Share on other sites
Attilas

oh yes it could be very nice

Share this post


Link to post
Share on other sites
Phnx
Hello,

To get the game's camera ID use this :

 

PushVarPtr()CallNative("GET_GAME_CAM_CHILD")IDCam = GetIntParam(0)

 

then use "SET_CAM_ROT" like that :

 

PushInt(IDCam)PushFloat(AngleX)PushFloat(AngleY)PushFloat(AngleZ)CallNative("SET_CAM_ROT")

 

Please, could someone help with this? smile.gif

Share this post


Link to post
Share on other sites
Phnx
Hello,

To get the game's camera ID use this :

 

PushVarPtr()CallNative("GET_GAME_CAM_CHILD")IDCam = GetIntParam(0)

 

then use "SET_CAM_ROT" like that :

 

PushInt(IDCam)PushFloat(AngleX)PushFloat(AngleY)PushFloat(AngleZ)CallNative("SET_CAM_ROT")

 

Hey, I still need help here, please! sad.gif

Share this post


Link to post
Share on other sites
SEKoner

To became the players view point (like in first person schooters), i think this will give you the correct viewpoint. but lua is not my used script lang and im on work. function not testest !!

 

function GetNewCamCoords()

PushInt(PLAYER_CHAR)

PushFloat(0.0)

PushFloat(0.2)

PushFloat(0.0)

PushVarPtr()

PushVarPtr()

PushVarPtr()

CallNative("GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS")

X = GetFloatParam(4)

Y = GetFloatParam(5)

Z = GetFloatParam(6)

end

 

Became actual cam id like postet before:

 

function GetActualCamID

PushVarPtr()

CallNative("GET_GAME_CAM_CHILD")

IDCam = GetIntParam(0)

end

 

Set the new coordinates to cam

 

SetCamCoords(IDCam)

GetNewCamCoords()

PushInt(IDCam)

PushFloat(AngleX)

PushFloat(AngleY)

PushFloat(AngleZ)

CallNative("SET_CAM_ROT")

end

 

To start functions

 

GetActualCamID()

SetCamCoords(IDCam)

 

I think that this is all what you need to set actual cam in first person mode. Like i told before ... this are only the functions and THEY ARE NOT TESTET. I use other script languages for myself.

Edited by SEKoner

Share this post


Link to post
Share on other sites
Intosia

Nice info thanks smile.gif

Share this post


Link to post
Share on other sites
SEKoner

I've a bit time between my work and made this script to test if it works like i think :

 

 

-- First-Person Cam Test-Script by SEKoner --globale variablenPLAYER_ID, PLAYER_INDEX, PLAYER_CHAR, TIMER = 0function InitScript()-- Wake up neo ... wake up ....;)Wait(10000)endfunction WaitForPlayerPoolCreation() while (IsPlayerPoolCreated() == 0) do   Wait(2000) endendfunction WaitForValidPlayer() PLAYER_CHAR = 0 repeat    CallNative("GET_PLAYER_ID")PLAYER_ID = GetIntResult()if (PLAYER_ID >= 0) then  PushInt(PLAYER_ID)  CallNative("CONVERT_INT_TO_PLAYERINDEX")  PLAYER_INDEX = GetIntResult()  PushInt(PLAYER_INDEX)     PushVarPtr()	  CallNative("GET_PLAYER_CHAR")  PLAYER_CHAR = GetIntParam(1)  if (PLAYER_CHAR <= 0) then    Wait(1000)  end  end  until (PLAYER_CHAR > 0)  endfunction getNewCam() PushInt(PLAYER_CHAR) PushFloat(0.1) PushFloat(0.2) PushFloat(0.1) PushVarPtr() PushVarPtr() PushVarPtr() CallNative("GET_OFFSET_FROM_CHAR_IN_WORLD_COORDS") X = GetFloatParam(4) Y = GetFloatParam(5) Z = GetFloatParam(6)endfunction getActualCamId() PushVarPtr() CallNative("GET_GAME_CAM_CHILD") IDCam = GetIntParam(0) SetCamCoords(IDCam) wait(100)endSetCamCoords(ID) getNewCam() PushInt(ID) PushFloat(X) PushFloat(Y) PushFloat(Z) CallNative("SET_CAM_ROT")endfunction Test() getActualCamId() wait(300)endfunction main()InitScript()while true do  WaitForPlayerPoolCreation()  WaitForValidPlayer()   if (IsKeyPressed(112) == 1) then     Test()  end  Wait(1700)endendmain();

 

 

Can someone test it ??

Share this post


Link to post
Share on other sites
Phnx

Nope, no camera change. Everything as default. Tested with Alice beta 0.1.

Share this post


Link to post
Share on other sites
HippieCommunist

i dont think its that simple... in most vanilla scripts there are commands like CREATE_CAM and START_scripted_cams and a few i dont remember...

1st person might be refreshing icon14.gif

Share this post


Link to post
Share on other sites
Phnx
i dont think its that simple... in most vanilla scripts there are commands like CREATE_CAM and START_scripted_cams and a few i dont remember...

1st person might be refreshing icon14.gif

Well, I didn't actually want "firstperson". I just wanted the camera centered behind Niko, on foot and in cars (currently off-set).

Share this post


Link to post
Share on other sites
HippieCommunist

you get the camera rolling ill get the first person, DEAL??

colgate.gif

Share this post


Link to post
Share on other sites
Phnx
you get the camera rolling ill get the first person, DEAL??

colgate.gif

Yeah, there's only one problem: I know almost nothing about scripting. I know there are "if" and "else" and "end". And I know just a bit about how to use that, but I know nothing about "lua". sad.gif

Share this post


Link to post
Share on other sites
diveplane

really hope one of you guys get this working.

 

we need a camera editor if possible.

 

i hate the default cams in the game my only gripe with it.

Share this post


Link to post
Share on other sites
Borocay

Bump, I hope someone will fix this. I love the game except for the camera angles.

Share this post


Link to post
Share on other sites
Phnx

Please help! I have waited for months now for someone to help, but no one seems to be interested. Pleeeeease, someone, be so kind and share your wisdom and knowledge with us! Please! sad.gif

Share this post


Link to post
Share on other sites
Phnx
Download this http://www.gtaforums.com/index.php?showtopic=398667

Press M when in car

done.

Thank you for the link! I think I must quote myself:

 

 

Is it possibe to center the camera behind Niko and in the car center the camera behind the car, not Niko, using a lua-script?!

Share this post


Link to post
Share on other sites
Hergonan

It's best to create your own camera then activate it.

Don't change the game's camera.

The first person camera attaches an object to niko's head then sets the camera on that object, for example.

Share this post


Link to post
Share on other sites
Phnx
It's best to create your own camera then activate it.

Don't change the game's camera.

The first person camera attaches an object to niko's head then sets the camera on that object, for example.

Ok, thanks. If I knew how to do that I would have done it by now.

Share this post


Link to post
Share on other sites
skyfujin

How do you install the mod that fixes the camera behind the vehicle? This is my first time playing GTA on PC. I don't know where to put the files and there is no mention of this in the README!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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