Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] SetObjectMaterial() weird

 
  • 0 Vote(s) - 0 Average
Pawn SetObjectMaterial() weird
gokuta
Offline

Burgershot Member
Posts: 5
Threads: 2
Joined: Mar 2021
Reputation: 0
#1
2021-03-09, 10:31 AM (This post was last modified: 2021-03-09, 10:44 AM by gokuta.)
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 [font=Tahoma, Verdana, Arial, sans-serif]SetObjectMaterial without fucking up draw distance of my objects?[/font]
Virsenas
Offline

Burgershot Member
Posts: 47
Threads: 0
Joined: Feb 2021
Reputation: 6
#2
2021-03-09, 11:13 AM
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?
gokuta
Offline

Burgershot Member
Posts: 5
Threads: 2
Joined: Mar 2021
Reputation: 0
#3
2021-03-09, 11:36 AM (This post was last modified: 2021-03-09, 11:37 AM by gokuta.)
(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
Virsenas
Offline

Burgershot Member
Posts: 47
Threads: 0
Joined: Feb 2021
Reputation: 6
#4
2021-03-09, 01:46 PM
(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.
gokuta
Offline

Burgershot Member
Posts: 5
Threads: 2
Joined: Mar 2021
Reputation: 0
#5
2021-03-09, 02:08 PM
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...
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#6
2021-03-10, 02:05 AM
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.
Virsenas
Offline

Burgershot Member
Posts: 47
Threads: 0
Joined: Feb 2021
Reputation: 6
#7
2021-03-10, 07:51 AM
(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
gokuta
Offline

Burgershot Member
Posts: 5
Threads: 2
Joined: Mar 2021
Reputation: 0
#8
2021-03-10, 10:37 PM (This post was last modified: 2021-03-10, 10:46 PM by gokuta.)
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.
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#9
2021-03-11, 11:15 PM
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.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode