-
-
Notifications
You must be signed in to change notification settings - Fork 425
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 engineSet/GetModelVisibleTime #752
Add engineSet/GetModelVisibleTime #752
Conversation
Would add nearly 10 thousand new usable IDs. |
Great piece of work! Is it possible to make the model visible for the whole day and night without any break? I assume that if you use the time range from 0 to 23, the object would still invisible for one hour - please correct me if I'm wrong here. What about the time range from 0 to 0? Does the game support it on compatible models? Also may I suggest a different name for this property? In my personal opinion "model time" is a bit ambiguous... I think some more verbose name like |
I agree with the naming here, I was really confused as to what |
so what is the best name for this function? i also check once again did limit 0-23 is correct |
What is the difference between this function and simply setting alpha to 0/255 during certain hours of the day? |
Changed name to
This property overwrites alpha, even onClientRender with setElementAlpha will not be able to show object if is outside "visible time" |
I think we could maybe remove the ability to change the model's visible time, and just add a feature to make models always visible (irrespective of ingame time). Visible time can then be implemented in Lua, per each individual object as well! |
you can write function that loop all id's and set time 0,24 |
Having a function like this would greatly reduce the amount of code needed. To handle object time properties the script I use consists of around 70 lines of code. |
Gotta agree with @CrosRoad95 here, can't see anything wrong with giving people access to that, and it will reduce lua script length by a lot in systems like those. |
alright the API you've proposed will do. basically my concerns were to do with conflicting resources. if it becomes an issue, we can always implement a modelmanager or something like that as a resource. |
you can't see some object at day, this feature let you do this, look at example models: https://dev.prineside.com/en/gtasa_samp_model_id/customsearch/?c%5B%5D=5&s=id-asc&bc=-1&bb=-1&bt=-1&ba=-1 |
thank you |
Doesn't function as expected. Models that already have time cycle data still disappear. |
Can't reproduce this. run object = createObject(9934,0,0,5)
crun engineSetModelVisibleTime(9934,0,24)
run setMinuteDuration(1) Edit: @StrixG says that it only works in Debug, and I can reproduce this (it does not work in Release) |
This reverts commit 429c0b7.
…titheftauto#1588)" This reverts commit 0e03a42.
* Revert "Revert "Add engineSet/GetModelTime (#752)" (#1588)" This reverts commit 0e03a42. * Fix engineSet/GetModelTime don't work in release * Update Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp * Use new parser * Moved and renamed TimeInfoSA * Revert "Moved and renamed TimeInfoSA" This reverts commit f147e4e. * code improvements * Tweak formatting in CModelInfoSA.cpp Co-authored-by: Nikita Obrekht <obrekht@gmail.com> Co-authored-by: saml1er <danishroar@gmail.com>
This functions are responsible for nights object, you can adjust when object disappear/appear
List of nights objects https://github.com/multitheftauto/mtasa-resources/blob/master/%5Beditor%5D/editor_gui/client/browser/objects.xml#L310
Functions:
timeOn, timeOff = engineGetModelVisibleTime( modelID )
- returns when object disappear/appear, 0,0 if model is incompatible.bool engineSetModelVisibleTime( modelID, timeOn, timeOff )
- sets when object disappear/appeartime is between 0 and 23.
Example usage:
Example result: nights lights are visible at day ( between 10 and 12 )
Script that i used