Hard Light Productions Forums

FreeSpace Releases => Scripting Releases => Topic started by: PoDo on March 24, 2013, 12:29:51 pm

Title: auxiliary-Instrument Display
Post by: PoDo on March 24, 2013, 12:29:51 pm
Hi!

one of my really long time dreams is a fully immersive cockpit to play freespace (i first hat that idea when freespace 2 came out). sadly, i just don't have enough space to build it (according to my girlfriend XD )
but on and off again i play around with the idea, building some panels and programming some stuff and i thought i can share this with you all ^^

the following (lua) scripts require to pc's, one running the freespace game you are playing, and the other pc another instance of freespace that just displays stuff (like the radar, weapon stuff, target info etc.)
it's not finnished, the radar for instance uses a fair ammount of cpu time because the tailing scannlines are programmed poorly  :lol:

the server script (the one running on the gaming machine) collects all information and sends it via udp-socket to the client machine which then tries to display those information in a pleasing way (more or less ^^)

the (data/tables/)Scripting.tbl for the pc you're playing on would be
Code: [Select]
#Global Hooks
$HUD:[


]
#End
#Conditional Hooks

$Application: FS2_Open

$State: GS_STATE_GAME_PLAY
$On Key Pressed: [

taste=hv.Key


doenergychange=function(wertA,wertB,wertC,aktion)

if aktion<0 then
emani=math.min(wertA,2)
else--if aktion==2 then
emani=math.min(12-wertA,2)
end

local change=(emani/2*aktion*-1)
local cA=emani*aktion
local cB=change
local cC=change
local rest=0

if (wertB+change)>12 then
rest=12-(wertB+change)
cB=change-rest
cC=change+rest
elseif (wertC+change)>12 then
rest=12-(wertC+change)
cC=change-rest
cB=change+rest
elseif (wertB+change)<0 then
rest=(wertB+change)
cB=change-rest
cC=change+rest
elseif (wertC+change)<0 then
rest=(wertC+change)
cC=change-rest
cB=change+rest
end

return cA,cB,cC
end

energyverwaltung=function(ve,vs,vg)
local e=0
local s=0
local g=0



if ve~=0 then
e,s,g=doenergychange(e_nrg,s_nrg,g_nrg,ve)
elseif vs~=0 then
s,e,g=doenergychange(s_nrg,e_nrg,g_nrg,vs)
elseif vg~=0 then
g,e,s=doenergychange(g_nrg,e_nrg,s_nrg,vg)
end

e_nrg=e_nrg+e
s_nrg=s_nrg+s
g_nrg=g_nrg+g
end

-- if hv.Key=="2" and radar_range<10000 then
-- radar_range = radar_range+500
-- elseif hv.Key=="1" and radar_range>500 then
-- radar_range = radar_range-500
if hv.Key=='Page Down' then
energyverwaltung(-1,0,0)
elseif hv.Key=='Page Up' then
energyverwaltung(1,0,0)
elseif hv.Key=='End'then
energyverwaltung(0,-1,0)
elseif hv.Key=='Home' then
energyverwaltung(0,1,0)
elseif hv.Key=='Delete' then
energyverwaltung(0,0,-1)
elseif hv.Key=='Insert' then
energyverwaltung(0,0,1)
end
]


$On State Start:
[
taste=""


--clr=require("CLRPackage")
--import "Microsoft.VisualBasic"
--import "System.Windows.Forms"


timestamp = 0

socket=require("socket")

sendinginterval=0.02--alle so viele Sekunden werden Spielinfos verschickt

udp=socket.udp()
udp:settimeout(0)
-- connect to UDP server


--ip auflösen evtl host = socket.dns.toip("Computername, zB Cerberos")
udp:setpeername ("192.168.0.7",14285)


--energie verteilung beim starten einer mission
e_nrg=4
s_nrg=4
g_nrg=4

]
$On Frame:
[
--tweakables!
posX,posY = 10,500


local e_nrg_displ=e_nrg --math.floor(10/12*e_nrg)/10
local s_nrg_displ=s_nrg --math.floor(10/12*s_nrg)/10
local g_nrg_displ=g_nrg --math.floor(10/12*g_nrg)/10

--gr.drawString(g_nrg_displ.."|"..s_nrg_displ.."|"..e_nrg_displ.." = "..(g_nrg_displ+s_nrg_displ+e_nrg_displ),80,25)

if mn.getMissionTime() > timestamp then

timestamp = mn.getMissionTime() + sendinginterval

ship = mn.Ships["Alpha 1"]
plr = hv.Player


-- only continue if we can get valid player handle
if plr:isValid() and ship:isValid()  then

shipinfo={}

--schiffstyp
table.insert(shipinfo,ship.Class.Name)

--speed
table.insert(shipinfo,math.floor(plr.Physics.Velocity:getMagnitude()))

--life/damage aka hull integrity in %
table.insert(shipinfo,math.floor(100/ship.HitpointsMax*ship.HitpointsLeft))

--empf effekt
--ship:getEMP()

--gr.drawString(ship:getEMP() ,110,85)
--mn.runSEXP('( when true ( clear-goals "'..curShip.Name..'" ) )')

--countermeasures aka flares
table.insert(shipinfo,ship.CountermeasuresLeft..":|:"..ship.Class.CountermeasuresMax)

--nachbrennerenergie in %
table.insert(shipinfo,math.floor(100/ship.AfterburnerFuelMax*ship.AfterburnerFuelLeft))


--if plr.Physics:AfterburnerActive() then
--gr.drawString("NACHBRENNER!",100,50)
--end

--schilde insgesamt / 1=rechts / 2=vorne / 3=hinten / 4=links
table.insert(shipinfo,math.floor(100/plr.Shields.CombinedMax*plr.Shields.CombinedLeft)..":|:"..math.floor(plr.Shields[1])..":|:"..math.floor(plr.Shields[2])..":|:"..math.floor(plr.Shields[3])..":|:"..math.floor(plr.Shields[4]))

--energie management
table.insert(shipinfo,g_nrg..":|:"..s_nrg..":|:"..s_nrg)


--local test=ship:isMatchingSpeed()


--waffen energie in %
local wepeng=math.floor((ship.WeaponEnergyLeft/ship.WeaponEnergyMax)*100)
table.insert(shipinfo,wepeng)



-------gun ammo

local guninfo={}
local missleinfo={}


local primarydual=hv.Player.PrimaryBanks.Linked
local secondyrydual=hv.Player.SecondaryBanks.DualFire
if secondyrydual then secondyrydual="1"
else secondyrydual="0" end

for i = 1, 3, 1 do
if ship.PrimaryBanks[i]:isValid() then
local warmed="0"
----primarys with ammo: Gattler, Archer, UX Accelerator, Redeemer, Vajra
if ship.PrimaryBanks[i].Armed or primarydual then local warmed="1" end
if ship.PrimaryBanks[i].AmmoMax>0 then
table.insert(guninfo,ship.PrimaryBanks[i].WeaponClass.Name..":|:"..warmed..":|:"..ship.PrimaryBanks[i].AmmoLeft..":|:"..ship.PrimaryBanks[i].AmmoMax..":|:".."0")
else
table.insert(guninfo,ship.PrimaryBanks[i].WeaponClass.Name..":|:"..warmed..":|:"..wepeng..":|:100:|:0")
end
end
end

-------missile ammo

for i = 1, 4, 1 do
if ship.SecondaryBanks[i]:isValid() then
local warmed="0"
if ship.SecondaryBanks[i].Armed then local warmed="1" end
table.insert(missleinfo,ship.SecondaryBanks[i].WeaponClass.Name..":|:"..warmed..":|:"..ship.SecondaryBanks[i].AmmoLeft..":|:"..ship.SecondaryBanks[i].AmmoMax..":|:"..secondyrydual)
end
end


for i = 1, 4, 1 do
if ship.TertiaryBanks[i]:isValid() then
local warmed="0"
if ship.TertiaryBanks[i].Armed then local warmed="1" end
table.insert(missleinfo,ship.TertiaryBanks[i].WeaponClass.Name..":|:"..warmed..":|:"..ship.TertiaryBanks[i].AmmoLeft..":|:"..ship.TertiaryBanks[i].AmmoMax":|:".."0")
end
end




table.insert(shipinfo,table.concat(guninfo,","))
table.insert(shipinfo,table.concat(missleinfo,","))





--target information START
targetinfo={}
if plr.Target:isValid() then


--probleme mit asteroiden und debris!!!!


local targetdistance=plr.Target.Position:getDistance(plr.Position)

if lasttargetdistance==nil or targetdistance==lasttargetdistance then
distpm=""
elseif targetdistance>lasttargetdistance then
distpm="+"
else
distpm="-"
end

lasttargetdistance=targetdistance
local targetdistance=math.floor(targetdistance)


local targetspeed = plr.Target.Physics.Velocity:getMagnitude()

if lasttargetspeed==nil or targetspeed==lasttargetspeed then
sistpm=""
elseif targetspeed>lasttargetspeed then
sistpm="+"
else
sistpm="-"
end


lasttargetspeed = targetspeed
local targetspeed = math.floor(targetspeed)


  local targetdcm = math.floor(100/plr.Target.HitpointsMax*plr.Target.HitpointsLeft)


table.insert(targetinfo,plr.Target.Team.Name)
table.insert(targetinfo,plr.Target.Name)
table.insert(targetinfo,plr.Target.Class.Name)
table.insert(targetinfo,targetdistance..distpm)
table.insert(targetinfo,targetspeed..sistpm)
table.insert(targetinfo,targetdcm)

local torientation = (plr.Target.Position-plr.Position)


table.insert(targetinfo,table.concat({-torientation.x,-torientation.y,torientation.z},":|:"))

end
--target information END



--radar START
radarinfo={}

local stv--zum zwischenspeichern des targets

if mn.Debris ~= nil then
for i= 1,#mn.Debris do
if mn.Debris[i]:isValid() then
--transform vector and get length
local tpos = plr.Orientation:rotateVector(mn.Debris[i].Position - plr.Position)


if plr.Target == mn.Debris[i] then --target zwischenspeichern
stv = {"a",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"1"}
else
local tmpradarblip={"d",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"0","Debris"}
table.insert(radarinfo,table.concat(tmpradarblip,":|:"))

end
end
end
end


if mn.Asteroids ~= nil then
for i= 1,#mn.Asteroids do
if mn.Asteroids[i]:isValid() then
--transform vector and get length
local tpos = plr.Orientation:rotateVector(mn.Asteroids[i].Position - plr.Position)


if plr.Target == mn.Asteroids[i] then --target zwischenspeichern
stv = {"d",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"1"}
else
local tmpradarblip={"a",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"0","Asteroid"}
table.insert(radarinfo,table.concat(tmpradarblip,":|:"))
end
end
end
end



if mn.Ships ~= nil then
for i= 1,#mn.Ships do

if mn.Ships[i]:isValid() and mn.Ships[i] ~= plr then
--transform vector and get length
local tpos = plr.Orientation:rotateVector(mn.Ships[i].Position - plr.Position)

if mn.Ships[i]:isWarpingIn() then local iswrp=1
else local iswrp=0
end


if plr.Target == mn.Ships[i] then --target zwischenspeichern
stv = {"s",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"1",mn.Ships[i].Name,mn.Ships[i].Team.Name,mn.Ships[i].Class.Name,iswrp}
else
local tmpradarblip={"s",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"0",mn.Ships[i].Name,mn.Ships[i].Team.Name,mn.Ships[i].Class.Name,iswrp}
table.insert(radarinfo,table.concat(tmpradarblip,":|:"))
end
end
end
end


if stv then
table.insert(radarinfo,table.concat(stv,":|:"))
end

--radar ENDE


--das senden wir zum client
local clientstring=table.concat({table.concat(shipinfo,":||:"),table.concat(targetinfo,":||:"),table.concat(radarinfo,":||:")},":|||:")

--udp:sendto(clientstring, ip, destport)
udp:send(clientstring)

end


end
]
$On State End:
[
--den bildschirm clearen
udp:send(":|||::|||::|||:")
]

#END
you have to change to code line
Code: [Select]
udp:setpeername ("192.168.0.7",14285) according to the ip address of the pc you'll be using to display your radar etc


and the Scripting.tbl for the recieving (display) pc would be:

Code: [Select]
#Global hooks
$Splash: [

gr.setColor(255,0,255,255)
gr.drawRectangle(10,10,500,500,true)--hintergrund
]
+Override: true
#End#Conditional Hooks

$Application: FS2_Open

$State: GS_STATE_INITIAL_PLAYER_SELECT
$On State Start:
[
radar_range = 3500
lastclienstring = ":|||::|||::|||:"

socket=require("socket")

udp = socket.udp()
udp:settimeout(0)
-- bind UDP to all local interfaces
udp:setsockname("*",14285)


]


$State: GS_STATE_INITIAL_PLAYER_SELECT
$On Frame:
[
local clientstring=lastclienstring


function update()
gr.setColor(255,255,255,255)

  -- receive incoming data from clients
while true do
local new_clientstring,ip,port=udp:receivefrom()
if new_clientstring == nil then
--gr.drawString("neeeeeee",10,10)--clientstring
break
end
clientstring=new_clientstring
--if radar_range==nil then radar_range = 3500 end
--if lastclienstring==nil then lastclienstring = ":|||::|||::|||:" end
end

--ba.getFrametime(false)
--ba.getFrametime(true)


gr.drawString("Interval: "..(math.floor(ba.getFrametime(false)*100)/100),10,10)--min Interval

lastclienstring=clientstring

local tmpinfogroups=clientstring:split(":|||:")
inf={}

for kii,wii in pairs(tmpinfogroups) do

for kyy,wyy in pairs(wii:split(":||:")) do

if inf[kii]==nil then inf[kii]={} end
if inf[kii][kyy]==nil then inf[kii][kyy]={} end

table.insert(inf[kii][kyy],wyy:split(":|:"))
inf[kii][kyy]=wyy:split(":|:")
end
end

--drawshipinfo(inf[1])
drawtargetinfo(inf[2])
drawradar(inf[3])
end

--timer=Timer()
--timer:start (100,true)
--timer.on_tick=function(timer)
--  update ()
--end




drawradar = function (radinf)


--bildschirmposition der radar mitte
local radarposx=500
local radarposy=50

--radius des radars
local radarradius=300

local rs = radarradius * 0.85, radarradius * 0.08
--mal 1.2 wegen dem deco rand des radars
local sc = rs/(radar_range*1.2)



gr.setColor(0,0,0,255)
gr.drawRectangle(radarposx,radarposy,radarposx+(radarradius*2),radarposy+(radarradius*2)+100,true)--hintergrund


--die datei befindet (bzw sollte) sich in "\data\interface\" und heisst "radar_bg.tga"
radarbg = gr.loadTexture("radar_bg")

if gr.drawImage(radarbg,radarposx,radarposy,radarposx+(radarradius*2),radarposy+(radarradius*2))==false then
--hübscher radar hintergrund konnte nicht gezeichnet werden, also zeichnen wir einfach einen kreis


gr.setColor(50,255,50,255)
gr.drawCircle(radarradius,radarposx+radarradius,radarposy+radarradius)

gr.setColor(0,0,0,255)
gr.drawCircle(radarradius-2,radarposx+radarradius,radarposy+radarradius)

end

radarbg:unload()

if sweeppos==nil or sweeppos>200 then sweeppos=0 end


local tmpswp=(sweeppos+150);
if tmpswp>200 then tmpswp=tmpswp-200 end
local cswpos=math.pi*(2-(tmpswp/100))



--den führenden sweep linie zeichnen
gr.setColor(150,170,50,125)

local sclnx=(radarposx+radarradius)+((radarradius/100*78)*math.sin(cswpos));
local sclny=(radarposy+radarradius)+((radarradius/100*78)*math.cos(cswpos));

gr.drawLine((radarposx+radarradius),(radarposy+radarradius),sclnx,sclny)

--den schwanz der sweep linie zeichen
for sw = 1, 150, 0.2 do

local tmpswp=(sweeppos+sw);
if tmpswp>200 then tmpswp=tmpswp-200 end
local swpos=math.pi*(2-(tmpswp/100))

gr.setColor(150,170,50,math.floor(50/150*sw))

local sclnx=(radarposx+radarradius)+((radarradius/100*78)*math.sin(swpos));
local sclny=(radarposy+radarradius)+((radarradius/100*78)*math.cos(swpos));

gr.drawLine((radarposx+radarradius),(radarposy+radarradius),sclnx,sclny)

end

sweeppos=sweeppos+1

--die radarobjekte zeichnen
local anzhost=0
local anzfrndl=0
local anzunkn=0

for kii,wii in pairs(radinf) do

--daten sind ok und blip ist innerhalb der radar range
if table.getn(wii)>1 and radar_range>math.floor(wii[5]) then


local xkoord = (wii[2]*sc)
local ykoord = -(wii[3]*sc)

local bxkoord = radarposx+radarradius+xkoord-13
local bykoord = radarposy+radarradius+ykoord-13


local abstand2d=math.sqrt(math.pow(math.abs(ykoord),2)+math.pow(math.abs(xkoord),2))

if xkoord<0 then
zwinkel=(math.pi*2)-math.acos(ykoord/abstand2d)
else
zwinkel=math.acos(ykoord/abstand2d)
end


if wii[6]=="1" then calpha=255
else calpha=125 end


gr.setColor(255,0,255,calpha)

local R,G,B,A

if wii[10] and wii[10]==1 then
R,G,B,A = 50,50,255,calpha
anzunkn=anzunkn+1
elseif wii[8] == "Hostile" or wii[8] == "Traitor" or wii[8] == "Neutral" then
R,G,B,A = 255,0,0,calpha
anzhost=anzhost+1
elseif wii[8] == "Friendly" then
R,G,B,A = 0,255,0,calpha
anzfrndl=anzfrndl+1
elseif wii[8] == "Unknown" then
R,G,B,A = 255,0,255,calpha
anzunkn=anzunkn+1
elseif wii[8] == "Asteroid" then
R,G,B,A = 155,155,155,calpha
anzunkn=anzunkn+1
else
R,G,B,A = 128,128,128,calpha
anzunkn=anzunkn+1
end

gr.setColor(R,G,B,A)


if wii[6]=="1" then
--falls es das target ist, dann durchgezogene umrandung
gr.drawRectangle(bxkoord,bykoord,bxkoord+26,bykoord+26,false)--umrandung
else
--nur ein normales radar objekt, kein target
--ecke oben links
gr.drawLine(bxkoord,bykoord,bxkoord+8,bykoord)
gr.drawLine(bxkoord,bykoord,bxkoord,bykoord+8)


--ecke oben rechts
gr.drawLine(bxkoord+17,bykoord,bxkoord+25,bykoord)
gr.drawLine(bxkoord+25,bykoord,bxkoord+25,bykoord+8)


--ecke unten links
gr.drawLine(bxkoord,bykoord+25,bxkoord+8,bykoord+25)
gr.drawLine(bxkoord,bykoord+17,bxkoord,bykoord+25)


--ecke unten rechts
gr.drawLine(bxkoord+25,bykoord+25,bxkoord+17,bykoord+25)
gr.drawLine(bxkoord+25,bykoord+17,bxkoord+25,bykoord+25)

end


gr.drawString(math.floor(wii[5]),bxkoord,bykoord-10)--entfernung

if wii[1]=="s" then

local textlaenge=math.ceil(math.max(string.len(wii[7]),string.len(wii[9]))*8.6)
--local textlaenge=math.ceil(math.max(gr.getStringWidth(wii[7]),gr.getStringWidth(wii[9])))
--gr.setColor(0,0,0,100)
--gr.drawRectangle(bxkoord+26,bykoord,bxkoord+26+textlaenge+30,bykoord+26,true)--texthintergrund

gr.drawLine(bxkoord+26,bykoord+13,bxkoord+26+textlaenge,bykoord+13)--texttrennlinie horizontal


if wii[6]=="1" then
gr.drawString(math.floor(math.abs(wii[4])),bxkoord+30+textlaenge,bykoord+10)--steigung

if math.floor(wii[4]) > 40 then
gr.drawLine(bxkoord+30+textlaenge,bykoord+8,bxkoord+30+textlaenge+20,bykoord+8)
gr.drawLine(bxkoord+30+textlaenge,bykoord+8,bxkoord+30+textlaenge+10,bykoord-2)
gr.drawLine(bxkoord+40+textlaenge,bykoord-2,bxkoord+30+textlaenge+20,bykoord+8)
elseif math.ceil(wii[4]) < -40 then
gr.drawLine(bxkoord+30+textlaenge,bykoord+20,bxkoord+30+textlaenge+20,bykoord+20)
gr.drawLine(bxkoord+30+textlaenge,bykoord+20,bxkoord+30+textlaenge+10,bykoord+30)
gr.drawLine(bxkoord+30+textlaenge+10,bykoord+30,bxkoord+30+textlaenge+20,bykoord+20)
end
end

gr.drawString(wii[7],bxkoord+30,bykoord+2)--schiffname
gr.drawString(wii[9],bxkoord+30,bykoord+18)--schiffklasse
end

local blipalpha=100

if zwinkel then
local blipfade
if zwinkel>cswpos then
blipfade=(math.pi*20)+math.floor(cswpos*10)-math.floor(zwinkel*10)
else
blipfade=math.floor(cswpos*10)-math.floor(zwinkel*10)
end
blipalpha=40+(140/62.82*blipfade)
--gr.drawString(blipfade,50,50)
end

gr.setColor(160,180,60,blipalpha-20)
gr.drawCircle(6,bxkoord+13+math.random(-1,1),bykoord+13+math.random(-1,1))--radarpunkt
gr.setColor(160,180,60,blipalpha-10)
gr.drawCircle(4,bxkoord+13+math.random(-1,1),bykoord+13+math.random(-1,1))--radarpunkt
gr.setColor(160,180,60,blipalpha+10)
gr.drawCircle(5,bxkoord+13+math.random(-1,1),bykoord+13+math.random(-1,1))--radarpunkt
gr.setColor(160,180,60,blipalpha+20)
gr.drawCircle(3,bxkoord+13+math.random(-1,1),bykoord+13+math.random(-1,1))--radarpunkt
end
end




--zusätzlicher infotext unterhalb des radars

local xoffs=150


gr.setColor(0,200,50,255)

gr.drawRectangle(radarposx+100+xoffs,radarposy+(radarradius*2)+22,radarposx+(radarradius*2)-150+xoffs,radarposy+(radarradius*2)+35,true)

local radarrangestring=""

if radar_range>1000 then
radarrangestring=(math.floor(radar_range/100)/10).." Km"
else
radarrangestring=radar_range.." m"
end


gr.setColor(0,0,0,255)

gr.drawRectangle(radarposx+209+xoffs,radarposy+(radarradius*2)+9,radarposx+212+xoffs,radarposy+(radarradius*2)+92,true)
gr.drawRectangle(radarposx+324+xoffs,radarposy+(radarradius*2)+9,radarposx+327+xoffs,radarposy+(radarradius*2)+92,true)

gr.drawString("Range: ",radarposx+150+xoffs,radarposy+(radarradius*2)+25)--range

gr.drawString("Objects: "..table.getn(radinf),radarposx+225+xoffs,radarposy+(radarradius*2)+25)--anzahl objekte

gr.drawString("Tech: "..table.getn(radinf),radarposx+365+xoffs,radarposy+(radarradius*2)+25)--deko

gr.setColor(0,200,50,255)

gr.drawString(radarrangestring,radarposx+150+xoffs,radarposy+(radarradius*2)+40)--range


gr.drawString(math.floor(((2*math.pi)-cswpos)*100),radarposx+345+xoffs,radarposy+(radarradius*2)+40)--techA
gr.drawString(math.floor(cswpos*100),radarposx+345+xoffs,radarposy+(radarradius*2)+55)--techB

gr.drawString(" / "..math.floor(cswpos*100),radarposx+375+xoffs,radarposy+(radarradius*2)+40)--techC
gr.drawString(" / "..math.floor(((2*math.pi)-cswpos)*100),radarposx+375+xoffs,radarposy+(radarradius*2)+55)--techD

gr.drawLine(radarposx+210+xoffs,radarposy+(radarradius*2)+10,radarposx+210+xoffs,radarposy+(radarradius*2)+90)--texttrennlinie vertikal
gr.drawLine(radarposx+325+xoffs,radarposy+(radarradius*2)+10,radarposx+325+xoffs,radarposy+(radarradius*2)+90)--texttrennlinie vertikal


gr.setColor(255,50,50,255)
gr.drawString("Hostile: "..anzhost,radarposx+225+xoffs,radarposy+(radarradius*2)+40)--anzahl objekte
gr.setColor(0,255,0,255)
gr.drawString("Friendly: "..anzfrndl,radarposx+225+xoffs,radarposy+(radarradius*2)+55)--anzahl objekte
gr.setColor(255,255,0,255)
gr.drawString("Unknown: "..anzunkn,radarposx+225+xoffs,radarposy+(radarradius*2)+70)--anzahl objekte


end





drawshipinfo = function(sinfo)


end



drawtargetinfo = function(tinfo)
--zeichnet die target-info box


local targetboxpositionx=50
local targetboxpositonY=100

local targetboxwidth=200
local targetboxheight=250

local targetrenderbreite=200
local targetrenderhoehe=200

local randabstand=5
local zeilenabstand=15

local targetrenderposx=targetboxpositionx
local targetrenderposy=targetboxpositonY+50


--umrandung
gr.setColor(50,250,50,100)
gr.drawRectangle(targetboxpositionx,targetboxpositonY,targetboxpositionx+targetboxwidth,targetboxpositonY+targetboxheight,false)

--hintergrund für die targetrenderbox
gr.setColor(50,250,50,25)
gr.drawRectangle(targetrenderposx,targetrenderposy,targetrenderposx+targetrenderbreite,targetrenderposy+targetrenderhoehe,true)


--hintergrund für die targetrenderbox
gr.setColor(50,250,50,50)

gr.drawRectangle(targetrenderposx+targetrenderbreite-38,targetrenderposy,targetrenderposx+targetrenderbreite,targetrenderposy+zeilenabstand,true)
gr.drawRectangle(targetrenderposx,targetrenderposy,targetrenderposx+targetrenderbreite-38,targetrenderposy+2,true)

gr.setColor(50,250,50,150)

gr.drawRectangle(targetrenderposx+targetrenderbreite-5,targetrenderposy+zeilenabstand,targetrenderposx+targetrenderbreite,targetrenderposy+targetrenderhoehe,true)

--team name scheint nicht zu funktionieren
if     tinfo[1] == "Hostile"  then gr.setColor(255,50,50,255)
elseif tinfo[1] == "Friendly" then gr.setColor(0,255,0,255)
elseif tinfo[1] == "Neutral"  then gr.setColor(255,50,50,155)
elseif tinfo[1] == "Unknown"  then gr.setColor(255,255,0,255)
end



if table.getn(tinfo) == 7 then
local calpha=255
local R,G,B,A

if wii[10] and wii[10]==1 then
R,G,B,A = 50,50,255,calpha
elseif wii[8] == "Hostile" or wii[8] == "Traitor" or wii[8] == "Neutral" then
R,G,B,A = 255,0,0,calpha
elseif wii[8] == "Friendly" then
R,G,B,A = 0,255,0,calpha
elseif wii[8] == "Unknown" then
R,G,B,A = 255,0,255,calpha
elseif wii[8] == "Asteroid" then
R,G,B,A = 155,155,155,calpha
else
R,G,B,A = 128,128,128,calpha
end

gr.setColor(R,G,B,A)


gr.drawString(tinfo[2][1].." ("..tinfo[1][1]..")",targetboxpositionx+randabstand,targetboxpositonY+randabstand)--name


gr.drawString(tinfo[3][1],targetboxpositionx+randabstand,targetboxpositonY+(zeilenabstand*1)+randabstand)--klasse


gr.drawString("D: "..tinfo[4][1],targetboxpositionx+randabstand,targetboxpositonY+(zeilenabstand*2)+randabstand)--entfernung


gr.drawString("S: "..tinfo[5][1],targetboxpositionx+randabstand+targetboxwidth-50,targetboxpositonY+(zeilenabstand*2)+randabstand)--geschwindigkeit


gr.setColor(50,250,50,255)
gr.drawString(tinfo[6][1].."%",targetboxpositionx+randabstand+targetboxwidth-40,targetboxpositonY+(zeilenabstand*3)+randabstand+randabstand)--hull integrity


local targetshiphandle = tb.ShipClasses[tinfo[3][1]]



if targetshiphandle ~= nil and targetshiphandle:isValid() and targetshiphandle:isInTechroom() then

targetshiphandle:isModelLoaded(true)
local tpostest=ba.createVector(tinfo[7][1],tinfo[7][2],tinfo[7][3]):getOrientation()
targetshiphandle:renderTechModel2(targetrenderposx,targetrenderposy,targetrenderposx+targetrenderbreite,targetrenderposy+targetrenderhoehe,tpostest,0.95)
end

else
gr.drawString("No Target",targetrenderposx+targetrenderbreite+50,targetboxpositonY+randabstand+50)
end
end



function string:split(delimiter)
  local result = { }
  local from  = 1
  local delim_from, delim_to = string.find( self, delimiter, from  )
  while delim_from do
    table.insert( result, string.sub( self, from , delim_from-1 ) )
    from  = delim_to + 1
    delim_from, delim_to = string.find( self, delimiter, from  )
  end
  table.insert( result, string.sub( self, from  ) )
  return result
end





update()


]
+Override: true

