SA-MP Forums

Go Back   SA-MP Forums > SA-MP DL Edition > SA-MP 0.3.DL

Reply
 
Thread Tools Display Modes
Old 01/03/2019, 06:36 PM   #1
Yaozu
Little Clucker
 
Yaozu's Avatar
 
Join Date: May 2018
Location: UK, River Styx
Posts: 42
Reputation: 65
Post Object Flag Values/Utilising flags

Just thought I'd share some knowledge of object flags and their characteristics and ranges.
I hope this information helps for people wanting or are currently using DL.

You cannot assign flags to existing objects from the base game, this only applies to server sided objects. However you could if you duplicate the object for server sided use.

**Note, not all flags work.

Flag Range Example:

00000000000000000000000001XXXXX = Start of Interior Object range
0000000000000000000000001000000 = End of Interior Object range, Start of Disable Shadow Mesh range


For example, from decimal values 32 to 63 are assigned the characteristic of an interior object.

32 Start of Interior-Object range
63 End of Interior-Object range
64 Start of Disable Shadow Mesh range


Code:
Binary                          Decimal   Description

0000000000000000000000000000000	0	  Disable Flags
0000000000000000000000000000001	1	  Wet Effect
0000000000000000000000000000010	2	  Time Object Night Flag
0000000000000000000000000000100	4	  ALPHA Transparency 1
0000000000000000000000000001000	8	  ALPHA Transparency 2 *
0000000000000000000000000010000	16	  Time Object Day Flag
0000000000000000000000000100000	32	  Interior-Object **
0000000000000000000000001000000	64	  Disable Shadow Mesh
0000000000000000000000010000000	128	  Excludes object from culling
0000000000000000000000100000000	256	  Disable Draw Distance for LODs
0000000000000000000001000000000	512	  Breakable Glass **
0000000000000000000010000000000	1024	  Breakable Glass with crack **
0000000000000000000100000000000	2048	  Garage door **
0000000000000000001000000000000	4096	  2-Clump-Object ** (Switches from Clump 2 to 1 after Collision)
0000000000000000010000000000000	8192	  Small Vegetation. Object sways in strong wind (?)
0000000000000000100000000000000	16384     Standard Vegetation ** (Palms in Hotels, etc.) (?)
0000000000000001000000000000000	32768     Use timecycle PoleShadow flag
0000000000000010000000000000000	65536     Explosive-Flag **
0000000000000100000000000000000	131072    UNKNOWN (Seems to be an SCM Flag) (?)
0000000000001000000000000000000	262144    UNKNOWN (1 Object in Jizzy`s Club) (?)
0000000000010000000000000000000	524288    UNKNOWN (?)
0000000000100000000000000000000	104857    Graffiti Flag
0000000001000000000000000000000	209715    Disable backface culling
0000000010000000000000000000000	4194304   UNKNOWN (Parts of a statue in Atrium) (?)
... All flags in this range are unused/unknown
1000000000000000000000000000000	1073741824	Unknown

Reference: https://gta.fandom.com/wiki/OBJS#Object_Flags
To make use of flags for your custom objects please use the following in a fliterscript (This is edited from the VC2SA conversation posted by Kalcor).

How to use:

You must first add your object by either using:

AddCUSTOMSimpleObject(flag,modelid,"Location of DFF","Location of TXD");
AddCUSTOMSimpleTimed(flag,timeon,timeoff,modelid," Location of DFF","Location of TXD"); //Add your object to the server (But set a time you want it to appear and when to disappear)

You can then create and position your custom object using:

CreateCUSTOMObject(modelid,posX,posY,posZ,rotX,rot Y,rotZ,drawdist,seefromfaraway); //Create/Position the object in CUSTOM_VWORLD -1

Or if it's a custom interior object use

CreateCUSTOMIntObject(modelid,posX,posY,posZ,rotX, rotY,rotZ,drawdist,seefromfaraway); //Create/Position the object in Interior World 1


Code:
#include <a_samp>
#include <streamer>
#include "../include/gl_common.inc"

#define CUSTOM_VWORLD   -1

//-------------------------------------------------

public OnFilterScriptInit()
{
	Streamer_VisibleItems(STREAMER_TYPE_OBJECT, 2000);
	AddAll_CUSTOM_Models();
	CreateAll_CUSTOM_Objects();
	CreateAllCUSTOMInteriors();
	return 1;
}

//-------------------------------------------------

new modelflags_flags[68] = {0,2097152,4,2097156,2097284,2097220,2097280,128,68,5,132,2,2048,64,140,2176,2099328,2097348,
196,1,129,8321,192,4100,4096,8192,32896,2162816,2130052,32900,2130048,32768,1048580,32,160,164,2097184,262148,65536,69,
2097157,2180,2097153,130,8196,131072,1024,1028,516,8324,2105476,2105348,12420,4194304,2098180,2098244,6,640,2146436,2113668,
2113540,2113536,2129924,2138244,2138116,2109572,2146308,2101248};
new modelflags_index[68] = {18631,18636,18637,18656,18783,19197,19489,19490,19605,19628,19857,11089,11102,11306,11324,8948,
9099,16013,16448,12800,13116,13273,17978,990,994,17040,1223,1225,1278,1306,1315,1350,1490,1491,1492,1493,1533,14547,14570,
4596,6489,6517,5750,3781,3948,2969,3034,1649,1651,800,881,882,904,2756,3850,3857,13595,8197,620,624,629,649,658,670,693,738,
739,1138};

FindModelIDForFlags(flags)
{
	flags &= 0xFFFFFFDF; // remove the interior flag
	
	new x=0;
	while(x!=68) {
	    if(modelflags_flags[x] == flags) return modelflags_index[x];
	    x++;
	}
	return 19353;
}

//-------------------------------------------------

CreateCUSTOMObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDist, hadfarawaymodel)
{
	new streamer_objectid;
	streamer_objectid = CreateDynamicObject(modelid,X,Y,Z,rX,rY,rZ,CUSTOM_VWORLD, .interiorid = 0);
	DrawDist *= 2.0;
	Streamer_SetFloatData(STREAMER_TYPE_OBJECT, streamer_objectid, E_STREAMER_STREAM_DISTANCE, DrawDist + 50.0);
	Streamer_SetFloatData(STREAMER_TYPE_OBJECT, streamer_objectid, E_STREAMER_DRAW_DISTANCE, DrawDist);
	
	if(hadfarawaymodel) {
	    Streamer_SetFloatData(STREAMER_TYPE_OBJECT, streamer_objectid, E_STREAMER_STREAM_DISTANCE, 1000.0 + DrawDist + 50.0);
		Streamer_SetFloatData(STREAMER_TYPE_OBJECT, streamer_objectid, E_STREAMER_DRAW_DISTANCE, 1000.0 + DrawDist);
	}
	
	return streamer_objectid;
}

//-------------------------------------------------

AddCUSTOMSimpleObject(flags,newmodelid,dffpath[],txdpath[])
{
	AddSimpleModel(CUSTOM_VWORLD,FindModelIDForFlags(flags),newmodelid,dffpath,txdpath);
}

//-------------------------------------------------

AddCUSTOMSimpleTimed(flags,timeon,timeoff,newmodelid,dffpath[],txdpath[])
{
	AddSimpleModelTimed(CUSTOM_VWORLD,FindModelIDForFlags(flags),newmodelid,dffpath,txdpath,timeon,timeoff); // wax on/wax off
}

//-------------------------------------------------

CreateAll_CUSTOM_Objects() 
{
CreateCUSTOMObject(modelid,posX,posY,posZ,rotX,rotY,rotZ,drawdist,seefromfaraway); //Create/Position the object in CUSTOM_VWORLD -1
}

//-------------------------------------------------

AddAll_CUSTOM_Models() 
{
AddCUSTOMSimpleObject(flag,modelid,"Location of DFF","Location of TXD"); //Add your object to the server
AddCUSTOMSimpleTimed(flag,timeon,timeoff,modelid,"Location of DFF","Location of TXD"); //Add your object to the server (But set a time you want it to appear and when to disappear)
}
//-------------------------------------------------

CreateCUSTOMIntObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ, Float:DrawDist, hadfarawaymodel)
{
	new streamer_objectid;
	streamer_objectid = CreateDynamicObject(modelid,X,Y,Z,rX,rY,rZ, .interiorid = 1);
	DrawDist *= 2.0;
	Streamer_SetFloatData(STREAMER_TYPE_OBJECT, streamer_objectid, E_STREAMER_STREAM_DISTANCE, DrawDist + 50.0);
	Streamer_SetFloatData(STREAMER_TYPE_OBJECT, streamer_objectid, E_STREAMER_DRAW_DISTANCE, DrawDist);
	
	if(hadfarawaymodel) {
	    Streamer_SetFloatData(STREAMER_TYPE_OBJECT, streamer_objectid, E_STREAMER_STREAM_DISTANCE, 1000.0 + DrawDist + 50.0);
		Streamer_SetFloatData(STREAMER_TYPE_OBJECT, streamer_objectid, E_STREAMER_DRAW_DISTANCE, 1000.0 + DrawDist);
	}
	
	return streamer_objectid;
}

CreateAllCUSTOMInteriors()
{
	CreateCUSTOMIntObject(modelid,posX,posY,posZ,rotX,rotY,rotZ,drawdist,seefromfaraway); //Create/Position the object in Interior World 1 
}
__________________

Last edited by Yaozu; 02/03/2019 at 11:10 PM.
Yaozu is offline   Reply With Quote
Old 01/03/2019, 08:38 PM   #2
Swarn
Big Clucker
 
Join Date: Sep 2015
Posts: 135
Reputation: 19
Default Re: GTA SA Object Flag Values

Thanks repping for your contribution
Swarn is offline   Reply With Quote
Old 01/03/2019, 09:41 PM   #3
feartonyb
Huge Clucker
 
feartonyb's Avatar
 
Join Date: Feb 2012
Location: Knin, Croatia
Posts: 331
Reputation: 12
Default Re: GTA SA Object Flag Values

Thanks

Rep+
feartonyb is offline   Reply With Quote
Old 02/03/2019, 09:25 PM   #4
Kasis
Huge Clucker
 
Kasis's Avatar
 
Join Date: Mar 2010
Location: Weed, New Mexico
Posts: 495
Reputation: 72
Default Re: GTA SA Object Flag Values

Very interesting, so are these values in .dff ? How do I edit them?
__________________
Kasis is offline   Reply With Quote
Old 02/03/2019, 10:54 PM   #5
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,422
Reputation: 157
Default Re: GTA SA Object Flag Values

Thank you.
N0FeaR is offline   Reply With Quote
Old 02/03/2019, 11:03 PM   #6
Yaozu
Little Clucker
 
Yaozu's Avatar
 
Join Date: May 2018
Location: UK, River Styx
Posts: 42
Reputation: 65
Default Re: GTA SA Object Flag Values

Quote:
Originally Posted by Kasis View Post
Very interesting, so are these values in .dff ? How do I edit them?
Yes the values are for custom objects only.

I have added more onto the original post to enable people to utilise the flags for their custom models.
__________________
Yaozu is offline   Reply With Quote
Old 02/03/2019, 11:53 PM   #7
NaS
High-roller
 
NaS's Avatar
 
Join Date: Mar 2008
Location: 🇩🇪
Posts: 1,682
Reputation: 516
Default Re: GTA SA Object Flag Values

Some flags in your list are incorrect or misinterpreted.

4 - Render this object last. Allows other objects with transparity to be visible through it
8 - Additive blending (used for night windows)
32 - Related to Anim Objects (moving Doors to be specific)
64 - No Z-Buffer - allows other objects, shadows and lights to be visible through it if transparent
128 - disables drawing shadows from other objects (but it still produces its own shadow) - used for small objects like pickups
4194304 - prevents peds from using it as cover - used for the atrium statue as it breaks in the process and can be shot through, probably added for this specific mission only

2 and 16 are set for objects in the TOBJ section by the game but not read from the IDE
65536 - same as above but it's set if the object is defined as explosive in object.dat
NaS is offline   Reply With Quote
Old 03/03/2019, 12:46 AM   #8
Yaozu
Little Clucker
 
Yaozu's Avatar
 
Join Date: May 2018
Location: UK, River Styx
Posts: 42
Reputation: 65
Default Re: GTA SA Object Flag Values

Quote:
Originally Posted by NaS View Post
Some flags in your list are incorrect or misinterpreted.

4 - Render this object last. Allows other objects with transparity to be visible through it
8 - Additive blending (used for night windows)
32 - Related to Anim Objects (moving Doors to be specific)
64 - No Z-Buffer - allows other objects, shadows and lights to be visible through it if transparent
128 - disables drawing shadows from other objects (but it still produces its own shadow) - used for small objects like pickups
4194304 - prevents peds from using it as cover - used for the atrium statue as it breaks in the process and can be shot through, probably added for this specific mission only

2 and 16 are set for objects in the TOBJ section by the game but not read from the IDE
65536 - same as above but it's set if the object is defined as explosive in object.dat
It's just really that some of the descriptions are a little vague so thank you for expanding on that.
Also thank you for giving a little bit more context.
__________________
Yaozu is offline   Reply With Quote
Old 03/03/2019, 11:23 AM   #9
Kasis
Huge Clucker
 
Kasis's Avatar
 
Join Date: Mar 2010
Location: Weed, New Mexico
Posts: 495
Reputation: 72
Thumbs up Re: GTA SA Object Flag Values

Quote:
Originally Posted by Yaozu View Post
Yes the values are for custom objects only.

I have added more onto the original post to enable people to utilise the flags for their custom models.
Thanks, will do some experimenting soon.
__________________
Kasis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Capture the Flag DragonZafiro Filterscripts 4 03/04/2016 05:23 PM
Problem with object rotation values Rimeau Scripting Help 2 05/07/2014 11:47 AM
Red Flag on Map? Eminem 2ka9 Scripting Help 7 18/03/2013 03:53 AM
Checking if near a flag. Dan. Scripting Help 6 13/05/2012 04:36 PM
[HELP] Object id, Flag jonybomb Help Archive 9 07/08/2010 04:59 PM


All times are GMT. The time now is 07:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.