-
-
Couldn't load subscription status.
- Fork 496
Fix random foliage on replaced collisions #2678
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
Fix random foliage on replaced collisions #2678
Conversation
Fix random foliage on custom collisions
This changes MTA current default behavior and may be unwanted in a number of cases so I think we should introduce some way (client-side Lua) to toggle this flag before merging as such.
Also, does randomfoliage world property affect this?
This changes MTA current default behavior and may be unwanted in a number of cases so I think we should introduce some way (client-side Lua) to toggle this flag before merging as such.
There is engineSetSurfaceProperties function with disabled createobjects and createplants flag:
mtasa-blue/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp
Lines 611 to 615 in cd1d208
mtasa-blue/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp
Lines 1280 to 1288 in ebf54d4
//edit:
I have created issue about that: #2681.
This changes MTA current default behavior and may be unwanted in a number of cases so I think we should introduce some way (client-side Lua) to toggle this flag before merging as such.
Appropriate materials assigned in the collision are required for this to generate. Most servers use material 0 in their collisions, so I think lua function is unnecessary.
Also, does randomfoliage world property affect this?
setWorldSpecialPropertyEnabled works fine with this
There is
engineSetSurfacePropertiesfunction with disabledcreateobjectsandcreateplantsflag:
But engineSetSurfaceProperties works completely different.
This changes MTA current default behavior and may be unwanted in a number of cases so I think we should introduce some way (client-side Lua) to toggle this flag before merging as such.
Appropriate materials assigned in the collision are required for this to generate. Most servers use material 0 in their collisions, so I think lua function is unnecessary.
Also, does randomfoliage world property affect this?
setWorldSpecialPropertyEnabledworks fine with thisThere is
engineSetSurfacePropertiesfunction with disabledcreateobjectsandcreateplantsflag:But
engineSetSurfacePropertiesworks completely different.
Ok thanks for clarification. I think we just need to test this and try the existing property function on this.
Great find all in all.
Fixes #2694
When you unload the resource, the foliage stays there. Probably should be fixed, but can be worked around by warping out of stream distance and warping back (and maybe some other method). engineRestreamWorld did not remove the foliage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unloading issue should be addressed somehow in my opinion. But other than that ok.
When you unload the resource, the foliage stays there. Probably should be fixed, but can be worked around by warping out of stream distance and warping back (and maybe some other method). engineRestreamWorld did not remove the foliage.
Foliage also stays when you use removeWorldModel in current MTA version on original models, so this is not an issue with this PR.
obraz
Foliage also stays when you use removeWorldModel in current MTA version on original models, so this is not an issue with this PR.
Thanks for clarifying. Maybe we'll create a new issue for that.
Uh oh!
There was an error while loading. Please reload this page.
This PR introduces fix for random foliage on custom collisions.
Fixes #2694
This is how custom model and custom collision looks like on current MTA version:
mta-screen_2022年07月22日_15-35-06
This is how it looks after this fix:
mta-screen_2022年07月22日_15-36-42
test_resource.zip