• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] SetObjectMaterial() weird
#1
okay, I use this:?



Code:
new objectid = CreateObject(3174, 1345.0, -1400.0, 14.0, 0.0, 0.0, 0.0, 150.0);

SetObjectMaterial(objectid, 0, -1, "none", "none", 0xFFFFFFFF);



This line does almost nothing, it only removes vertex lightning. That's all. The problem is... draw distance suffers!!! I mean my object disappears quickly and abruptly at distance 150.0. First of all... no nice transitions, it disappears fast?and looks horrible.?Second of all... my personal draw distance settings are disregarded now.



Is it some undocumented?SetObjectMaterial flaw that cannot be fixed? How do I use?SetObjectMaterial without fucking up draw distance of my objects?
  Reply
#2
Load up an empty gamemode with just this one object and check how the draw distance works. If it is the same situation then maybe that object has a premade draw distance and you can't change it.



Do you create objects with CreateObject only? Or do you use a streamer?
  Reply
#3
(2021-03-09, 11:13 AM)Virsenas Wrote: Load up an empty gamemode with just this one object and check how the draw distance works. If it is the same situation then maybe that object has a premade draw distance and you can't change it.



Do you create objects with CreateObject only? Or do you use a streamer?



In this specific case I used plain CreateObject and no streamer. I believe?SetObjectMaterial works in such a way that it fucks up draw distance. And it remains fucked up even after I reset object using this line.



Code:
SetObjectMaterial(objectid, 0, -1, "none", "none", 0);



The real question is do we have a work around for this major draw-distance fuck-up :D I guess we do not...

Excuse me for profanities, but I am seriously disappointed at how flawed samp is
  Reply
#4
(2021-03-09, 11:36 AM)gokuta Wrote:
(2021-03-09, 11:13 AM)Virsenas Wrote: Load up an empty gamemode with just this one object and check how the draw distance works. If it is the same situation then maybe that object has a premade draw distance and you can't change it.







Do you create objects with CreateObject only? Or do you use a streamer?







In this specific case I used plain CreateObject and no streamer. I believe?SetObjectMaterial works in such a way that it fucks up draw distance. And it remains fucked up even after I reset object using this line.







Code:
SetObjectMaterial(objectid, 0, -1, "none", "none", 0);







The real question is do we have a work around for this major draw-distance fuck-up :D I guess we do not...



Excuse me for profanities, but I am seriously disappointed at how flawed samp is



https://open.mp/docs/scripting/functions/CreateObject



Check your CreateObject last parameter.
  Reply
#5
I set the last parameter to?150.0 and live happily with that. I can adjust draw distance through game settings as well. Unless I change object material, then I can adjust it no longer and also object does not fade away anymore, it simply disappears in a very ugly manner. You try to help, but no real solutions so far...
  Reply
#6
You set the drawdistance to 150, so yes, it vanishes at 150. That's not a bug, that's what you explicitly requested If you want it higher set it higher. If you want LOD, create a LOD object.



Also, did you know that you can edit posts? You don't need to apologise for your language, you can just remove it.
  Reply
#7
(2021-03-10, 02:05 AM)Y_Less Wrote: You set the drawdistance to 150, so yes, it vanishes at 150.? That's not a bug, that's what you explicitly requested? If you want it higher set it higher.? If you want LOD, create a LOD object.







Also, did you know that you can edit posts?? You don't need to apologise for your language, you can just remove it.





Actually I did test this. Even if you don't set the draw distance to 150 for the object and leave it to default, when you apply the material change the objects draw distance somehow shortens.



https://www.youtube.com/watch?v=Iz2EqlXGx7k



https://www.youtube.com/watch?v=8GK6tcce6a8
  Reply
#8
Y_Less, I would expect you to be familiar with the problem :D weirdly enough you are not. When color is not set, draw distance can be changed with personal settings (graphics ->advanced)?and not only that, the object also fades in/out nicely (unless draw distance is more than 299.0, in which case expect no nice fading). After color is set, draw distance CANNOT be changed with personal settings and more importantly, object DOES NOT fade in/out anymore, it simply disappears/reappears abruptly. I taught you something new, congrats

I would also like someone to find a work-around on how to fix the fading...?



Virsenas, actually after color is set, draw distance is exactly to what it has been set. And without color change draw distance is personal settings dependent. It can be extended with personal settings.
  Reply
#9
Yes, but it still sounds like now with the colour the code is doing what you wanted, but without the colour the code isn't. So the after code is more correct - it is using the distance you specified, while before it was incorrectly ignoring it. If you want a higher draw distance, specify a higher draw distance.
  Reply


Forum Jump: