Benutzer-Werkzeuge

Webseiten-Werkzeuge


utilfunctions:schreiben_auf_der_map

Schreiben auf der Map

Mit diesem Tool könnt ihr Schift auf die Map bringen.

posBeginn = GetPosition("startSchrift")
Schreibe(" Peermanent ",posBeginn,Entities.XD_Rock1,100)	
function Schreibe(_text, _pos, _entity, _hoehe, _abstand)
	if type (_pos) == "string" or type (_pos) == "number" then
		_pos = GetPosition(_pos);
	end
	_abstand = _abstand or 600
	local rueck = {}
	local AddTable=function(_array) for i = 1, table.getn(_array) do table.insert(rueck,_array[i]) end end
	_text = string.upper(_text)
	_text = string.gsub(_text, "ä","Ä")
	_text = string.gsub(_text, "ö","Ö")
	_text = string.gsub(_text, "ü","Ü")
    _text = string.gsub( _text, "\195\132", "Ä" );
    _text = string.gsub( _text, "\195\150", "Ö" );
    _text = string.gsub( _text, "\195\156", "Ü" );
    _text = string.gsub( _text, "\195\164", "Ä" );
    _text = string.gsub( _text, "\195\182", "Ö" );
    _text = string.gsub( _text, "\195\188", "Ü" );
 
	_entity = _entity or Entities.PU_BattleSerf
	_hoehe = _hoehe or 800
	local faktor = _hoehe / 800
	local buchStabe, mitte1, ret
	local posUnten = _pos
	local posOben =  {X=posUnten.X+800 * faktor,Y=posUnten.Y+800 * faktor}
	local posMitte=  {X=(posOben.X-posUnten.X)/2+posUnten.X,Y=(posOben.Y-posUnten.Y)/2+posUnten.Y}
	local posUnten2= {X=posUnten.X+200 * faktor,Y=posUnten.Y-200 * faktor}
	local posOben2 = {X=posUnten2.X+800 * faktor,Y=posUnten2.Y+800 * faktor}
	local posMitte2 ={X=posMitte.X+200 * faktor,Y=posMitte.Y-200 * faktor}
	local posUnten3= {X=posUnten2.X+200 * faktor,Y=posUnten2.Y-200 * faktor}
	local posOben3 = {X=posUnten3.X+800 * faktor,Y=posUnten3.Y+800 * faktor}
	local posMitte3 ={X=posMitte2.X+200 * faktor,Y=posMitte2.Y-200 * faktor}
	local kreisM1  = {X=_pos.X+400 * faktor,Y=_pos.Y+400 * faktor}
	local kreisM2  = {X=kreisM1.X+400 * faktor,Y=kreisM1.Y-400 * faktor}
	for i = 1, string.len(_text) do
		buchstabe = string.sub(_text,i,i)
		if buchstabe == "A" then
			local aPos1 = {X=posMitte.X-100 * faktor, Y=posMitte.Y-200 * faktor}
			local aPos2 = {X=posMitte3.X-200 * faktor, Y=posMitte3.Y-100 * faktor}
			AddTable(Line(posUnten, posOben2, _entity, 20))
			AddTable(Line(posUnten3, posOben2, _entity, 20))
			AddTable(Line(aPos1, aPos2, _entity, 20))
		elseif buchstabe == "Ä" then
			local aPos1 = {X=posMitte.X-100 * faktor, Y=posMitte.Y-200 * faktor}
			local aPos2 = {X=posMitte3.X-200 * faktor, Y=posMitte3.Y-100 * faktor}
			AddTable(Line({X=posUnten.X+800 * faktor,Y=posUnten.Y+600 * faktor}, {X=posOben.X+ 150 * faktor,Y=posOben.Y-50 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten2.X+800 * faktor,Y=posUnten2.Y+600 * faktor}, {X=posOben2.X+ 150 * faktor,Y=posOben2.Y-50 * faktor}, _entity, 10))
			AddTable(Line(posUnten, posOben2, _entity, 20))
			AddTable(Line(posUnten3, posOben2, _entity, 20))
			AddTable(Line(aPos1, aPos2, _entity, 20))
		elseif buchstabe == "B" then
			local cPos1 = {X=posMitte.X+250 * faktor, Y=posMitte.Y+150 * faktor}
			local cPos2 = {X=posMitte.X-150 * faktor, Y=posMitte.Y-250 * faktor}
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Kreis(cPos2, 300 * faktor, _entity,5,40,225))
			AddTable(Kreis(cPos1, 250 * faktor, _entity,5,40,225))
		elseif buchstabe == "C" then
			AddTable(Kreis(kreisM2, 550 * faktor, _entity,5,240,400))
		elseif buchstabe == "D" then
			AddTable(Kreis(kreisM1, 550 * faktor, _entity,5,45, 220))
			AddTable(Line(posUnten, posOben, _entity, 20))
		elseif buchstabe == "E" then
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Line(posOben, posOben3, _entity, 10))
			AddTable(Line(posMitte, posMitte3, _entity, 10))
			AddTable(Line(posUnten, posUnten3, _entity, 10))
		elseif buchstabe == "F" then
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Line(posOben, posOben3, _entity, 10))
			AddTable(Line(posMitte, posMitte3, _entity, 10))
		elseif buchstabe == "G" then
			AddTable(Line({X=posUnten.X+200 * faktor,Y=posUnten.Y+200 * faktor}, {X=posOben.X-200 * faktor,Y=posOben.Y-200 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten3.X+200 * faktor,Y=posUnten3.Y+200 * faktor}, posMitte3, _entity, 10))
			AddTable(Line(posMitte2, posMitte3, _entity, 10))
			AddTable(Kreis({X=posMitte2.X+200 * faktor,Y=posMitte2.Y+200 * faktor}, 300 * faktor, _entity,5,130,310))
			AddTable(Kreis({X=posMitte2.X-200 * faktor,Y=posMitte2.Y-200 * faktor}, 300 * faktor, _entity,5,-30,120))
		elseif buchstabe == "H" then
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Line(posMitte, posMitte3, _entity, 10))
			AddTable(Line(posUnten3, posOben3, _entity, 10))
		elseif buchstabe == "I" then
			AddTable(Line(posUnten2, posOben2, _entity, 10))
		elseif buchstabe == "J" then
			AddTable(Line({X=posUnten3.X+200 * faktor,Y=posUnten3.Y+200 * faktor}, posOben3, _entity, 10))
			AddTable(Kreis({X=posMitte2.X-200 * faktor,Y=posMitte2.Y-200 * faktor}, 300 * faktor, _entity,5,-30,120))
		elseif buchstabe == "K" then
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Line(posMitte, posOben3, _entity, 10))
			AddTable(Line(posMitte, posUnten3, _entity, 10))
		elseif buchstabe == "L" then
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Line(posUnten, posUnten3, _entity, 10))
		elseif buchstabe == "M" then
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Line(posOben, posUnten2, _entity, 10))
			AddTable(Line(posOben3, posUnten2, _entity, 10))
			AddTable(Line(posOben3, posUnten3, _entity, 10))
		elseif buchstabe == "N" then
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Line(posOben, posUnten3, _entity, 10))
			AddTable(Line(posOben3, posUnten3, _entity, 10))
		elseif buchstabe == "O" then
			AddTable(Line({X=posUnten.X+200 * faktor,Y=posUnten.Y+200 * faktor}, {X=posOben.X-200 * faktor,Y=posOben.Y-200 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten3.X+200 * faktor,Y=posUnten3.Y+200 * faktor}, {X=posOben3.X-200 * faktor,Y=posOben3.Y-200 * faktor}, _entity, 10))
			AddTable(Kreis({X=posMitte2.X+200 * faktor,Y=posMitte2.Y+200 * faktor}, 300 * faktor, _entity,5,130,310))
			AddTable(Kreis({X=posMitte2.X-200 * faktor,Y=posMitte2.Y-200 * faktor}, 300 * faktor, _entity,5,-30,120))
		elseif buchstabe == "Ö" then
			AddTable(Line({X=posUnten.X+800 * faktor,Y=posUnten.Y+600 * faktor}, {X=posOben.X+ 150 * faktor,Y=posOben.Y-50 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten2.X+800 * faktor,Y=posUnten2.Y+600 * faktor}, {X=posOben2.X+ 150 * faktor,Y=posOben2.Y-50 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten.X+200 * faktor,Y=posUnten.Y+200 * faktor}, {X=posOben.X-200 * faktor,Y=posOben.Y-200 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten3.X+200 * faktor,Y=posUnten3.Y+200 * faktor}, {X=posOben3.X-200 * faktor,Y=posOben3.Y-200 * faktor}, _entity, 10))
			AddTable(Kreis({X=posMitte2.X+200 * faktor,Y=posMitte2.Y+200 * faktor}, 300 * faktor, _entity,5,130,310))
			AddTable(Kreis({X=posMitte2.X-200 * faktor,Y=posMitte2.Y-200 * faktor}, 300 * faktor, _entity,5,-30,120))
		elseif buchstabe == "P" then
			local cPos1 = {X=posMitte.X+250 * faktor, Y=posMitte.Y+150 * faktor}
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Kreis(cPos1, 250 * faktor, _entity,5,40,225))
		elseif buchstabe == "Q" then
			AddTable(Line({X=posUnten.X+200 * faktor,Y=posUnten.Y+200 * faktor}, {X=posOben.X-200 * faktor,Y=posOben.Y-200 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten3.X+200 * faktor,Y=posUnten3.Y+200 * faktor}, {X=posOben3.X-200,Y=posOben3.Y-200 * faktor}, _entity, 10))
			AddTable(Line(posMitte2, posUnten3, _entity, 10))
			AddTable(Kreis({X=posMitte2.X+200 * faktor,Y=posMitte2.Y+200 * faktor}, 300 * faktor, _entity,5,130,310))
			AddTable(Kreis({X=posMitte2.X-200 * faktor,Y=posMitte2.Y-200 * faktor}, 300 * faktor, _entity,5,-30,120))
		elseif buchstabe == "R" then
			local cPos1 = {X=posMitte.X+250 * faktor, Y=posMitte.Y+150 * faktor}
			AddTable(Line(posUnten, posOben, _entity, 20))
			AddTable(Line(posMitte, posUnten3, _entity, 10))
			AddTable(Kreis(cPos1, 250 * faktor, _entity,5,40,225))
		elseif buchstabe == "S" then
			AddTable(Line({X=posUnten3.X+200 * faktor,Y=posUnten3.Y+200 * faktor}, {X=posOben.X-200 * faktor,Y=posOben.Y-200 * faktor}, _entity, 10))
			AddTable(Kreis({X=posMitte2.X+200 * faktor,Y=posMitte2.Y+200 * faktor}, 300 * faktor, _entity,5,130,310))
			AddTable(Kreis({X=posMitte2.X-200 * faktor,Y=posMitte2.Y-200 * faktor}, 300 * faktor, _entity,5,-30,120))
		elseif buchstabe == "T" then
			AddTable(Line(posUnten2, posOben2, _entity, 20))
			AddTable(Line(posOben, posOben3, _entity, 10))
		elseif buchstabe == "U" then
			AddTable(Line({X=posUnten.X+200 * faktor,Y=posUnten.Y+200 * faktor}, posOben, _entity, 10))
			AddTable(Line({X=posUnten3.X+200 * faktor,Y=posUnten3.Y+200 * faktor}, posOben3, _entity, 10))
			AddTable(Kreis({X=posMitte2.X-200 * faktor,Y=posMitte2.Y-200 * faktor}, 300 * faktor, _entity,5,-30,120))
		elseif buchstabe == "Ü" then
			AddTable(Line({X=posUnten.X+800 * faktor,Y=posUnten.Y+600 * faktor}, {X=posOben.X+ 150 * faktor,Y=posOben.Y-50 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten2.X+800 * faktor,Y=posUnten2.Y+600 * faktor}, {X=posOben2.X+ 150 * faktor,Y=posOben2.Y-50 * faktor}, _entity, 10))
			AddTable(Line({X=posUnten.X+200 * faktor,Y=posUnten.Y+200 * faktor}, posOben, _entity, 10))
			AddTable(Line({X=posUnten3.X+200 * faktor,Y=posUnten3.Y+200 * faktor}, posOben3, _entity, 10))
			AddTable(Kreis({X=posMitte2.X-200 * faktor,Y=posMitte2.Y-200 * faktor}, 300 * faktor, _entity,5,-30,120))
		elseif buchstabe == "V" then
			AddTable(Line(posUnten2, posOben3, _entity, 20))
			AddTable(Line(posOben, posUnten2, _entity, 10))
		elseif buchstabe == "W" then
			AddTable(Line({X=posUnten2.X-100 * faktor,Y=posUnten2.Y+100 * faktor}, posOben, _entity, 20))
			AddTable(Line({X=posUnten2.X-100 * faktor,Y=posUnten2.Y+100 * faktor}, posMitte2, _entity, 20))
			AddTable(Line({X=posUnten2.X+100 * faktor,Y=posUnten2.Y-100 * faktor}, posMitte2, _entity, 20))
			AddTable(Line({X=posUnten2.X+100 * faktor,Y=posUnten2.Y-100 * faktor}, posOben3, _entity, 20))
		elseif buchstabe == "X" then
			AddTable(Line(posUnten, posOben3, _entity, 20))
			AddTable(Line(posOben, posUnten3, _entity, 10))
		elseif buchstabe == "Y" then
			AddTable(Line(posOben, posMitte2, _entity, 10))
			AddTable(Line(posMitte2, posOben3, _entity, 20))
			AddTable(Line(posMitte2, posUnten2, _entity, 20))
		elseif buchstabe == "Z" then
			AddTable(Line(posOben, posOben3, _entity, 10))
			AddTable(Line(posUnten, posUnten3, _entity, 20))
			AddTable(Line(posUnten, posOben3, _entity, 10))
		elseif buchstabe == "*" then
			AddTable(Line(posUnten2, posOben2, _entity, 10))
			AddTable(Line(posUnten, posOben3, _entity, 20))
			AddTable(Line(posOben, posUnten3, _entity, 10))
			AddTable(Line(posMitte, posMitte3, _entity, 10))
		end
		posUnten=  {X=posUnten.X+_abstand * faktor,Y=posUnten.Y-_abstand * faktor}
		posOben =  {X=posUnten.X+800 * faktor,Y=posUnten.Y+800 * faktor}
		posMitte=  {X=(posOben.X-posUnten.X)/2+posUnten.X,Y=(posOben.Y-posUnten.Y)/2+posUnten.Y}
		posUnten2= {X=posUnten.X+200 * faktor,Y=posUnten.Y-200 * faktor}
		posOben2 = {X=posUnten2.X+800 * faktor,Y=posUnten2.Y+800 * faktor}
		posMitte2 ={X=posMitte.X+200 * faktor,Y=posMitte.Y-200 * faktor}
		posUnten3= {X=posUnten2.X+200 * faktor,Y=posUnten2.Y-200 * faktor}
		posOben3 = {X=posUnten3.X+800 * faktor,Y=posUnten3.Y+800 * faktor}
		posMitte3 ={X=posMitte2.X+200 * faktor,Y=posMitte2.Y-200 * faktor}
		kreisM1 =  {X=posUnten.X+400 * faktor,Y=posUnten.Y+400 * faktor}
		kreisM2  = {X=kreisM1.X+400 * faktor,Y=kreisM1.Y-400 * faktor}
	end
	return rueck
end
function Line(_pos1, _pos2, _entity, _anzahl)
	if type (_pos1) == "string" or type (_pos1) == "number" then
		_pos1 = GetPosition(_pos1);
	end
	if type (_pos2) == "string" or type (_pos2) == "number" then
		_pos2 = GetPosition(_pos2);
	end
	local laenge = math.sqrt(math.abs(_pos1.X - _pos2.X)^2 + math.abs(_pos1.Y - _pos2.Y)^2)
	_anzahl = laenge / 30
	local deltaX = math.abs(_pos1.X - _pos2.X)/_anzahl
	local deltaY = math.abs(_pos1.Y - _pos2.Y)/_anzahl
	local tIDs={}
	local x, y = 0,0
	_anzahl = _anzahl + 1
	if _pos1.X > _pos2.X then
		if _pos1.Y > _pos2.Y then
			for i = 1, _anzahl do
				table.insert(tIDs, Logic.CreateEntity(_entity, _pos1.X-x, _pos1.Y-y, 0, 4))
				x = x + deltaX
				y = y + deltaY
			end
		elseif _pos1.Y <= _pos2.Y then
			for i = 1, _anzahl do
				table.insert(tIDs, Logic.CreateEntity(_entity, _pos1.X-x, _pos1.Y+y, 0, 4))
				x = x + deltaX
				y = y + deltaY
			end
		end
	else
		if _pos1.Y > _pos2.Y then
			for i = 1, _anzahl do
				table.insert(tIDs, Logic.CreateEntity(_entity, _pos1.X+x, _pos1.Y-y, 0, 4))
				x = x + deltaX
				y = y + deltaY
			end
		elseif _pos1.Y <= _pos2.Y then
			for i = 1, _anzahl do
				table.insert(tIDs, Logic.CreateEntity(_entity, _pos1.X+x, _pos1.Y+y, 0, 4))
				x = x + deltaX
				y = y + deltaY
			end
		end
	end
	return tIDs
end
function Kreis(_pos, _range, _entity,_diffAngle,_von, _bis) 
_diffAngle = 20
	local nSin;
	local nCos;
	local tIDs={}
	_von = _von or 0
	_bis = _bis or 360
	if _range == nil then
		return false
	end
	if type (_pos) == "string" or type (_pos) == "number" then
		_pos = GetPosition(_pos);
	end
	if _diffAngle == nil then
		_diffAngle = 10
	end
	if _entity == nil then
		_entity = Entities.XD_MiscSword
	end
 
 
	for i = _von , _bis,  _diffAngle do
		nSin=math.sin((math.rad(i)));
		nCos=math.cos((math.rad(i)));
		table.insert(tIDs,Logic.CreateEntity(_entity,_pos.X-nCos*_range,_pos.Y-nSin*_range,0,4))
	end
	return tIDs
end
utilfunctions/schreiben_auf_der_map.txt · Zuletzt geändert: 2021/09/18 19:16 von 127.0.0.1