$On Key Pressed: [

kp=hv.Key

--gr.setColor(255,255,255,255)
--gr.drawString("Taste: "..hv.Key,50,50)
if hv.Key=="2" and radar_range<10000 then
radar_range = radar_range+500
elseif hv.Key=="1" and radar_range>500 then
radar_range = radar_range-500
end

]

#End


Notes:

Title: Re: auxiliary-Instrument Display
Post by: chief1983 on March 25, 2013, 10:43:12 am
This looks awesome.
Title: Re: auxiliary-Instrument Display
Post by: PoDo on March 25, 2013, 06:50:09 pm
I hope that I get it working over the next weekend ^^

i've just played around a bit, and tried to draw some hud-images:
does the "drawMonochromeImage" function deliberately not stretch images (with the "drawImage" function i'm able to stretch images)?


//EDIT:
little screenshot added what i have for today. ^^

[attachment deleted by ninja]
Title: Re: auxiliary-Instrument Display
Post by: MatthTheGeek on March 26, 2013, 01:40:29 am
What does "Tech" refer to ?
Title: Re: auxiliary-Instrument Display
Post by: PoDo on March 26, 2013, 04:37:31 am
those are just some changing numbers (angles of the sweeping radar line), I just used them for debugging etc, but i thought they looked cool (the change pretty fast).
but the whole area beneath the radar needs some tinkering ^^
Title: Re: auxiliary-Instrument Display
Post by: mikes3ds on March 26, 2013, 03:38:23 pm
Very cool!

I am working on a bridge simulator like startrek same concept not using scripting rather doing in FSO source it self. (Like the artemis http://www.artemis.eochu.com/ )

The goal is to have 4 computers one helms, weapons, engineering, science; controlling a FSO server. I am very impressed with your work.
Title: Re: auxiliary-Instrument Display
Post by: Mobius on March 26, 2013, 09:09:41 pm
Very cool, indeed! :)
Title: Re: auxiliary-Instrument Display
Post by: PoDo on March 28, 2013, 09:21:42 am
just a small progress screenshot for today ^^

notes:

[attachment deleted by ninja]
Title: Re: auxiliary-Instrument Display
Post by: mikes3ds on March 28, 2013, 10:59:54 pm
Very nice. Do you mind posting your new source code. I really like it!
Title: Re: auxiliary-Instrument Display
Post by: mikes3ds on March 29, 2013, 03:42:55 am
Getting this error when running your code. This is the client. ( GUI is fine tell, I start up the server)
Code: [Select]
LUA ERROR: [string "scripting.tbl - On Frame"]:387: attempt to index global 'wii' (a nil value)

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0

Source: (null)
Short source:
Current line: 0
- Function line: 0
------------------------------------------------------------------


------------------------------------------------------------------

stack traceback:
[C]: ?
[string "scripting.tbl - On Frame"]:387: in function 'drawtargetinfo'
[string "scripting.tbl - On Frame"]:43: in function 'update'
[string "scripting.tbl - On Frame"]:455: in main chunk
------------------------------------------------------------------

------------------------------------------------------------------
Title: Re: auxiliary-Instrument Display
Post by: PoDo on March 29, 2013, 07:48:07 am
so, this version should throw a few less errors ^^

"Server" Scripting.tbl

Code: [Select]
#Global Hooks
$HUD:[


]
#End
#Conditional Hooks

$Application: FS2_Open

$State: GS_STATE_GAME_PLAY
$On Key Pressed: [

taste=hv.Key


doenergychange=function(wertA,wertB,wertC,aktion)

if aktion<0 then
emani=math.min(wertA,2)
else--if aktion==2 then
emani=math.min(12-wertA,2)
end

local change=(emani/2*aktion*-1)
local cA=emani*aktion
local cB=change
local cC=change
local rest=0

if (wertB+change)>12 then
rest=12-(wertB+change)
cB=change-rest
cC=change+rest
elseif (wertC+change)>12 then
rest=12-(wertC+change)
cC=change-rest
cB=change+rest
elseif (wertB+change)<0 then
rest=(wertB+change)
cB=change-rest
cC=change+rest
elseif (wertC+change)<0 then
rest=(wertC+change)
cC=change-rest
cB=change+rest
end

return cA,cB,cC
end

energyverwaltung=function(ve,vs,vg)
local e=0
local s=0
local g=0



if ve~=0 then
e,s,g=doenergychange(e_nrg,s_nrg,g_nrg,ve)
elseif vs~=0 then
s,e,g=doenergychange(s_nrg,e_nrg,g_nrg,vs)
elseif vg~=0 then
g,e,s=doenergychange(g_nrg,e_nrg,s_nrg,vg)
end

e_nrg=e_nrg+e
s_nrg=s_nrg+s
g_nrg=g_nrg+g
end

if hv.Key=='Page Down' then
energyverwaltung(-1,0,0)
elseif hv.Key=='Page Up' then
energyverwaltung(1,0,0)
elseif hv.Key=='End' then
energyverwaltung(0,-1,0)
elseif hv.Key=='Home' then
energyverwaltung(0,1,0)
elseif hv.Key=='Delete' then
energyverwaltung(0,0,-1)
elseif hv.Key=='Insert' then
energyverwaltung(0,0,1)
end
]


$On State Start:
[
taste=""


--clr=require("CLRPackage")
--import "Microsoft.VisualBasic"
--import "System.Windows.Forms"


timestamp = 0

socket=require("socket")

sendinginterval=0.02--alle so viele Sekunden werden Spielinfos verschickt

udp=socket.udp()
udp:settimeout(0)
-- connect to UDP server


--ip auflösen evtl host = socket.dns.toip("Computername, zB Cerberos")
udp:setpeername ("192.168.0.8",14285)


--energie verteilung beim starten einer mission
e_nrg=4
s_nrg=4
g_nrg=4

]
$On Frame:
[


if mn.getMissionTime() > timestamp then

timestamp = mn.getMissionTime() + sendinginterval

ship = mn.Ships["Alpha 1"]
plr = hv.Player


-- only continue if we can get valid player handle
if plr:isValid() and ship:isValid()  then

shipinfo={}


--schiffstyp
table.insert(shipinfo,ship.Class.Name)

--speed
table.insert(shipinfo,math.floor(plr.Physics.Velocity:getMagnitude()))

--life/damage aka hull integrity in %
table.insert(shipinfo,math.floor(100/ship.HitpointsMax*ship.HitpointsLeft))


--countermeasures aka flares
table.insert(shipinfo,ship.CountermeasuresLeft..":|:"..ship.Class.CountermeasuresMax)

--nachbrennerenergie in %
table.insert(shipinfo,math.floor(100/ship.AfterburnerFuelMax*ship.AfterburnerFuelLeft).."%")



--schilde insgesamt / 1=rechts / 2=vorne / 3=hinten / 4=links
table.insert(shipinfo,math.floor(100/plr.Shields.CombinedMax*plr.Shields.CombinedLeft)..":|:"..math.floor(plr.Shields[1])..":|:"..math.floor(plr.Shields[2])..":|:"..math.floor(plr.Shields[3])..":|:"..math.floor(plr.Shields[4]))

--energie management
table.insert(shipinfo,g_nrg..":|:"..s_nrg..":|:"..e_nrg)



--waffen energie in %
local wepeng=math.floor((ship.WeaponEnergyLeft/ship.WeaponEnergyMax)*100)
table.insert(shipinfo,wepeng)



-------gun ammo

local guninfo={}
local missleinfo={}


local primarydual=hv.Player.PrimaryBanks.Linked
local secondyrydual=hv.Player.SecondaryBanks.DualFire
if secondyrydual then secondyrydual="1"
else secondyrydual="0" end

for i = 1, 3, 1 do
if ship.PrimaryBanks[i]:isValid() then
local warmed="0"
----primarys with ammo: Gattler, Archer, UX Accelerator, Redeemer, Vajra
if ship.PrimaryBanks[i].Armed or primarydual then warmed="1" end
if ship.PrimaryBanks[i].AmmoMax>0 then
table.insert(guninfo,ship.PrimaryBanks[i].WeaponClass.Name..":_:"..warmed..":_:"..ship.PrimaryBanks[i].AmmoLeft..":_:"..ship.PrimaryBanks[i].AmmoMax..":_:".."0")
else
table.insert(guninfo,ship.PrimaryBanks[i].WeaponClass.Name..":_:"..warmed..":_:"..wepeng.."%:_:100%:_:0")
end
end
end

-------missile ammo

for i = 1, 4, 1 do
if ship.SecondaryBanks[i]:isValid() then
local warmed="0"
if ship.SecondaryBanks[i].Armed then warmed="1" end
table.insert(missleinfo,ship.SecondaryBanks[i].WeaponClass.Name..":_:"..warmed..":_:"..ship.SecondaryBanks[i].AmmoLeft..":_:"..ship.SecondaryBanks[i].AmmoMax..":_:"..secondyrydual)
end
end


for i = 1, 4, 1 do
if ship.TertiaryBanks[i]:isValid() then
local warmed="0"
if ship.TertiaryBanks[i].Armed then warmed="1" end
table.insert(missleinfo,ship.TertiaryBanks[i].WeaponClass.Name..":_:"..warmed..":_:"..ship.TertiaryBanks[i].AmmoLeft..":_:"..ship.TertiaryBanks[i].AmmoMax":_:".."0")
end
end


table.insert(shipinfo,table.concat(guninfo,":|:"))
table.insert(shipinfo,table.concat(missleinfo,":|:"))

local damageerror={}

local plrship = mn.getObjectFromSignature(plr:getSignature())

if ship.HitpointsMax~=ship.HitpointsLeft then
table.insert(damageerror,"Hull ["..math.floor(100/ship.HitpointsMax*ship.HitpointsLeft).."%]")
end

for i = 1, #plrship, 1 do
if plrship[i].HitpointsMax~=plrship[i].HitpointsLeft then
table.insert(damageerror,plrship[i].Name.." ["..math.floor(100/plrship[i].HitpointsMax*plrship[i].HitpointsLeft).."%]")
end
end

table.insert(shipinfo,table.concat(damageerror,":|:"))

--target information START
targetinfo={}
if plr.Target:isValid() then


local targetdistance=plr.Target.Position:getDistance(plr.Position)

if lasttargetdistance==nil or targetdistance==lasttargetdistance then
distpm=""
elseif targetdistance>lasttargetdistance then
distpm="+"
else
distpm="-"
end

lasttargetdistance=targetdistance
local targetdistance=math.floor(targetdistance)

local targetspeed = plr.Target.Physics.Velocity:getMagnitude()

if lasttargetspeed==nil or targetspeed==lasttargetspeed then
sistpm=""
elseif targetspeed>lasttargetspeed then
sistpm="+"
else
sistpm="-"
end

lasttargetspeed=targetspeed
local targetspeed=math.floor(targetspeed)

if plr.Target:getBreedName()=='Ship' then
local shipClassIndex=plr.Target.Class:getShipClassIndex()



local targetdcm = math.floor(100/plr.Target.HitpointsMax*plr.Target.HitpointsLeft)
table.insert(targetinfo,plr.Target.Team.Name)
table.insert(targetinfo,plr.Target.Name)
table.insert(targetinfo,plr.Target.Class.Name)
table.insert(targetinfo,targetdistance..distpm)
table.insert(targetinfo,targetspeed..sistpm)
table.insert(targetinfo,targetdcm)
table.insert(targetinfo, shipClassIndex)

if plr.Target.Shields.CombinedMax~=0 then
table.insert(targetinfo,math.floor(100/plr.Target.Shields.CombinedMax*plr.Target.Shields.CombinedLeft)..":|:"..math.floor(plr.Target.Shields[1])..":|:"..math.floor(plr.Target.Shields[2])..":|:"..math.floor(plr.Target.Shields[3])..":|:"..math.floor(plr.Target.Shields[4]))
else
table.insert(targetinfo,"")
end

else
table.insert(targetinfo,"-")
table.insert(targetinfo,"-")
table.insert(targetinfo,plr.Target:getBreedName())
table.insert(targetinfo,targetdistance..distpm)
table.insert(targetinfo,targetspeed..sistpm)
table.insert(targetinfo,"-")
table.insert(targetinfo,"-")
table.insert(targetinfo,"")
end

local torientation=(plr.Target.Position-plr.Position)

table.insert(targetinfo,table.concat({-torientation.x,-torientation.y,torientation.z},":|:"))

end
--target information END



--radar START
radarinfo={}

local stv--zum zwischenspeichern des targets

if mn.Debris ~= nil then
for i= 1,#mn.Debris do
if mn.Debris[i]:isValid() then
--transform vector and get length
local tpos = plr.Orientation:rotateVector(mn.Debris[i].Position - plr.Position)


if plr.Target == mn.Debris[i] then --target zwischenspeichern
stv = {"a",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"1"}
else
local tmpradarblip={"d",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"0","Debris"}
table.insert(radarinfo,table.concat(tmpradarblip,":|:"))

end
end
end
end


if mn.Asteroids ~= nil then
for i= 1,#mn.Asteroids do
if mn.Asteroids[i]:isValid() then
--transform vector and get length
local tpos = plr.Orientation:rotateVector(mn.Asteroids[i].Position - plr.Position)


if plr.Target == mn.Asteroids[i] then --target zwischenspeichern
stv = {"d",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"1"}
else
local tmpradarblip={"a",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"0","Asteroid"}
table.insert(radarinfo,table.concat(tmpradarblip,":|:"))
end
end
end
end



if mn.Ships ~= nil then
for i= 1,#mn.Ships do

if mn.Ships[i]:isValid() and mn.Ships[i] ~= plr then
--transform vector and get length
local tpos = plr.Orientation:rotateVector(mn.Ships[i].Position - plr.Position)
local iswrp="0"
if mn.Ships[i]:isWarpingIn() then local iswrp="1" end

local smass=math.floor(tb.ShipClasses[(mn.Ships[i].Class:getShipClassIndex()+1)].Model.Mass)

if plr.Target == mn.Ships[i] then --target zwischenspeichern
stv = {"s",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"1",mn.Ships[i].Name,mn.Ships[i].Team.Name,mn.Ships[i].Class.Name,iswrp,math.floor(100/mn.Ships[i].HitpointsMax*mn.Ships[i].HitpointsLeft),smass}
else
local tmpradarblip={"s",tpos.x,tpos.z,tpos.y,tpos:getMagnitude(),"0",mn.Ships[i].Name,mn.Ships[i].Team.Name,mn.Ships[i].Class.Name,iswrp,math.floor(100/mn.Ships[i].HitpointsMax*mn.Ships[i].HitpointsLeft),smass}
table.insert(radarinfo,table.concat(tmpradarblip,":|:"))
end
end
end
end


if stv then
table.insert(radarinfo,table.concat(stv,":|:"))
end

--radar ENDE


local wingmeninfo={}



for i= 1,#mn.Wings do
local tmpsqdrinfo={}
for ii= 1,#mn.Wings[i] do
table.insert(tmpsqdrinfo,mn.Wings[i][ii].Name.." ["..math.floor(100/mn.Wings[i][ii].HitpointsMax*mn.Wings[i][ii].HitpointsLeft).."]")
end

table.insert(wingmeninfo,table.concat(tmpsqdrinfo,":|:"))
end


--das senden wir zum client
local clientstring=table.concat({table.concat(shipinfo,":||:"),table.concat(targetinfo,":||:"),table.concat(radarinfo,":||:"),table.concat(wingmeninfo,":||:")},":|||:")

--udp:sendto(clientstring, ip, destport)
udp:send(clientstring)


--if plr.Target:isValid() and plr.Target.Team.Name=='Friendly' then
--local file = cf.openFile('C:\\Games\\FreeSpace2\\data\\tables\\testclientstring.txt','w')
--file:write(clientstring)
--file:close()
--ba.error('testclientstring gespeichert')
--end

end
end



]
$On State End:
[
--den bildschirm clearen
udp:send(":|||::|||::|||:")
]

#END


"Client" Scripting.tbl

Code: [Select]
#Global hooks
$Splash: [

--gr.setColor(255,0,255,255)
--gr.drawRectangle(10,10,500,500,true)--hintergrund

]
+Override: true
#End

#Conditional Hooks

$Application: FS2_Open

$State: GS_STATE_INITIAL_PLAYER_SELECT
$On State Start:
[
radar_range = 3500
lastclienstring = ":|||::|||::|||::|||:"

socket=require("socket")

udp = socket.udp()
udp:settimeout(0)
-- bind UDP to all local interfaces
udp:setsockname("*",14285)
]


$State: GS_STATE_INITIAL_PLAYER_SELECT
$On Frame:
[
--config############################################################ START

--base color
baseR,baseG,baseB=50,250,50--R,G,B


--radar position
radarX,radarY,radarR=450,10,370--X,Y,Radius
showscanline=false--radar scannline

--target infobox position
targetX,targetY=10,10--X,Y

--player ship infobox position
shipinfoX,shipinfoY=10,300--X,Y

--monitor/wingmen infobox position
monitorX,monitorY=10,605--X,Y


--config############################################################ END



local clientstring=lastclienstring

function nicebox(posX,posY,width,height,title,textcontent)
local textcontent = textcontent or {{}}

gr.setColor(baseR,baseG,baseB,150)

local cornercut=7
gr.drawLine(posX,posY,(posX+width)-cornercut,posY)
gr.drawLine(posX,posY,posX,(posY+height))
gr.drawLine(posX,(posY+height),(posX+width),(posY+height))
gr.drawLine((posX+width),posY+cornercut,(posX+width),(posY+height))
gr.drawLine((posX+width)-cornercut,posY,(posX+width),posY+cornercut)

gr.drawRectangle(posX+1,posY,(posX+gr.getStringWidth(title)+4),(posY+9),true)

gr.drawLine((posX+gr.getStringWidth(title)+4),posY+9,posX+(gr.getStringWidth(title)+4)+9,posY)

gr.setColor(0,0,0,255)
gr.drawString(title,posX+2,posY)

local prevcolwidesttext=0
local widesttext=0
local maxrows=0

gr.setColor(baseR,baseG,baseB,255)
for colnr,colcont in pairs(textcontent) do
for rownr,rowcont in pairs(textcontent[colnr]) do
gr.drawString(textcontent[colnr][rownr],(posX+4+(prevcolwidesttext)),(posY+2+(rownr*11)))
if gr.getStringWidth(textcontent[colnr][rownr])>widesttext then widesttext=gr.getStringWidth(textcontent[colnr][rownr]) end
end

if table.getn(textcontent[colnr])>maxrows then maxrows=table.getn(textcontent[colnr]) end

prevcolwidesttext=prevcolwidesttext+widesttext+5
widesttext=0
end

--if prevcolwidesttext>width then ba.error('Text in Box \''..title..'\' to wide (Need: '..prevcolwidesttext..' Px / Have: '..width..' Px)') end
--if ((maxrows+1)*11)>height then ba.error('Text in Box \''..title..'\' to short (Need: '..((maxrows+1)*11)..' Px / Have: '..height..' Px)') end
end


function update()
  -- receive incoming data from server
while true do
local new_clientstring,ip,port=udp:receivefrom()
if new_clientstring == nil then
break
end
clientstring=new_clientstring
end



--test clientstring
--clientstring='GTF Myrmidon:||:75:||:100:||:36:|:36:||:100%:||:99:|:97:|:97:|:97:|:97:||:4:|:4:|:4:||:100:||:Subach HL-7:_:1:_:100%:_:100%:_:0:|:Subach HL-7:_:0:_:100%:_:100%:_:0:||:Rockeye:_:1:_:5:_:5:_:0:|:Rockeye:_:0:_:5:_:5:_:0:|:Tempest:_:0:_:160:_:160:_:0:||:Hull [100%]:|:sensors [100%]:|:communications [100%]:|:weapons [100%]:|:navigation [100%]:|:engine [100%]:|||:Friendly:||:Alpha 2:||:GTF Myrmidon:||:218-:||:63+:||:100:||:8:||:99:|:97:|:97:|:97:|:97:||:-12.108276367188:|:16.492980957031:|:-217.509765625:|||:s:|:-271.84191894531:|:5833.3994140625:|:-624.83575439453:|:5873.0625:|:0:|:Iceni:|:Neutral:|:NTF Iceni:|:0:|:69:|:488051:||:s:|:144.70185852051:|:-220.74002075195:|:-17.712619781494:|:264.53454589844:|:0:|:Alpha 3:|:Friendly:|:GTF Myrmidon:|:0:|:100:|:210:||:s:|:236.2311706543:|:213.39468383789:|:-128.48809814453:|:343.29528808594:|:0:|:Beta 1:|:Friendly:|:GTF Myrmidon:|:0:|:100:|:210:||:s:|:167.96406555176:|:148.53744506836:|:-126.40850067139:|:257.39932250977:|:0:|:Beta 2:|:Friendly:|:GTF Myrmidon:|:0:|:100:|:210:||:s:|:321.30990600586:|:136.66542053223:|:-93.947769165039:|:361.58493041992:|:0:|:Beta 3:|:Friendly:|:GTF Myrmidon:|:0:|:100:|:210:||:s:|:15.988680839539:|:-217.23811340332:|:-16.766021728516:|:218.46998596191:|:1:|:Alpha 2:|:Friendly:|:GTF Myrmidon:|:0:|:100:|:210:|||:Alpha 1 [100]:|:Alpha 2 [100]:|:Alpha 3 [100]:||::||::||::||::||:Beta 1 [100]:|:Beta 2 [100]:|:Beta 3 [100]:||:'



lastclienstring=clientstring


local tmpinfogroups=clientstring:split(":|||:")
inf={}

for kii,wii in pairs(tmpinfogroups) do

for kyy,wyy in pairs(wii:split(":||:")) do

if inf[kii]==nil then inf[kii]={} end
if inf[kii][kyy]==nil then inf[kii][kyy]={} end

table.insert(inf[kii][kyy],wyy:split(":|:"))
inf[kii][kyy]=wyy:split(":|:")
end
end


drawradar(inf[3],radarX,radarY,radarR)
drawtargetinfo(inf[2],targetX,targetY)
drawshipinfo(inf[1],shipinfoX,shipinfoY)
drawmonitor(inf[4],monitorX,monitorY)


end



drawradar = function (radinf,posX,posY,radarradius)

local rs = radarradius * 0.85, radarradius * 0.08
--mal 1.2 wegen dem deco rand des radars
local sc = rs/(radar_range*1.2)

gr.setColor(0,0,0,255)
gr.drawRectangle(posX,posY,posX+(radarradius*2),posY+(radarradius*2)+100,true)--hintergrund


--die datei befindet (bzw sollte) sich in "\data\interface\" und heisst "radar_bg.tga"
radarbg = gr.loadTexture("radar_bg")

--if gr.drawImage(radarbg,posX,posY,posX+(radarradius*2),posY+(radarradius*2))==false then
--hübscher radar hintergrund konnte nicht gezeichnet werden, also zeichnen wir einfach einen kreis

gr.setColor(baseR,baseG,baseB,255)
gr.drawCircle(radarradius,posX+radarradius,posY+radarradius)

gr.setColor(0,0,0,255)
gr.drawCircle(radarradius-2,posX+radarradius,posY+radarradius)

--end

radarbg:unload()

if sweeppos==nil or sweeppos>200 then sweeppos=0 end

local tmpswp=(sweeppos+150);
if tmpswp>200 then tmpswp=tmpswp-200 end
local cswpos=math.pi*(2-(tmpswp/100))


if showscanline then
--den führenden sweep linie zeichnen
gr.setColor(baseR,baseG,baseB,125)

local sclnx=(posX+radarradius)+((radarradius/100*78)*math.sin(cswpos));
local sclny=(posY+radarradius)+((radarradius/100*78)*math.cos(cswpos));

gr.drawLine((posX+radarradius),(posY+radarradius),sclnx,sclny)

--den schwanz der sweep linie zeichen
for sw = 1, 150, 0.2 do

local tmpswp=(sweeppos+sw);
if tmpswp>200 then tmpswp=tmpswp-200 end
local swpos=math.pi*(2-(tmpswp/100))

gr.setColor(baseR,baseG,baseB,math.floor(50/150*sw))

local sclnx=(posX+radarradius)+((radarradius/100*78)*math.sin(swpos));
local sclny=(posY+radarradius)+((radarradius/100*78)*math.cos(swpos));

gr.drawLine((posX+radarradius),(posY+radarradius),sclnx,sclny)

end
end

sweeppos=sweeppos+1

--die radarobjekte zeichnen
local anzhost=0
local anzfrndl=0
local anzunkn=0


for kii,wii in pairs(radinf) do

--daten sind ok und blip ist innerhalb der radar range
if table.getn(wii)>1 and radar_range>math.floor(wii[5]) then


local xkoord = (wii[2]*sc)
local ykoord = -(wii[3]*sc)

local bxkoord = posX+radarradius+xkoord-13
local bykoord = posY+radarradius+ykoord-13


local abstand2d=math.sqrt(math.pow(math.abs(ykoord),2)+math.pow(math.abs(xkoord),2))

if xkoord<0 then
zwinkel=(math.pi*2)-math.acos(ykoord/abstand2d)
else
zwinkel=math.acos(ykoord/abstand2d)
end


if wii[6]=="1" then calpha=255
else calpha=125 end


local R,G,B,A

if wii[10] and wii[10]==1 then
R,G,B,A = 50,50,255,calpha
anzunkn=anzunkn+1
elseif wii[8] == "Hostile" or wii[8] == "Traitor" or wii[8] == "Neutral" then
R,G,B,A = 255,0,0,calpha
anzhost=anzhost+1
elseif wii[8] == "Friendly" then
R,G,B,A = 0,255,0,calpha
anzfrndl=anzfrndl+1
elseif wii[8] == "Unknown" then
R,G,B,A = 255,0,255,calpha
anzunkn=anzunkn+1
elseif wii[8] == "Asteroid" then
R,G,B,A = 155,155,155,calpha
anzunkn=anzunkn+1
else
R,G,B,A = 128,128,128,calpha
anzunkn=anzunkn+1
end

gr.setColor(R,G,B,A)


if wii[6]=="1" then
--falls es das target ist, dann durchgezogene umrandung
gr.drawRectangle(bxkoord,bykoord,bxkoord+26,bykoord+26,false)--umrandung
else
--nur ein normales radar objekt, kein target
--ecke oben links
gr.drawLine(bxkoord,bykoord,bxkoord+8,bykoord)
gr.drawLine(bxkoord,bykoord,bxkoord,bykoord+8)


--ecke oben rechts
gr.drawLine(bxkoord+17,bykoord,bxkoord+25,bykoord)
gr.drawLine(bxkoord+25,bykoord,bxkoord+25,bykoord+8)


--ecke unten links
gr.drawLine(bxkoord,bykoord+25,bxkoord+8,bykoord+25)
gr.drawLine(bxkoord,bykoord+17,bxkoord,bykoord+25)


--ecke unten rechts
gr.drawLine(bxkoord+25,bykoord+25,bxkoord+17,bykoord+25)
gr.drawLine(bxkoord+25,bykoord+17,bxkoord+25,bykoord+25)

end


gr.drawString(math.floor(wii[5]),bxkoord,bykoord-10)--entfernung

if wii[1]=="s" then

local textlaenge=math.ceil(math.max(string.len(wii[7]),string.len(wii[9]))*8.6)

gr.drawLine(bxkoord+26,bykoord+13,bxkoord+26+textlaenge,bykoord+13)--texttrennlinie horizontal


if wii[6]=="1" then
gr.drawString(math.floor(math.abs(wii[4])),bxkoord+30+textlaenge,bykoord+10)--steigung

if math.floor(wii[4]) > 40 then
gr.drawLine(bxkoord+30+textlaenge,bykoord+8,bxkoord+30+textlaenge+20,bykoord+8)
gr.drawLine(bxkoord+30+textlaenge,bykoord+8,bxkoord+30+textlaenge+10,bykoord-2)
gr.drawLine(bxkoord+40+textlaenge,bykoord-2,bxkoord+30+textlaenge+20,bykoord+8)
elseif math.ceil(wii[4]) < -40 then
gr.drawLine(bxkoord+30+textlaenge,bykoord+20,bxkoord+30+textlaenge+20,bykoord+20)
gr.drawLine(bxkoord+30+textlaenge,bykoord+20,bxkoord+30+textlaenge+10,bykoord+30)
gr.drawLine(bxkoord+30+textlaenge+10,bykoord+30,bxkoord+30+textlaenge+20,bykoord+20)
end
end

gr.drawString(wii[7],bxkoord+30,bykoord+2)--schiffname
gr.drawString(wii[9],bxkoord+30,bykoord+18)--schiffklasse
end

local blipalpha=100

if zwinkel then
local blipfade
if zwinkel>cswpos then
blipfade=(math.pi*20)+math.floor(cswpos*10)-math.floor(zwinkel*10)
else
blipfade=math.floor(cswpos*10)-math.floor(zwinkel*10)
end
blipalpha=40+(140/62.82*blipfade)
end

local blibbradius=5
local smass=tonumber(wii[12])
if smass~=nil then
if smass>400000 then blibbradius=10
elseif smass>100000 then blibbradius=8
elseif smass>40000 then blibbradius=6
elseif smass>2000 then blibbradius=4
elseif smass>1000 then blibbradius=3
end
end

gr.setColor(baseR,baseG,baseB,blipalpha-20)
gr.drawCircle(blibbradius,bxkoord+13+math.random(-1,1),bykoord+13+math.random(-1,1))--radarpunkt
gr.setColor(baseR,baseG,baseB,blipalpha-10)
gr.drawCircle(blibbradius,bxkoord+13+math.random(-1,1),bykoord+13+math.random(-1,1))--radarpunkt
gr.setColor(baseR,baseG,baseB,blipalpha+10)
gr.drawCircle(blibbradius,bxkoord+13+math.random(-1,1),bykoord+13+math.random(-1,1))--radarpunkt
gr.setColor(baseR,baseG,baseB,blipalpha+20)
gr.drawCircle(blibbradius,bxkoord+13+math.random(-1,1),bykoord+13+math.random(-1,1))--radarpunkt
end
end
end





drawshipinfo = function(sinfo,posX,posY)
--zeichnet die ship-info box

gr.setColor(baseR,baseG,baseB,20)
gr.drawRectangle(posX-2,posY-2,posX+355,posY+290,true)

if table.getn(sinfo)==1 then return end


--weapons
local gun_strs={}
local mis_strs={}

for gk,gv in pairs(inf[1][9]) do
local guninfo=gv:split(":_:")

local isgunarmed="  "
if guninfo[2]=="1" then isgunarmed=" >" end

table.insert(gun_strs,isgunarmed..guninfo[1].." ["..guninfo[3].."]")
end


for mk,mv in pairs(inf[1][10]) do
local misinfo=mv:split(":_:")

local ismisarmed="  "

if misinfo[2]=="1" then if misinfo[5]=="1" then ismisarmed=">>" else ismisarmed=" >" end end


table.insert(mis_strs,ismisarmed..misinfo[1].." ["..misinfo[3].."]")
end


nicebox(posX,posY,350,70,'Weapons',{mis_strs,gun_strs})
nicebox(posX,posY+80,70,50,'ETS',{{"G","S","E"},{string.rep('|',inf[1][7][1]),string.rep('|',inf[1][7][2]),string.rep('|',inf[1][7][3])}})

nicebox(posX+80,posY+80,50,50,'CM.',{{sinfo[4][1]}})

if Shield_icon[sinfo[1][1]]~=nil then
--shields
shieldico = gr.loadTexture(Shield_icon[sinfo[1][1]],true)

gr.setColor(baseR,baseG,baseB,255)

gr.drawMonochromeImage(shieldico[1],posX+215,posY+90)


gr.setColor(baseR,baseG,baseB,(255/100*sinfo[6][1]))
gr.drawMonochromeImage(shieldico[2],posX+215,posY+90)

gr.setColor(baseR,baseG,baseB,(255/100*sinfo[6][2]))
gr.drawMonochromeImage(shieldico[3],posX+215,posY+90)

gr.setColor(baseR,baseG,baseB,(255/100*sinfo[6][3]))
gr.drawMonochromeImage(shieldico[4],posX+215,posY+90)

gr.setColor(baseR,baseG,baseB,(255/100*sinfo[6][4]))
gr.drawMonochromeImage(shieldico[5],posX+215,posY+90)


nicebox(posX+220,posY+80,100,110,'Shields',{{}})
else

nicebox(posX+220,posY+80,100,110,'Shields',{{"",sinfo[6][5],""},{sinfo[6][3],sinfo[6][1],sinfo[6][4]},{"",sinfo[6][2],""}})
end




local radarrangestring=""

if radar_range>1000 then
radarrangestring=(math.floor(radar_range/100)/10).." Km"
else
radarrangestring=radar_range.." m"
end

nicebox(posX+140,posY+80,70,50,'Radar',{{radarrangestring}})
nicebox(posX,posY+140,90,50,'Engine',{{"Speed","AB"},{sinfo[2][1],sinfo[5][1]}})

nicebox(posX,posY+200,350,90,'Damage',{inf[1][11]})


end


Shield_icon={}

Shield_icon['GTF Ulysses']='shield-f01'
Shield_icon['GTF Hercules']='shield-f06'
Shield_icon['GTF Hercules Mark II']='shieldft-02'
Shield_icon['GTF Ares']='shieldft-02x'
Shield_icon['GTF Erinyes']='shieldft-04'
Shield_icon['GTF Loki']='shield-f13'
Shield_icon['GTF Pegasus']='shieldft-01'
Shield_icon['GTF Perseus']='shieldft-03'
Shield_icon['GTF Myrmidon']='shieldft-05'
Shield_icon['SF Mara']='shieldfs-02'
Shield_icon['GTB Artemis']='shieldbt-03'
Shield_icon['GTB Medusa']='shield-b04'
Shield_icon['GTB Ursa']='shield-b05'
Shield_icon['GTB Zeus']='shield-b09'
Shield_icon['GTB Boanerges']='shieldbt-01'
Shield_icon['GVF Seth']='shield-f07'
Shield_icon['GVF Horus']='shield-f08'
Shield_icon['GVF Thoth']='shield-f09'
Shield_icon['GVF Serapis']='shieldfv-01'
Shield_icon['GVF Tauret']='shieldfv-02'
Shield_icon['GVB Sekhmet']='shieldbv-02'
Shield_icon['GVB Osiris']='shield-b06'
Shield_icon['GVB Bakha']='shieldbv-01'
Shield_icon['GVF Ptah']='shieldfv-04'
Shield_icon['SF Dragon']='shield-f03'
Shield_icon['SF Basilisk']='shield-f10'
Shield_icon['SF Manticore']='shield-f11'
Shield_icon['SF Aeshma']='shieldfs-01'
Shield_icon['SF Mara']='shieldfs-02'
Shield_icon['SF Astaroth']='shieldfs-03'
Shield_icon['SB Nephilim']='shield-b08'
Shield_icon['SB Taurvi']='shieldbs-01'
Shield_icon['SB Nahema']='shieldbs-02'
Shield_icon['SB Seraphim']='shield-b10'






drawmonitor = function(minfo,posX,posY)

gr.setColor(baseR,baseG,baseB,20)
gr.drawRectangle(posX-2,posY-2,posX+355,posY+150,true)
nicebox(posX,posY,350,55,'Wingmen',minfo)
nicebox(posX,posY+65,350,80,'Monitor',{{}})

end




drawtargetinfo = function(tinfo,posX,posY)
--zeichnet die target-info box

gr.setColor(baseR,baseG,baseB,20)
gr.drawRectangle(posX-2,posY-2,posX+355,posY+255,true)


local targetboxwidth=200
local targetboxheight=250

local targetrenderbreite=200
local targetrenderhoehe=200

local randabstand=5
local zeilenabstand=15

local targetrenderposx=posX
local targetrenderposy=posY+50


--testtex = gr.loadTexture("targetview1",true)
--gr.setColor(baseR,baseG,baseB,255)
--gr.drawMonochromeImage(testtex[1],posX,posY)
--gr.setColor(baseR,baseG,baseB,255)
--gr.drawMonochromeImage(testtex[2],posX,posY)


--umrandung
gr.setColor(baseR,baseG,baseB,100)
gr.drawRectangle(posX,posY,posX+targetboxwidth,posY+targetboxheight,false)

--hintergrund für die targetrenderbox
gr.setColor(baseR,baseG,baseB,25)
gr.drawRectangle(targetrenderposx,targetrenderposy,targetrenderposx+targetrenderbreite,targetrenderposy+targetrenderhoehe,true)


--hintergrund für die targetrenderbox
gr.setColor(baseR,baseG,baseB,50)

gr.drawRectangle(targetrenderposx+targetrenderbreite-38,targetrenderposy,targetrenderposx+targetrenderbreite,targetrenderposy+zeilenabstand,true)
gr.drawRectangle(targetrenderposx,targetrenderposy,targetrenderposx+targetrenderbreite-38,targetrenderposy+2,true)

gr.setColor(baseR,baseG,baseB,150)

gr.drawRectangle(targetrenderposx+targetrenderbreite-5,targetrenderposy+zeilenabstand,targetrenderposx+targetrenderbreite,targetrenderposy+targetrenderhoehe,true)


if table.getn(tinfo) == 9 then
local calpha=255
local R,G,B,A

--if wii[10] and wii[10]==1 then
-- R,G,B,A = 50,50,255,calpha
if tinfo[1][1] == "Hostile" or tinfo[1][1] == "Traitor" or tinfo[1][1] == "Neutral" then
R,G,B,A = 255,0,0,calpha
elseif tinfo[1][1] == "Friendly" then
R,G,B,A = 0,255,0,calpha
elseif tinfo[1][1] == "Unknown" then
R,G,B,A = 255,0,255,calpha
elseif tinfo[1][1] == "Asteroid" then
R,G,B,A = 155,155,155,calpha
else
R,G,B,A = 128,128,128,calpha
end

gr.setColor(R,G,B,A)


gr.drawString(tinfo[2][1].." ("..tinfo[1][1]..")",posX+randabstand,posY+randabstand)--name


gr.drawString(tinfo[3][1],posX+randabstand,posY+(zeilenabstand*1)+randabstand)--klasse


gr.drawString("D: "..tinfo[4][1],posX+randabstand,posY+(zeilenabstand*2)+randabstand)--entfernung


gr.drawString("S: "..tinfo[5][1],posX+randabstand+targetboxwidth-50,posY+(zeilenabstand*2)+randabstand)--geschwindigkeit


gr.setColor(baseR,baseG,baseB,255)
gr.drawString(tinfo[6][1].."%",posX+randabstand+targetboxwidth-40,posY+(zeilenabstand*3)+randabstand+randabstand)--hull integrity

if tinfo[7][1]~="-" then
local targetshiphandle = tb.ShipClasses[(tinfo[7][1]+1)]

if targetshiphandle ~= nil and targetshiphandle:isValid() then
targetshiphandle:isModelLoaded(true)
local tpostest=ba.createVector(tinfo[9][1],tinfo[9][2],tinfo[9][3]):getOrientation()
targetshiphandle:renderTechModel2(targetrenderposx,targetrenderposy,targetrenderposx+targetrenderbreite,targetrenderposy+targetrenderhoehe,tpostest,0.95)
end
end

if table.getn(tinfo[8])==5 then
--nicebox(posX+targetrenderbreite+10,posY+50,100,110,'Shields',{{"",tinfo[8][5],""},{tinfo[8][3],tinfo[8][1],tinfo[8][4]},{"",tinfo[8][2],""}})

if Shield_icon[tinfo[3][1]]~=nil then
--shields
shieldico = gr.loadTexture(Shield_icon[tinfo[3][1]],true)

gr.setColor(baseR,baseG,baseB,255)

gr.drawMonochromeImage(shieldico[1],posX+targetrenderbreite+5,posY+60)


gr.setColor(baseR,baseG,baseB,(255/100*tinfo[8][1]))
gr.drawMonochromeImage(shieldico[2],posX+targetrenderbreite+5,posY+60)

gr.setColor(baseR,baseG,baseB,(255/100*tinfo[8][2]))
gr.drawMonochromeImage(shieldico[3],posX+targetrenderbreite+5,posY+60)

gr.setColor(baseR,baseG,baseB,(255/100*tinfo[8][3]))
gr.drawMonochromeImage(shieldico[4],posX+targetrenderbreite+5,posY+60)

gr.setColor(baseR,baseG,baseB,(255/100*tinfo[8][4]))
gr.drawMonochromeImage(shieldico[5],posX+targetrenderbreite+5,posY+60)


nicebox(posX+targetrenderbreite+10,posY+50,100,110,'Shields',{{}})
else

nicebox(posX+targetrenderbreite+10,posY+50,100,110,'Shields',{{"",tinfo[8][5],""},{tinfo[8][3],tinfo[8][1],tinfo[8][4]},{"",tinfo[8][2],""}})
end

end

else

gr.drawString("No Target",posX+randabstand,posY+randabstand)--name

end
end



function string:split(delimiter)
  local result = { }
  local from  = 1
  local delim_from, delim_to = string.find( self, delimiter, from  )
  while delim_from do
    table.insert( result, string.sub( self, from , delim_from-1 ) )
    from  = delim_to + 1
    delim_from, delim_to = string.find( self, delimiter, from  )
  end
  table.insert( result, string.sub( self, from  ) )
  return result
end

update()


]
+Override: true

$On Key Pressed: [
kp=hv.Key

if hv.Key=="2" and radar_range<10000 then
radar_range = radar_range+500
elseif hv.Key=="1" and radar_range>500 then
radar_range = radar_range-500
end

]

#End


positions of the info boxes can be changed in the "config" section of the client scripting.tbl ^^


Title: Re: auxiliary-Instrument Display
Post by: mikes3ds on March 29, 2013, 05:12:04 pm
Wow very cool. Tried it out works great!
Title: Re: auxiliary-Instrument Display
Post by: Nuke on March 31, 2013, 06:03:31 am
i wanted to do something like this on my raspberry pi, not using the fs engine, but my own little hud client. but i still dont have a decent screen for it. everything looks horrible on the composite display i have, and small hdmi displays that are cheap are non-existant. i got me a vga adapter, but not before my other monitor stopped working.
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on April 02, 2013, 01:38:00 pm
Man, big thanks, i was searching many time to find this....   :yes:

If you need something help or anything please....

 
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on April 04, 2013, 01:57:11 pm
Now we can move out some elements from the screen and leave it more clear, great!, are you planning to include the Messages also?, would be amazing  :p

Many Thanks again...

(http://img703.imageshack.us/img703/5383/radarsystem.jpg)

Title: Re: auxiliary-Instrument Display
Post by: PoDo on April 04, 2013, 03:15:02 pm
that looks really awesome ^^

btw. i forgot to mention, you can change the radar range by pressing "1" and "2" on the computer which displays it.
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on April 07, 2013, 06:23:49 am
Hello

The client pc give me this error many times and crashes, always with the game running, not on the startup.

Code: [Select]
Verify failure: Vbuf1 != NULL

ntdll.dll! ZwWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_18.exe! <no symbol>
fs2_open_3_6_18.exe! <no symbol>
fs2_open_3_6_18.exe! <no symbol>
fs2_open_3_6_18.exe! <no symbol>
fs2_open_3_6_18.exe! <no symbol>
fs2_open_3_6_18.exe! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>


Also i noticed in some mods doesn´t runs, i want to ask you...

If the script is ready to run on any mod, and if not, if is possible to modify the tbl to run with other mods,
you know, put the Ships here, the Species there, the weapons...

Sorry because i don´t know nothing about programming     :p

Thanks again...
Title: Re: auxiliary-Instrument Display
Post by: PoDo on April 09, 2013, 02:22:24 am


what exactly were you doing when in crashed? what mod were you playing? did you target anything right before it crashed?
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on April 09, 2013, 05:45:01 pm
Hi

I was doing some new test, at the momment i´m using the little StarWars MOD because i don´t know how to run it in other    :(
I don´t know if i doing something wrong.

The MOD is not finished and has some bugs, may be the errors comes from there, but i´m on surprise seeing that erros appears on the
client pc and not on the server, or both, is the reason why i ask you...
There are erros in some of the missions, when the Imperial Star Destroyers arrives, and in 2 of the missions the client looks inactive.
In other Mod that i have free of erros, also the client looks inactive, but maybe the mod is a bit old...

The Mod is here if you want to test it.

https://docs.google.com/file/d/0B3Dyvhh0sT_oWjhtMTRUdDNiSVk/edit?pli=1 (https://docs.google.com/file/d/0B3Dyvhh0sT_oWjhtMTRUdDNiSVk/edit?pli=1)


Thanks for the attemption, i will try to test it in other mods to do a better report in case.








Title: Re: auxiliary-Instrument Display
Post by: chief1983 on April 09, 2013, 07:20:52 pm
I don't know if google docs is supposed to be used for mass sharing of files like that, if you get too many downloads you're liable to get the account disabled.  I could be wrong though.
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on June 10, 2013, 01:57:11 pm
Another photo with triplehead and radar...  :)


(http://img585.imageshack.us/img585/3291/radarxa.jpg)
Title: Re: auxiliary-Instrument Display
Post by: totiselles on June 10, 2013, 05:03:35 pm
What about combining a extracting script with a touchscreen systems control

(http://www.hard-light.net/forums/index.php?action=dlattach;topic=84132.0;attach=21505)

refer to Desrat Touchdown webserver for interactive cockpit http://desratsworld.co.uk/TouchDown/viewtopic.php?f=3&t=5 (http://desratsworld.co.uk/TouchDown/viewtopic.php?f=3&t=5)

any chance to send radar and other gauges to a web page?
then we can combine to get buttons and controls

[attachment deleted by ninja]
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on June 10, 2013, 05:36:20 pm
Looks nice !, i like real buttons more than touchscreen solutions, but is good if we have more posibilities...
Would be great if we combine it...

I love this soutions because the main screens are more clear of gauges and is possible to build a nice cockpit
At the momment i don´t know if Podo ( the creator of the script ) or someone will update the script.
Is working good but it needs a good computer.

Thanks for the useful information

Title: Re: auxiliary-Instrument Display
Post by: PoDo on June 10, 2013, 05:43:42 pm
I'm planning on further features and some little speed improvements, but at the moment I lack time due to work.

But i really like the touch screen idea, I think that would be fun to play around with. I'll definitely keep that in mind :nod:
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on June 11, 2013, 02:11:38 am
Great news Podo !, many thanks and don´t worry about any delay...

Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on June 23, 2013, 02:26:52 am
Another option....


http://www.gadrocsworkshop.com/helios (http://www.gadrocsworkshop.com/helios)


Helios

Helios is an advanced glass cockpit and cockpit integration package which connects your simulation cockpit to your simulation.
Helios can help you make your custom panel come alive with functioning indicators and switches.
Helios can also turn your touch screen into a fully functional glass cockpit. You've never experienced this level of immersion
before in a flight simulation!

Once you've flown with a Helios setup you'll never want to fly with out it!

- WYSIWYG Drag & Drop Panel Designer
- Aircraft Gauges & Images
- Touch Screen Controls
- Physical Cockpit Interfaces


(http://img708.imageshack.us/img708/9819/kn1f.jpg)



(http://img855.imageshack.us/img855/4879/y48j.jpg)

Title: Re: auxiliary-Instrument Display
Post by: totiselles on June 23, 2013, 05:52:55 am
Is there a way to send via Lua scripting game data to external programs?

What steps should I take to start working with it?
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on June 23, 2013, 08:25:46 am
Personally i don´t know anything about programming, just sometimes i was modifying some scripts.

But i think this is a good starting point...

http://www.hard-light.net/forums/index.php?topic=45554.0 (http://www.hard-light.net/forums/index.php?topic=45554.0)

The topic from PoDo that you are reading i think it helps as well.

And maybe this ?

http://www.gadrocsworkshop.com/node/73 (http://www.gadrocsworkshop.com/node/73)


Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on July 11, 2013, 04:58:05 pm

Touch-Buddy

http://touch-buddy.com/forums/faq/18-master-faq.html (http://touch-buddy.com/forums/faq/18-master-faq.html)

http://www.youtube.com/watch?v=oKv8KR8bX7w (http://www.youtube.com/watch?v=oKv8KR8bX7w)

Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on February 11, 2014, 02:32:10 am
Hi.

I was testing the script from PoDo with a new configuration, just i was splitting the main monitor into 4 parts simulating 4 independent screens.
Good small screens are expensive and i´m not sure how the mini dvd from cars screens works, also the connections can be a nightmare, so i'm looking for small vga screens but at the momment only i found from China and i don´t trust too much on it.
As well i will try to switch on some lights from an Arduino ( when i have ) and after that, test to control them via Lua-Socket like Nuke suggest me to try.

Someone knows if the "Message Head-Pilots window" can be launched on the same way ?, i´m a bit confused on how  the gauges can be extracted because i saw many different opinions.
Good thing about this script is that all the data is stored ( mirrored ) on the client-aux pc, so may be is just trigger it.


Thanks, i love this script  :)

(http://imageshack.com/a/img827/644/5tgk.jpg)
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on February 14, 2014, 01:18:45 pm
Stupid me  :mad:, I never saw this thread ...

http://www.hard-light.net/forums/index.php?topic=80737.0 (http://www.hard-light.net/forums/index.php?topic=80737.0)
Title: Re: auxiliary-Instrument Display
Post by: Nuke on February 16, 2014, 10:48:02 am
one of these days i need to finish the firmware for that thing.
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on February 16, 2014, 02:56:36 pm
Many thanks, we understand that it takes time and dedication...   :yes:

Title: Re: auxiliary-Instrument Display
Post by: totiselles on April 18, 2015, 02:46:22 am
Is this project died?

Any chance of retaking it?

tty in advance
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on April 18, 2015, 04:03:32 am
I don´t know how many times I tried to do something, but this requires some programming knowledge, and I just always feel lost in the sea of ​​code  :lol:

All I've done is change the colors and positions, anyway, It is an amazing script, and just with another pc you can enjoy so much.
There are some people interested in this kind of things, perhaps someday, we have updates.  :D

Title: Re: auxiliary-Instrument Display
Post by: totiselles on April 18, 2015, 05:10:02 am
ty for fast response
Title: Re: auxiliary-Instrument Display
Post by: PoDo on April 20, 2015, 02:55:36 am
some time ago, well a long time ago, i already started  a complete rewrite of the whole thing, but i kind of shelved it due to lack of time, but if there is enough interest i might give it another go ^^
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on April 20, 2015, 03:32:47 am
I promise you, this script makes me more illusion than Episode VII   ;)

Anything you need for help, please ask, many thanks for the interest   :yes:
Title: Re: auxiliary-Instrument Display
Post by: coffeesoft on November 06, 2015, 01:03:25 pm
I just wanted to add this application, It lets you create an interface for use with the tablet-phone and games.

ROCCAT Power Grid

http://www.roccat.org/en-US/Products/Gaming-Software/Power-Grid/Home/ (http://www.roccat.org/en-US/Products/Gaming-Software/Power-Grid/Home/)

(http://i.imgur.com/fLV3EQR.jpg)