YolkfolkThe Dizzy Fansite 0 logged in0 playing
Community discussion

Find all itemblock id's

Started by A Cool Guy on 11 May 2017 • 4,210 views

4 posts
#55660
Is there a way to find all itemblockcollider 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 :sad:
👍 0
#85602
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)
👍 0
#85603
Also, to find all brushes with duplicate ids you can press space and run script "check duplicate ids" in "debug scripts" menu.
👍 0
#85606

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

//////////////////
//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<span style="font-size: ofpx;"> = 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&lt;sizeof(idxlist);i++)
	{
		for(j=0;j&lt;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 aren"+(str)info+" nNo Brushes Selected.", ICON_INFO ); //Original icon name is ICON_WARNING
	else
		MsgBoxOk("Message",	(str)sizeof(idxlist)+" brushes with ids", ICON_INFO );
}

 

👍 0