[Include] All GTA SA Object Array
#21

It is possible to add to Texture Studio to make an in game object remover there is a function that will automatically do this for you.

pawn Code:
AddRemoveBuilding(model, Float:x, Float:y, Float:z, Float:range, savesql = true)
What you would need to is create your own tool to show all the objects I could write a module for you I guess it's maybe 30 minutes work at most basically all I would do is loop through the list and create Text labels for every object in the game with the corresponding array reference id then it would be a matter of /deleteobject <id> .
Reply
#22

Okay, if possible in 1.5 relase the /deleteobject<id> or whenever
this will help so many mapers/scripters ,
i tryed remove the blueberry hills, i found original object cords in GTA:SA directory and imported i only changed the dirty road texture..
i only need something to replace original GTA:SA textures with textures from Texture studio ..
like i said i replaced blueberry hill texture i take 1 hour for this all cords to find all etc ....
i will PM you the screenshoot so you will se what i mean
something like (ingame GTA:SA object texturing and removing original objects)
Reply
#23

Where are the road and landscapes objects?
Reply
#24

very usefull.. i needed this many times but there were no object list, before.. thx
Reply
#25

The object list is incomplete, some terrain objects are missing. Also have you found the quaternion conversion function?
Reply
#26

Pottus, is there any github repository for this? I would like to make some updates on it if you approves me, actually it takes so long time to compile when it could just compile instantly and take 8 or 9 seconds only to read the data from a custom file which I loop to parse all the data and fill up the array when the gamemode/filterscript init, also, it shouldn't cause problems for systems which uses the include array on the same callback (OnGameModeInit/OnFiterScriptInit) cause well, since it's a hook, it's loaded previously from the original data... So, do I have your permission?
Reply
#27

Quote:
Originally Posted by ipsLeon
View Post
Pottus, is there any github repository for this? I would like to make some updates on it if you approves me, actually it takes so long time to compile when it could just compile instantly and take 8 or 9 seconds only to read the data from a custom file which I loop to parse all the data and fill up the array when the gamemode/filterscript init, also, it shouldn't cause problems for systems which uses the include array on the same callback (OnGameModeInit/OnFiterScriptInit) cause well, since it's a hook, it's loaded previously from the original data... So, do I have your permission?
I actually already have everything in this file in a database on the Texture Studio repo. I'm going to update TS to use it instead of the big ass array.

allbuildings.db
Reply
#28

Quote:
Originally Posted by Crayder
View Post
I actually already have everything in this file in a database on the Texture Studio repo. I'm going to update TS to use it instead of the big ass array.

allbuildings.db
Yeah man that's what I'm talking about, it's awesome
Reply
#29

You can build the data to a filterscript and then access them from any script. See this. Just include allobjectsmini and use GetSearchInfo like SearchData[id].
Reply
#30

Edit (02/11/2015) - 06:11PM: Updated

I edited my version of this script, it compiles now really really fast and the whole San Andreas structure is loaded when the gamemode is started (takes 2 or 3 seconds to be fully loaded), so if you're going to use it, make sure that you'll place the read function on the top of your "OnGameModeInit" callback.

Example:

Code:
public OnGameModeInit()
{
  Read_SA_MAP();//reads the array of all gta:sa objects
  return 1;
}
File parser and structure (I changed the name of them but you can easily change it by yourself):

Code:
#define MAX_SA_OBJECTS  44764//updated

enum SA_MAP_INFO
{
  SA_MAP_Model,
  SA_MAP_LODModel,
  SA_MAP_Model_Name[32],
  Float:SA_MAP_X,
  Float:SA_MAP_Y,
  Float:SA_MAP_Z,
  Float:SA_MAP_RX,
  Float:SA_MAP_RY,
  Float:SA_MAP_RZ
};

new SA_MAP_Object[MAX_SA_OBJECTS][SA_MAP_INFO];

