readme; This Include gives you the exact distance the Object is visible in GTA San Andreas. All distances are collected from the GTA IDE Files and contains normal Objects, timed-Objects and animated Objects. Why should you use this? If you have many objects in your script and you stream all of them at a distance of 200 units,this might not be very clever because some of those objects get streamed by GTA at distance of 100 units or even 250 units. Streaming the object then at a distance of 200 units is either to high or too low. This include will help you and give you the distance the object will be streamed by GTA, no matter from which distance you want it to get streamed It is very usefull in combination with an Object streamer, I would advise you to use the one by Incognito ( Incognitos Streamer Plugin ). At the moment it is the best one you can find for SA:MP ! Usage: GetObjectMaxDistance( #MODELID , #DEFAULT_DISTANCE ); #MODELID , the modelid you want to get the distance for if you use an invalid MODELID,it will return the #DEFAULT_DISTANCE #DEFAULT_DISTANCE , this is used in case you use an invalid #MODELID the function will then return you given value instead of a random one CreateDynamicObjectEX( ... ); An extra function you might choose if you use the Streamer Plugin by Incognito. You only have to rename the function CreateDynamicObject() to CreateDynamicObjectEX(). I added an extra parameter at the end which add an extra_distance to the draw distance COMPILE_OPTIONS : - FAST_VERSION , Doesn't include Debug-Informations - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - gStream_Help.inc - 297 kb ; 18500 functions call @ 8ms gStream_Compress_Help.inc - 41,8 kb ; 18500 functions call @ 8ms ( some extra calls,slighty slower ) !! Important !! Limits the MaxDistance to 512 Units ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - by Daniel "Goldkiller" , gStream Helper 8.11.2010 IMPORTANT: DO NOT CHANGE THE ARRAY IN IT'S ORDER OR YOU WILL GET WRONG RETURN VALUES! |
You shift values by 10 and 20, but then mask them by 1FF when you could use 3FF and get a max view distance of 1023 without modifying any other code.
|
The one thing I've thought of before is a LOD lookup table so where LOD versions of models are available, creating an object will also create a LOD version with a much higher view distance in the streamer.
|
Answers in reverse order for no good reason...
The LOD thing would be a bit of work - that's the main reason I've not done it. |
//fDistance , iLODModelID,
// fDistance , should be clear, the draw distance
// iLODModelID , the modelid of the LOD parent.
// IS_PARENT , this model is an LOD parent
// NO_PARENT , this model doesn't have a LOD parent.
{110.0, IS_PARENT}// 7861
{130.0, IS_PARENT}// 7862
{230.0, 7876}// 7863
{230.0, 7875}// 7864
{230.0, 7874}// 7865
{230.0, 7872}// 7866
{230.0, 7871}// 7867
{230.0, 7870}// 7868
{1500.0, IS_PARENT}// 7869
{1500.0, IS_PARENT}// 7870
{1500.0, IS_PARENT}// 7871
{1500.0, IS_PARENT}// 7872
{1500.0, IS_PARENT}// 7873
{1500.0, IS_PARENT}// 7874
{1500.0, IS_PARENT}// 7875
{1500.0, IS_PARENT}// 7876
{1500.0, IS_PARENT}// 7877
{230.0, NO_PARENT}// 7878
{1500.0, IS_PARENT}// 7879
{195.0, 7887}// 7880
{230.0, 7855}// 7881
{270.0, 7883}// 7882
{1500.0, IS_PARENT}// 7883
{170.0, NO_PARENT}// 7884
...
CreateObject: Float : DrawDistance (optional) The distance that San Andreas renders objects. 0.0 will cause objects to render at their default distances. 300.0 is the usable maximum. |