Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new world special property (vehicle sun glare effect) #2495

Merged
merged 21 commits into from Jan 22, 2022
Merged

Add new world special property (vehicle sun glare effect) #2495

merged 21 commits into from Jan 22, 2022

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
Contributor

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
@@ -33,17 +33,43 @@ float* CGameSA::VAR_TimeStep;
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
Contributor

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

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
Contributor

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
Contributor

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:

@TheNormalnij TheNormalnij merged commit 1fac287 into multitheftauto:master Jan 22, 2022
Zangomangu pushed a commit to Zangomangu/mtasa-blue that referenced this pull request Mar 19, 2022
…auto#2495)

Co-authored-by: Uladzislau Nikalayevich <thenormalnij@gmail.com>
@patrikjuvonen patrikjuvonen added this to the Next Release (1.6.0) milestone Aug 24, 2022
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.

None yet

5 participants