Mtasa-blue: Pull request #752 (engineSet/getModelVisibleTime) not functioning corretly

Created on 27 Jun 2020  路  6Comments  路  Source: multitheftauto/mtasa-blue

Describe the bug
engineSet/getModelVisible time not fading out objects at the defined times.
Seems to make them appear 24/7.

To reproduce
local object = createObject(10625,0,0,0)
engineSetModelVisibleTime(10625,6,20)
watch as it doesn't fade out.
Please paste reproduction resources (zip files) directly into this section.

Expected behaviour
Should fade out object at night (Or day depending on the code)

Screenshots
https://cdn.discordapp.com/attachments/592475992149196841/726542220051611709/mta-screen_2020-06-27_16-59-07.png
image

^ That object should be a dark version

Version

  • Multi Theft Auto v1.5.7-release-20593
  • Windows

https://github.com/multitheftauto/mtasa-blue/pull/752

bug

Most helpful comment

I've tested this function on different builds. It works on debug build, but does not on release build. Even on supported models.

All 6 comments

Hi, your reproduction script has the two following issues:

  • setModelVisibleTime does not exist. It is engineSetModelVisibleTime
  • engineSetModelVisibleTime only works on model numbers, so you can't give it an object to only apply it to a single object

Please can you provide a valid reproduction script?

/cc @CrosRoad95

May bad I wrote this pretty late last night don't know what I was thinking. Updated.

This happens because, at the moment, engineSetModelVisibleTime only supports models that already have time info. It does not support adding time info to models that do not have it (are always visible by default).

You may have noticed engineSetModelVisibleTime returning false, and that's happening here: https://github.com/multitheftauto/mtasa-blue/blob/eb0b33965269a827c5c55b277bb27408629bf070/Client/game_sa/CModelInfoSA.cpp#L572-L574 (warning large file).

I'm closing this as it's not really a bug but I welcome pull requests that make it possible for this to work for models that don't already have time info.

I've tested this function on different builds. It works on debug build, but does not on release build. Even on supported models.

Hmm, just tried this:

run object = createObject(9934,0,0,5) 
crun engineSetModelVisibleTime(9934,0,24) 
run setMinuteDuration(1)

I can confirm it works in Debug but not Release. That's annoying. Nice catch Strix!

We should just disable this feature for 1.5.8 then

Was this page helpful?
0 / 5 - 0 ratings