Jump to content
NEWMidgetMAN

Beta Fix To add On 3rd Person Cockpit HUD

Recommended Posts

---------- How to Use-------------------------------------

 

Requirements:

Program Board

Databank

 

 


Activate Program Board anytime you want to activate the 3rd person HUD, but data only updates while your in the Cockpit.

 


This is a fix using elements and Lua for 3rd person Cockpit.
----------How to Install:

 

Add Unit tick Up3rd to any cockpit. It will not affect the program used in the cockpit so any HUD can be used with this.
Just add databank to cockpit.


Then paste Json to ProgramBoard and link with the correct slots.
----------
----This is setup to use:
1 space fuel tank
1 atmo fuel tank
2 weapons
1 radar
1 cockpit
-----If you do not use all the elements then delete any lines using that element.
For ex. if no weapons or radar then delete entire widget area and any lines containing the words weapons or radars from both cockpit and PB.

 

 

 

Slots                       Hook up in this order and rename slots ONLY FOR THE ProgamBoard.

Cockpit Add on
slot? --> databank

 

 

Program Board
slot1 --> databank

 


--------Cockpit ONLY -------------------------------------------------------------------------
------Cockpit Unit Start ADD----------------

unit.setTimer("Up3rd",0.08)

------Cockpit Unit Tick Up3rd------------

databank.setStringValue("cockpit",unit.getData())
databank.setStringValue("atmofueltank",atmofueltank_1.getData())
databank.setStringValue("spacefueltank",spacefueltank_1.getData())
databank.setStringValue("radar",radar_1.getData())
databank.setStringValue("weapon",weapon_1.getData())
databank.setStringValue("weapon2",weapon_2.getData())

--------Program Board ONLY---------------------------------------------------------------------------






------Unit Start----------------

unit.setTimer("pbcp",0.08)


--unittick pbcp ------------------

cockpit= databank.getStringValue("cockpit")
system.updateData(dataValuemain, cockpit) 
cockpitatmo= databank.getStringValue("atmofueltank")
system.updateData(dataValueatmo, cockpitatmo) 
cockpitatmo= databank.getStringValue("spacefueltank")
system.updateData(dataValueatmo, cockpitspace) 
cockpitradar= databank.getStringValue("radar")
system.updateData(dataValueradar, cockpitradar) 

cockpitweapon= databank.getStringValue("weapon")
system.updateData(dataValueweapon, cockpitweapon) 
cockpitweapon2= databank.getStringValue("weapon2")
system.updateData(dataValueweapon2, cockpitweapon2)

--unitstart



----cockpit main-----
cockpit= databank.getStringValue("cockpit")
panelmain = system.createWidgetPanel("CockPit PB")

widgetValuemain = system.createWidget(panelmain, "cockpit")
dataValuemain = system.createData(cockpit) 
system.addDataToWidget(dataValuemain, widgetValuemain)




----atmos widget-----
cockpitatmo= databank.getStringValue("atmofueltank")
panelatmo = system.createWidgetPanel("Nitron")

widgetValueatmo = system.createWidget(panelatmo, "fuel_container")
dataValueatmo = system.createData(cockpitatmo) 
system.addDataToWidget(dataValueatmo, widgetValueatmo)




----spaces widget-----
cockpitspace= databank.getStringValue("spacefueltank")
panelspace = system.createWidgetPanel("Kergon")

widgetValuespace = system.createWidget(panelspace, "fuel_container")
dataValuespace = system.createData(cockpitspace) 
system.addDataToWidget(dataValuespace, widgetValuespace)

----radars widget-----
cockpitradar= databank.getStringValue("radar")
panelradar = system.createWidgetPanel("Radar")

widgetValueradar = system.createWidget(panelradar, "radar")
dataValueradar = system.createData(cockpitradar) 
system.addDataToWidget(dataValueradar, widgetValueradar)





----radarperiscopes widget-----
cockpitradarperiscope= databank.getStringValue("radarperiscope")
panelradarperiscope = system.createWidgetPanel("Periscope")

widgetValueradarperiscope = system.createWidget(panelradarperiscope, "periscope")
dataValueradarperiscope = system.createData(cockpitradarperiscope) 
system.addDataToWidget(dataValueradarperiscope, widgetValueradarperiscope)

cockpitradarperiscope= databank.getStringValue("radarperiscope")
system.updateData(dataValueradarperiscope, cockpitradarperiscope) 





----weapon widget-----
cockpitweapon= databank.getStringValue("weapon")
panelweapon = system.createWidgetPanel("weapon")

widgetValueweapon = system.createWidget(panelweapon, "weapon")
dataValueweapon = system.createData(cockpitweapon) 
system.addDataToWidget(dataValueweapon, widgetValueweapon)





----weapon2 widget-----
cockpitweapon2= databank.getStringValue("weapon2")
widgetValueweapon2 = system.createWidget(panelweapon, "weapon2")   ---adds to same panel
dataValueweapon2 = system.createData(cockpitweapon2) 
system.addDataToWidget(dataValueweapon2, widgetValueweapon)

unit.hide()
unit.setTimer("pbcp",0.08)

Json Paste Program Board ONLY

{"slots":{"0":{"name":"databank","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"\n----cockpit main-----\ncockpit= databank.getStringValue(\"cockpit\")\npanelmain = system.createWidgetPanel(\"CockPit PB\")\n\nwidgetValuemain = system.createWidget(panelmain, \"cockpit\")\ndataValuemain = system.createData(cockpit) \nsystem.addDataToWidget(dataValuemain, widgetValuemain)\n\n----atmos widget-----\ncockpitatmo= databank.getStringValue(\"atmofueltank\")\npanelatmo = system.createWidgetPanel(\"Nitron\")\n\nwidgetValueatmo = system.createWidget(panelatmo, \"fuel_container\")\ndataValueatmo = system.createData(cockpitatmo) \nsystem.addDataToWidget(dataValueatmo, widgetValueatmo)\n\n----spaces widget-----\ncockpitspace= databank.getStringValue(\"spacefueltank\")\npanelspace = system.createWidgetPanel(\"Kergon\")\n\nwidgetValuespace = system.createWidget(panelspace, \"fuel_container\")\ndataValuespace = system.createData(cockpitspace) \nsystem.addDataToWidget(dataValuespace, widgetValuespace)\n\n----radars widget-----\ncockpitradar= databank.getStringValue(\"radar\")\npanelradar = system.createWidgetPanel(\"Radar\")\n\nwidgetValueradar = system.createWidget(panelradar, \"radar\")\ndataValueradar = system.createData(cockpitradar) \nsystem.addDataToWidget(dataValueradar, widgetValueradar)\n\n----radarperiscopes widget-----\ncockpitradarperiscope= databank.getStringValue(\"radarperiscope\")\npanelradarperiscope = system.createWidgetPanel(\"Periscope\")\n\nwidgetValueradarperiscope = system.createWidget(panelradarperiscope, \"periscope\")\ndataValueradarperiscope = system.createData(cockpitradarperiscope) \nsystem.addDataToWidget(dataValueradarperiscope, widgetValueradarperiscope)\n\ncockpitradarperiscope= databank.getStringValue(\"radarperiscope\")\nsystem.updateData(dataValueradarperiscope, cockpitradarperiscope) \n\n----weapons widget-----\ncockpitweapon= databank.getStringValue(\"weapon\")\npanelweapon = system.createWidgetPanel(\"weapon\")\n\nwidgetValueweapon = system.createWidget(panelweapon, \"weapon\")\ndataValueweapon = system.createData(cockpitweapon) \nsystem.addDataToWidget(dataValueweapon, widgetValueweapon)\n\n\n----weapon2s widget-----\ncockpitweapon2= databank.getStringValue(\"weapon2\")\nwidgetValueweapon2 = system.createWidget(panelweapon, \"weapon2\")   ---adds to same panel\ndataValueweapon2 = system.createData(cockpitweapon2) \nsystem.addDataToWidget(dataValueweapon2, widgetValueweapon)\n\n\nunit.hide()\nunit.setTimer(\"pbcp\",0.08)\n","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"cockpit= databank.getStringValue(\"cockpit\")\nsystem.updateData(dataValuemain, cockpit) \ncockpitatmo= databank.getStringValue(\"atmofueltank\")\nsystem.updateData(dataValueatmo, cockpitatmo) \ncockpitatmo= databank.getStringValue(\"spacefueltank\")\nsystem.updateData(dataValueatmo, cockpitspace) \ncockpitradar= databank.getStringValue(\"radar\")\nsystem.updateData(dataValueradar, cockpitradar) \n\ncockpitweapon= databank.getStringValue(\"weapon\")\nsystem.updateData(dataValueweapon, cockpitweapon) \ncockpitweapon2= databank.getStringValue(\"weapon2\")\nsystem.updateData(dataValueweapon2, cockpitweapon2) ","filter":{"args":[{"value":"pbcp"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"1"}],"methods":[],"events":[]}

 

Share this post


Link to post
Share on other sites

Thank you so much for this skript !

 

But ther is a little error in your script ->

 

--unittick pbcp ------------------

cockpit= databank.getStringValue("cockpit")
system.updateData(dataValuemain, cockpit) 
cockpitatmo= databank.getStringValue("atmofueltank")
system.updateData(dataValueatmo, cockpitatmo) 
cockpitatmo= databank.getStringValue("spacefueltank")
system.updateData(dataValueatmo, cockpitspace) 
cockpitradar= databank.getStringValue("radar")
system.updateData(dataValueradar, cockpitradar) 

cockpitweapon= databank.getStringValue("weapon")
system.updateData(dataValueweapon, cockpitweapon) 
cockpitweapon2= databank.getStringValue("weapon2")
system.updateData(dataValueweapon2, cockpitweapon2)

 

at the spacefueltank

system.updateData (dataValuespace, cockpitspace)

 

Share this post


Link to post
Share on other sites
On 10/10/2020 at 5:10 PM, Exilog said:

Thank you so much for this skript !

 

But ther is a little error in your script ->

 


--unittick pbcp ------------------

cockpit= databank.getStringValue("cockpit")
system.updateData(dataValuemain, cockpit) 
cockpitatmo= databank.getStringValue("atmofueltank")
system.updateData(dataValueatmo, cockpitatmo) 
cockpitatmo= databank.getStringValue("spacefueltank")
system.updateData(dataValueatmo, cockpitspace) 
cockpitradar= databank.getStringValue("radar")
system.updateData(dataValueradar, cockpitradar) 

cockpitweapon= databank.getStringValue("weapon")
system.updateData(dataValueweapon, cockpitweapon) 
cockpitweapon2= databank.getStringValue("weapon2")
system.updateData(dataValueweapon2, cockpitweapon2)

 

at the spacefueltank

system.updateData (dataValuespace, cockpitspace)

 

Another error at spacefueltank:

cockpitspace= databank.getStringValue("spacefueltank")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...