stock Read_SA_MAP()
{
  print("Parsing GTA:SA objects array.");
  new index, line[256], File:file_ptr;

  file_ptr = fopen("sanandreasarray.db", filemode:io_read);

  if(!file_ptr) return print("Error, server could not find SanAndreasArray.db");

  while(fread(file_ptr, line) > 0)
  {
    if(!sscanf(line, "p<,>dds[32]ffffff",
    SA_MAP_Object[index][SA_MAP_Model], SA_MAP_Object[index][SA_MAP_LODModel], SA_MAP_Object[index][SA_MAP_Model_Name],
    SA_MAP_Object[index][SA_MAP_X], SA_MAP_Object[index][SA_MAP_Y], SA_MAP_Object[index][SA_MAP_Z],
    SA_MAP_Object[index][SA_MAP_RX], SA_MAP_Object[index][SA_MAP_RY], SA_MAP_Object[index][SA_MAP_RZ]))
    {
      index++;
    }
  }
  fclose(file_ptr);
  printf("Server sucessfully parsed %d GTA:SA objects data.", index);
  return 1;
}
And last but not least, place the array database file on your scriptfiles folder:

Database download link (updated)

This process will save you too much time for compiling your script, you won't have to wait so much time to use this array anymore, all credits goes to Pottus, have fun
Reply
#31

I am pretty sure this array is fucked up I need to update it I have a much better version in Texture Studio.
Reply
#32

Quote:
Originally Posted by Pottus
View Post
I am pretty sure this array is fucked up I need to update it I have a much better version in Texture Studio.
Please give me the new array, I need to use accurate data on my script D:
Reply
#33

Quote:
Originally Posted by s0nny
View Post
Please give me the new array, I need to use accurate data on my script D:
The updated version has been uploaded check the first page.
Reply
#34

Quote:
Originally Posted by Pottus
View Post
The updated version has been uploaded check the first page.
Thanks for sharing
Reply
#35

I don't think those rotation data are good enough. GTA SA follows a very weird rotation format. I am sure that you use quaternion - euler conversions, but those rotations should be not considered as x,y,z. The rotation here should be considered as yaw(z axis, should be inverted i.e. -yaw), pitch(y axis), roll(x axis). Believe me I tried your conversion algorithm but it didn't worked out well(for me, maybe), there could be a fault in my part as well. This is why I want you to try out the rotations conversions and apply them once again.
Reply
#36

Quote:
Originally Posted by codectile
View Post
I don't think those rotation data are good enough. GTA SA follows a very weird rotation format. I am sure that you use quaternion - euler conversions, but those rotations should be not considered as x,y,z. The rotation here should be considered as yaw(z axis, should be inverted i.e. -yaw), pitch(y axis), roll(x axis). Believe me I tried your conversion algorithm but it didn't worked out well(for me, maybe), there could be a fault in my part as well. This is why I want you to try out the rotations conversions and apply them once again.
I think it's good enough for the main purpose of it, remove objects, but yeah quaternions improvement would be really nice.
Reply
#37

Quote:
Originally Posted by ipsLeon
View Post
I think it's good enough for the main purpose of it, remove objects, but yeah quaternions improvement would be really nice.
While developing cimulator I needed a function to convert quat-euler angles to simulate object rotation in SanAndreas and I implemented the conversion algorithm from ColAndreas(I was too lazy to code on my own) and believe me the result was not at all good. I resolved my problem by doing some research on GTA angles and used bullet's in built mechanism to generate accurate euler rotations. As I've previously said there could be a fault on my side, to be sure I want him to test it again.
Reply
#38

So is there finally an object array both having correct angles and containing all the objects?
Reply
#39

Quote:
Originally Posted by sprtik
View Post
So is there finally an object array both having correct angles and containing all the objects?
Ofcourse, this include contains it, not a hundred percent but it's pretty much accurate.
Reply
#40

Quote:
Originally Posted by sprtik
Посмотреть сообщение
So is there finally an object array both having correct angles and containing all the objects?
The fact is, it has never been as bad as people say. When it is wrong (which I've NEVER been able to find an object that wrong IG), it won't be off by much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)