LeFix Posted June 28, 2017 Share Posted June 28, 2017 (edited) I'm simply searching a way to check if the three bar combo for the health, stamina and the special ability stat is currently displayed on the screen. I worked with this http://www.dev-c.com/nativedb/func/info/bc4c9ea5391ecc0d UI::IS_HUD_COMPONENT_ACTIVE Hashes: 0xBC4C9EA5391ECC0D 0x6214631F function before but it looks like these bars aren't specified as hud component? The fuel bar introduced by my fuel mod should preferably only be visible if the other stats are displayed as well. Currently it only checks for cutscence with this http://www.dev-c.com/nativedb/func/info/49c32d60007afa47 PLAYER::IS_PLAYER_CONTROL_ON Hashes: 0x49C32D60007AFA47 0x618857F2 function which works well for cutscenes but I know there are mods and/or native settings(?) which hide these three bars and I'd like to "stick" the fuel bar appearance to these. Does somebody know a solution? Edited June 28, 2017 by LeFix Link to comment Share on other sites More sharing options...
ins1de Posted July 7, 2017 Share Posted July 7, 2017 (edited) I've spent some time looking at scaleforms and I figured out health bar, ammo and special ability bar are...scaleform items. God, I went through so many scaleforms I can't even remember the original name (think it was "minimap"), but I saw an internal function called "HIDE_HEALTH_ARMOR". In order to access/modify it there are lot of ways : You either edit the scaleform file itself, recompile and distribute it with your mod (I know we all hate this) Find a method to retrieve the current scaleform adress/id/pointer used by one of the game scripts from within the memory, then call the appropriate function with CALL_SCALEFORM_MOVIE_METHOD(thatScaleform, "HIDE_HEALTH_ARMOUR"). (most accurate way, and it would be a huge discovery for future mods) Hide the default hud, recreate the whole minimap+hud by yourself, and hide the health bar, not impossible, but very crazy. Here's the proof the function actually exists : I managed to get the mask shape (it's the item number 9 in the images array, maybe this can be accessed like a hud component somewhere?) used by this function : It works exactly the same way for the other items like the ability bar : Madness. Edited July 8, 2017 by ins1de Link to comment Share on other sites More sharing options...
ins1de Posted July 8, 2017 Share Posted July 8, 2017 (edited) Actually the whole HUD is drawn with scaleforms, and some natives allow us to manipulate them. HIDE_HUD_AND_RADAR_THIS_FRAME DISPLAY_AMMO_THIS_FRAME DISPLAY_AREA_NAME() ... You can for example hide the wanted stars, hide the cash component etc. What really happens inside the game is instructions being sent to the internal functions of the scaleform. Let's say you want to display the area name with its native DISPLAY_AREA_NAME : Call native with ScriptHookV -> Native actually calls (with or without params) scaleform subroutine -> scaleform executes internal function -> result is displayed So when we call a native such as HIDE_HUD_AND_RADAR_THIS_FRAME it does exactly the same as described above, except the fact it calls a specific scaleform subroutine which says "Hey, I want you to hide all the components". For a long time, I thought the whole HUD was drawn with textures, in reality, it's the scaleforms themselves that use the texture files to draw them, but not natives like DRAW_SPRITE etc. Those natives directly interact with the global HUD scaleform which we have to find the origin in the game scripts or at least in the game memory. Now I consider the two following possibilities : There are natives to enable/disable the minimap components (health, armour, airbar, special ability) but we haven't discovered/renamed them yet There aren't any natives to handle those components, but there is a scaleform pointer that might be possible to retrieve, and then invoke the scaleform function with CALL_SCALEFORM_MOVIE_METHOD(scaleform, "INTERNAL_FUNCTION_NAME_THAT_HIDES_THE_COMPONENT"); Edited July 8, 2017 by ins1de jedijosh920 1 Link to comment Share on other sites More sharing options...