Skip to content

Conversation

@Tivertoni
Copy link
Contributor

Added GetPropertyFlag(BlipPropertyFlag flag) — allows reading whether a specific blip property flag is set.

Added SetPropertyFlag(BlipPropertyFlag flag, bool value) — private setter for internal use; note that updating flags this way does not immediately refresh the blip visually atleast for some.

Originally intended as a refactor, but GetPropertyFlag could be useful as a public feature.

Refactoring and related bug fixes will be addressed in separate follow-up PRs.

Copy link
Member

@kagikn kagikn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but we can't expose GetPropertyFlag without considering how the gold tick flag changes the enum definition in b2699. I would hide the method to avoid potential flag shifts. We need to adjust bit indices by the running game version if it's being publicly exposed, that's for sure.

/// <summary>
/// Shows a gold tick indicator on the <see cref="Blip"/>.
/// </summary>
ShowGoldTick,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This flag isn't present in b2628 or earlier game versions. I tested in both b2628 and b2699 by watching which bit SHOW_HEADING_INDICATOR_ON_BLIP changes even.

@Tivertoni Tivertoni marked this pull request as draft October 27, 2025 21:11
@Tivertoni
Copy link
Contributor Author

I’ve converted this PR to a draft for now due to the ShowGoldTick issue.
By the way, did you archive the old builds yourself, or do you use a public archive? I know Steam supports downgrading, but I’m using GTA V on Epic Games and Rockstar Launcher. (Bought it twice)

@kagikn
Copy link
Member

kagikn commented Oct 28, 2025

I archive old builds myself. I've downloaded depots with GTA5.exe files from Steam about 10 times to download builds I forgot to archive, though. I have a lot of memory-dumped exe files even, so I can search them for something I need to find quickly when I have to see (though that source code leak reduces the need).

@Tivertoni
Copy link
Contributor Author

I created a spreadsheet documenting when natives for each BLIP_FLAG were introduced.
Screenshot 2025-10-29 122444

@kagikn
Copy link
Member

kagikn commented Oct 29, 2025

Fortunately, we have an alternative way to achieve what blip natives that change some property flags do with direct memory editing. Since we know trigger flags listed below and every flag except BLIP_FLAG_VALUE_CHANGED_GOLD_TICK and BLIP_FLAG_USE_SHORT_HEIGHT_THRESHOLD exists even in b373, we could substitute natives with combinations of a certain non-trigger flag and the corresponding trigger flag in older game versions.

enum eBLIP_TRIGGER_FLAG
{
	BLIP_FLAG_VALUE_CHANGED_COLOUR = 33,	// when a colour changes
	BLIP_FLAG_VALUE_CHANGED_FLASH,			// when the flash changes
	BLIP_FLAG_VALUE_REINIT_STAGE,			// when blip must be re-initialised on the stage
	BLIP_FLAG_VALUE_REMOVE_FROM_STAGE,		// when blip must be removed from the stage prior to destroying the object
	BLIP_FLAG_VALUE_DESTROY_BLIP_OBJECT,	// when blip object is to completely destoryed
	BLIP_FLAG_ON_STAGE,						// set if the blip was on the stage last time the minimap was rendered
	BLIP_FLAG_VALUE_CHANGED_PULSE,			// blip flagged to pulse
	BLIP_FLAG_UPDATE_ALPHA_ONLY,			// update alpha directly without invoking SET_RADIUS_BLIP_COLOUR
	BLIP_FLAG_VALUE_SET_NUMBER,				// when to reinitialise the number shown on a blip
	BLIP_FLAG_EXECUTED_VIA_DLC,				// will be TRUE once the blip has been executed on the drawlist
	BLIP_FLAG_EXECUTED_VIA_DLC_LAST_FRAME,	// when blip was sent to the renderthread last frame
	BLIP_FLAG_UPDATE_STAGE_DEPTH,		// blip has had its priority (or hover state) tweaked and needs its depth adjusted on the stage
	BLIP_FLAG_VALUE_CHANGED_TICK,			// when the tick changes and needs to be updated
	BLIP_FLAG_VALUE_CHANGED_GOLD_TICK,		// when the gold tick changes and needs to be updated
	BLIP_FLAG_VALUE_CHANGED_FOR_SALE,		// when the for sale icon on a blip should be updated
	BLIP_FLAG_VALUE_CHANGED_OUTLINE_INDICATOR,
	BLIP_FLAG_VALUE_CHANGED_FRIEND_INDICATOR,
	BLIP_FLAG_VALUE_CHANGED_CREW_INDICATOR,
	BLIP_FLAG_UPDATED_LOW_FREQ_FLAGS,		// optimization; true when we've thrown a few less common flags
	BLIP_FLAG_VALUE_TURNED_OFF_SHOW_HEIGHT,	// when the SHOW_HEIGHT property is turned off - used to make sure the height blip is returned to level

// omitted since we consider only final builds for SHVDN and not any builds where `__BANK` is set to true
#if __BANK
#endif // __BANK

	MAX_BLIP_TRIGGER_FLAGS
};

For the crew indicator you can test it with *(int*)(blip.MemoryAddress + 0x24)) |= (1 << 20); *(int*)(blip.MemoryAddress + 0x24)) |= (1 << (49 - 32)) in b2699 or older. We should set BLIP_FLAG_UPDATED_LOW_FREQ_FLAGS when we manually set BLIP_FLAG_VALUE_CHANGED_* flags, though, otherwise such indicators would get recreated every frame. To add BLIP_FLAG_UPDATED_LOW_FREQ_FLAGS in b2628 or older, we can set it with an expression like *(int*)(blip.MemoryAddress + 0x24)) |= (1 << (50 - 32));.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants