Find all item\block id's

Need help with using DizzyAGE then look here
A Cool Guy
Free Range Egg
Posts: 41
Joined: Sat Jul 24, 2010 12:17 pm
Contact:

Find all item\block id's

Postby A Cool Guy » Thu May 11, 2017 2:12 pm

Is there a way to find all item\block\collider id's that i have placed on the map?
I ask as i have fogetten all the item id's that i have placed and now when i try coding things they react in the wrong way cause the id's are wrong or the same :(

Meph
Hard Boiled Egg
Posts: 2947
Joined: Fri Apr 13, 2007 12:47 am
Location: England, Suffolk
Contact:

Re: Find all item\block id's

Postby Meph » Thu May 11, 2017 5:27 pm

If you press the magnifying glass in the map editor you can use to to search for brushes, objects or anything else, just select what you want to find, tick the box and press search.

But this will be more useful for you.
While on 'view mode' in the editor you can right click and object which will open a small menu and if you click 'props' it'll show you all the properties of that objects (such as ID numbers)

VK007
Your Backpack is Empty
Posts: 12
Joined: Tue Aug 16, 2016 2:26 pm

Re: Find all item\block id's

Postby VK007 » Thu May 11, 2017 8:58 pm

Also, to find all brushes with duplicate ids you can press space and run script "check duplicate ids" in "debug scripts" menu.

A Cool Guy
Free Range Egg
Posts: 41
Joined: Sat Jul 24, 2010 12:17 pm
Contact:

Re: Find all item\block id's

Postby A Cool Guy » Fri May 12, 2017 3:17 pm

Thanks but i found a way :)
I used this script and added it to the editor.gs file.

Code: Select all

//////////////////
//Show ID's
//////////////////
func ScrShowId()
{
   println("Check Brush Id:");
   brushcount=MapBrushCount();
   
   // make id list
   WaitCursor(1);
   idxlist = tab(0); // collect idx of brushes with id
   info="  ";
   countinfo=0;
   for(i=0;i<brushcount;i++)
   {
      id = MapBrushGet(i,BRUSH_ID);
      MapBrushSet(i,BRUSH_SELECT,0);
      if(id==0) continue;
      tabadd(&idxlist,1);
      idxlist[sizeof(idxlist)-1] = i;
      countinfo++;
      if(id!=0) info += ""+(str)id+"  ";
      if(countinfo==30) info += "\n";
      if(countinfo==60) info += "\n";
      if(countinfo==90) info += "\n";
      if(countinfo==120) info += "\n";
      if(countinfo==150) info += "\n";
      if(countinfo==180) info += "\n";
   }
   WaitCursor(0);
   EdiSet(EDI_SELECT,0);
   if(sizeof(idxlist)==0) { MsgBoxOk("Message", "no brushes with ids found.", ICON_INFO); return; }
   
   // check duplicates
   duplicates=0;
   WaitCursor(1);
   for(i=0;i<sizeof(idxlist);i++)
   {
      for(j=0;j<i;j++)
      {
         id1=MapBrushGet(idxlist[i],BRUSH_ID);
         id2=MapBrushGet(idxlist[j],BRUSH_ID);
         if(id1!=id2)
         {
            if(!MapBrushGet(idxlist[i],BRUSH_SELECT))
            {
               MapBrushSet(idxlist[i],BRUSH_SELECT,0);
               println("bursh #",i," duplicate id=",id1);
               duplicates++;
            }
            if(!MapBrushGet(idxlist[j],BRUSH_SELECT))
            {
               MapBrushSet(idxlist[j],BRUSH_SELECT,0);
               println("bursh #",j," duplicate id=",id2);
               duplicates++;
            }
         }
      }
   }
   WaitCursor(0);
   EdiSet(EDI_SELECT,duplicates);
   if(duplicates)
      MsgBoxOk("INFO",   (str)sizeof(idxlist)+" brushes with id's the id numbers are\n"+(str)info+" \nNo Brushes Selected.", ICON_INFO ); //Original icon name is ICON_WARNING
   else
      MsgBoxOk("Message",   (str)sizeof(idxlist)+" brushes with ids", ICON_INFO );
}