Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (86,304 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

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

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

    2. Site Suggestions

OfficerJohnson

LSPD Camera Overlay From Eye in the Sky Mission?

Recommended Posts

OfficerJohnson

Hello everyone. I would like to know how to get this overlay to appear. Is it a "scale form"? Can you please explain how I get that camera overlay from the mission to appear?

 

In addition, where can I find where the symbols for the mission are stored? Any ideas?

Share this post


Link to post
Share on other sites
Bob_74

It is a scaleform: https://scaleform.devtesting.pizza/#heli_cam

I tried quickly to see how it works and I ended up with this:

public static void ShowHeliCam(){    float range = 30.0f;    Vehicle target = null;    while (range > 5.0f && target == null)    {        target = World.GetClosestVehicle(Game.Player.Character.GetOffsetInWorldCoords(new Vector3(0f, range, 0f)), 5f);        range = range - 0.5f;    }    // Creating the Scaleform    int handle = Function.Call<int>(Hash.REQUEST_SCALEFORM_MOVIE, "heli_cam");    while (!Function.Call<bool>(Hash.HAS_SCALEFORM_MOVIE_LOADED, handle))        Script.Yield();    // Requesting textures related to this script    Function.Call(Hash.REQUEST_STREAMED_TEXTURE_DICT, "helicopterHUD", false);    while (!Function.Call<bool>(Hash.HAS_STREAMED_TEXTURE_DICT_LOADED, "helicopterHUD"))        Script.Yield();    // This scaleform takes all the screen    Function.Call(Hash.DRAW_SCALEFORM_MOVIE_FULLSCREEN, handle, 255, 255, 255, 0, 1);    // 0 = No logo / 1 = LSPD logo top right    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION, handle, "SET_CAM_LOGO");    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT, 1);    Function.Call(Hash._POP_SCALEFORM_MOVIE_FUNCTION_VOID);    // Oscillation amplitude (all on false = no oscillation)    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION, handle, "SET_AUDIO_STATES");    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL, true);    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL, true);    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_BOOL, true);    Function.Call(Hash._POP_SCALEFORM_MOVIE_FUNCTION_VOID);    // Float1 = Left graduations / Float2 = To right graduation    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION, handle, "SET_ALT_FOV_HEADING");    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT, 200f);    Function.Call(Hash._PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT, 0.5f);    Function.Call(Hash._POP_SCALEFORM_MOVIE_FUNCTION_VOID);    if (target != null)    {        if (target.Exists())        {            float offset = 0.4f; // Value in script: 0.4f or 2f / Handles the "hud_corner" spacing (would need to decrease from 2.0 to 0.4 while the targetting is in progress)            // Translate world coordinates into screen coordinates + set the new screen coordinates as origin            Function.Call(Hash.SET_DRAW_ORIGIN, target.Position.X, target.Position.Y, target.Position.Z, 0);            offset = offset * 0.03f; // It is present in the script, I don't know why            Function.Call(Hash.DRAW_SPRITE, "helicopterhud", "hud_corner", (-offset * 0.5f), -offset, 0.013f, 0.013f, 0f, 64, 255, 64, 255);            Function.Call(Hash.DRAW_SPRITE, "helicopterhud", "hud_corner", (offset * 0.5f), -offset, 0.013f, 0.013f, 90f, 64, 255, 64, 255);            Function.Call(Hash.DRAW_SPRITE, "helicopterhud", "hud_corner", (-offset * 0.5f), offset, 0.013f, 0.013f, 270f, 64, 255, 64, 255);            Function.Call(Hash.DRAW_SPRITE, "helicopterhud", "hud_corner", (offset * 0.5f), offset, 0.013f, 0.013f, 180f, 64, 255, 64, 255);            // Arrow locating the target, needs trigonometry to find where to point at            // Function.Call(Hash.DRAW_SPRITE, "helicopterhud", "hudArrow", 0.0f, 0.0f, 0.02f, 0.04f, 180f, 64, 64, 255, 255);            // Clear the ogirin coordinates to be able to draw other things again            Function.Call(Hash.CLEAR_DRAW_ORIGIN);        }        else        {            // The vehicle doesn't exist, show the TargetLost icon            Function.Call(Hash.DRAW_SPRITE, "helicopterHUD", "TargetLost", 0.5f, 0.70f, 0.03f, 0.05f, 0.0f, 255, 64, 64, 255);        }    }    else    {        // No vehicle found show the TargetLost icon        Function.Call(Hash.DRAW_SPRITE, "helicopterHUD", "TargetLost", 0.5f, 0.70f, 0.03f, 0.05f, 0.0f, 255, 64, 64, 255);    }}

It must be called every frames.
The game does a lot of calculation (b678 - carsteal2.c - line 49542) to fill the gauges with heading and rotation values, here I just put fixed values (200 and 0.5) that you'll need to change according to what you want.
Also, the targeting arrow calculation is at line 50112.

C9qUAVel.pngW4Hpdbxl.png

I hope it will help you :)

 

EDIT: To know what functions to call, I only looked at the carsteal2 script.

A scaleform works that way:

 

You request a scaleform (REQUEST_SCALEFORM_MOVIE) and it returns its handle.

You wait until the scaleform is loaded (HAS_SCALEFORM_MOVIE_LOADED) by checking the handle.

 

Then you can call the scaleform functions (_PUSH_SCALEFORM_MOVIE_FUNCTION).

Functions needs parameters, so you need to send them using (_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_xxxx where xxx is the type of the parameter).

Then you execute/end the function using _POP_SCALEFORM_MOVIE_FUNCTION_VOID.

Edited by Bob_74

Share this post


Link to post
Share on other sites
OfficerJohnson

Holy **** Bob!!!

 

You wrote all that code yourself?

 

I had just recently figured out it was a scale form, so nice to see that's been confirmed.

 

What did you look for in the script? I've looked through about 1/4 of it and my head already hurts. And yes. Carsteal2.c4.

Share this post


Link to post
Share on other sites
OfficerJohnson

Okay. So let me get this straight...

 

All this is found under one scaleform named "heli_cam". To manipulate the functions/methods within a scaleform, we have to push the parameters onto a stack using the natives. Once we are done and have pushed all the values/parameters, we use the pop command to end the stack, correct?

 

This helps immensely BTW. And since you put it in CSharp, I can track it a bit easier. I'll check out the Scaleform class of SHV.NET to see what I can find.

Share this post


Link to post
Share on other sites
Bob_74

Holy **** Bob!!!

 

You wrote all that code yourself?

 

I had just recently figured out it was a scale form, so nice to see that's been confirmed.

 

What did you look for in the script? I've looked through about 1/4 of it and my head already hurts. And yes. Carsteal2.c4.

Yes I wrote that but it's quite basic, I didn't handle the sliders dynamically and such.

You look for the script's name, when it is requested to load, you will see the name of the variable containing it. Now you can search through the file to find how this variable (scaleform) is used.

Okay. So let me get this straight...

 

All this is found under one scaleform named "heli_cam". To manipulate the functions/methods within a scaleform, we have to push the parameters onto a stack using the natives. Once we are done and have pushed all the values/parameters, we use the pop command to end the stack, correct?

 

This helps immensely BTW. And since you put it in CSharp, I can track it a bit easier. I'll check out the Scaleform class of SHV.NET to see what I can find.

Exactly! The hardest part is to follow how the scaleform is created and how it's functions are called in the decompiled script ;) Edited by Bob_74

Share this post


Link to post
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

×

Important Information

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