[[http://www.siedler-games.de|{{:sg-link.jpg|}}]] ====== Messen ====== FIXME {{utilfunctions:messen.png?400x300}} \\ \\ Um diesen Code zu verwenden benötigt man die Funktion [[tutorials:map_version_anzeigen|MapVersion_InitMapInfoButton()]]!! \\ \\ FMA: StartSimpleJob("Messen") StartSimpleHiResJob("Messen2") function Messen2() local posX,posY=GUI.Debug_GetMapPositionUnderMouse() DestroyEntity(messEntity) messEntity=Logic.CreateEntity(Entities.XD_CoordinateEntity,posX,posY,0,1) end function Messen() local posX,posY=GUI.Debug_GetMapPositionUnderMouse() local eType,eName,ePosX,ePosY,ePos,eWinkel,ePlayer,entity,eData local cr=" @cr " eData={} if messEntity then end GibEntity = function (_entity) -- zum Abkürzen if table.getn(eData)==0 and _entity ~= "XD_CoordinateEntity"then GibEntity1(_entity) end end GibEntity1= function (_entity) local Data = { Logic.GetEntitiesInArea( Entities[_entity], posX, posY, 100, 20)}; if Data[1]>0 then table.insert(eData,Data[2]) end end GUI.MiniMapDebug_SetText("Maus-Position "..cr.."X= "..math.floor(posX)..cr.." Y= "..math.floor(posY)) table.foreach(Entities,GibEntity) if table.getn(eData)>0 then entity=eData[1] end if entity then eType=Logic.GetEntityTypeName(Logic.GetEntityType(entity)) eWinkel=Logic.GetEntityOrientation(entity) ePos=GetPosition(entity) ePosX=math.floor(ePos.X) ePosY=math.floor(ePos.Y) eName=Logic.GetEntityName(entity) if not eName then eName="kein_Name" end ePlayer=GetPlayer(entity) MapVersion_InitMapInfoButton(eType.." ".."Name="..eName..cr.."X= "..ePosX..cr.." Y= "..ePosY..cr.."Player "..ePlayer..cr.."Winkel "..eWinkel..cr.."ID= "..entity) else MapVersion_InitMapInfoButton() end end --- //[[bochumer-dom@web.de|Dominik]] 2008/07/29 22:41//