Skip to content

Conversation

@gta191977649
Copy link
Contributor

@gta191977649 gta191977649 commented Jan 2, 2022

Introduction

This PR adds the vehicle sun glare effect to the setWorldSpecialPropertyEnabled, isWorldSpecialPropertyEnabled. The effect is already presented in the SA engine and it's a leftover feature from VC, so it will add some classic aesthetic to the game.

QQ截图20220102234519

Summary:

  • This effect is disabled by default, keeping consistent to the original SA graphical favor.
  • new propname: vehiclesunglare is added into the world function, you can set it on or off like other world properties. this includes setWorldSpecialPropertyEnabled, isWorldSpecialPropertyEnabled
  • the vehicle glare is shown from 6:00 AM to 19:00 PM (excluding the raining or cloudy weather), it's the default behavior implemented by the game.
  • Not all the vehicles will work, e.g. bandito, most planes, maybe due to they are not present in VC and it is no need for R* to update them, but most vehicles should work fine (maybe we need more investigation to find out).

Code Example:

  • Enable: setWorldSpecialPropertyEnabled("vehiclesunglare",true)
  • Disable: setWorldSpecialPropertyEnabled("vehiclesunglare",false)

Test Resource

glare.zip
command /glare on or off to switch this effect.

@TheNormalnij
Copy link
Member

Thanks you for the PR!
Can you revert c5628c8? I think it's a small mistake.

@gta191977649
Copy link
Contributor Author

gta191977649 commented Jan 2, 2022

@TheNormalnij allright, should cool now

@lopezloo lopezloo added the enhancement New feature or request label Jan 2, 2022
unsigned long* CGameSA::VAR_Framelimiter;

unsigned int OBJECTDYNAMICINFO_MAX = *(uint32_t*)0x59FB4C != 0x90909090 ? *(uint32_t*)0x59FB4C : 160; // default: 160
static int m_iVehicleSunGlare;
Copy link
Member

Choose a reason for hiding this comment

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

Can bool be used?

Copy link
Contributor Author

@gta191977649 gta191977649 Jan 8, 2022

Choose a reason for hiding this comment

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

Can bool be used?

I've tried that before, but it seems will resulting crashing on the client.

Copy link
Member

Choose a reason for hiding this comment

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

BOOL is bool type with int size. Can be used here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BOOL is bool type with int size. Can be used here

yeah, done! it's works

Copy link
Member

Choose a reason for hiding this comment

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

m_iVehicleSunGlare -> m_bVehicleSunGlare also

Copy link
Contributor Author

Choose a reason for hiding this comment

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

m_iVehicleSunGlare -> m_bVehicleSunGlare also

Roger that

@Inder00
Copy link
Contributor

Inder00 commented Jan 12, 2022

Marge time :shipit:

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants