-
Posts
160 -
Joined
-
Last visited
Posts posted by NQ-Nomad
-
-
Hi guys,
For various logistical reasons, we picked the Wednesday August, 21st to organize our MeetUp in Cologne this year.
It's not ideal but considering our constraints, this is preferable for us.
We hope to see you there!
Cheers,
Nomad
-
Hi guys,
Following up the release of the third Alpha 2 DevBlog about Lua, we wanted to develop things further for the most curious, dedicated and skilled among you. The API has changed so you guys will have to redo a certain amount of stuff. This being said, you'll find below some documentation that will allow you to do pretty neat stuff so knock yourselves out!
Thanks to NQ-Arlequin for his help and for writing this!
How does it work
All ControlUnits (Cockpits, HovercraftSeats and ProgramingBoards) can display information on the screen when activated by the current player. CockpitUnits and PilotingSeats have predefined behavior that should suit most players. However advanced players can edit the ControlUnit LUA script to adapt the display to their needs.
There are different levels of customization possible:
- Intermediate Difficulty: Show/hide the default widget of an element linked to the Control Unit.
- Advanced Difficulty: Mixing those widgets in custom panels. (New in Alpha 2)
- Expert Difficulty: Create custom widgets from your own data or existing elements data. (New in Alpha 2)
- Expert Difficulty: Create your own HTML code to display custom content on your screen. (Modified in Alpha 2)
Default behavior
Cockpit view
Hovercraft Seat
Programing Board
Hovercraft Seat and Programming Board widgets do stack:
Adding/removing element widgets in Lua
API:
slot.show() slot.hide()
Default Cockpit LUA Script
We can instead only show the Core Unit widget, and hide the Control Unit widget (shown by default):
core.show() unit.hide()
NEW - Reorganizing Element widgets within panels in Lua
API:
system.createWidgetPanel(title) → panelId system.destroyWidgetPanel(panelId) system.createWidget(panelId, type) → widgetId system.destroyWidget(widgetId) system.addDataToWidget(dataId, widgetId) system.removeDataFromWidget(dataId, widgetId) slot.getDataId() → dataId slot.getWidgetType() → type
Instead of having all the fuel container widgets in different panels, I can create my own panel and add all fuel widgets to this panel:
fuelPanel = system.createWidgetPanel("Fuel Tanks") for i=1,container_size do widget = system.createWidget(fuelPanel, container[i].getWidgetType()) system.addDataToWidget(container[i].getDataId(), widget) end
NEW - Creating custom widgets in Lua
API:
system.createData(json) → dataId system.destroyData(dataId) system.updateData(dataId, json) slot.getData() → json
You can finally write your own custom data, and display them using predefined custom widget types. 4 exist for now: text, title, value, and gauge.
panel = system.createWidgetPanel("Panel") -- Display “Hello World” widgetText = system.createWidget(panel, "text") dataText = system.createData('{"text": "Hello World"}') system.addDataToWidget(dataText, widgetText) -- Display a title “Title” widgetTitle = system.createWidget(panel, "title") dataTitle = system.createData('{"text": "Title"}') system.addDataToWidget(dataTitle, widgetTitle) -- Display a gauge filled at 60% widgetGauge = system.createWidget(panel, "gauge") dataGauge = system.createData('{"percentage": 60}') system.addDataToWidget(dataGauge, widgetGauge) -- Display “Weight 80 kg” widgetValue = system.createWidget(panel, "value") dataValue = system.createData('{"label": "Weight", "value": "80", "unit": "kg"}') system.addDataToWidget(dataValue, widgetValue)
You can now combine all those methods to create your own customized panels.
CHANGED- Customize screen using html code.
API:
system.setScreen(htmlContent) system.showScreen(1/0)
You can write your own html code to change the appearance of the control unit screen. It will be displayed below the widgets, so if you want full control: you can hide all widgets.
html = '<div class="monitor_left window">' html = html .. '<div class="center window">monitor_left</div>' html = html .. '</div>' html = html .. '<div class="monitor_right" style="background-color: red;">' html = html .. '<div class="center window">monitor_right</div>' html = html .. '</div>' system.setScreen(html) system.showScreen(1)
Predefined style classes
class=”monitor_left” defines the area of the left monitor.
class=”monitor_right” defines the area of the right monitor.class=”grid” stacks all its child elements on an invisible wrapping vertical grid.
class=”center” positions an element centered to its parent. Can be the viewport.class=”window” applies the Dual Universe background and border.
Well, that's it for this time! We hope you'll enjoy the info here to surprise us
Cheers,
Nomad
- JudgementXY, Cronael, hdparm and 8 others
- 11
-
Hi guys,
The idea of making a podcast has been circling in our heads for some time. We wanted to reach out to our community in a new and captivating way, and today you can discover the end result.
We're very excited to bring you some behind the scenes material and invite you to join us while we discuss what's new in DU. If the community's response is positive, we may make a series out of it.
You can listen to this first episode below on YouTube:
It's also available on SoundCloud:
Happy listening! We'd love to hear your feedback!
Cheers,
Nomad
-
Hi guys,
On March, 6th, we organized a special stress-test with thousands of simulated players. Our objective was to showcase our unique server technology and test it under live conditions! Dozens of human Alpha players were invited and participated as well, as witnesses of the event. You can discover the details on the news here.
Don't hesitate to comment below!
Cheers,
The Novaquark Team
-
-
If you want to comment, we invite you to go here! ?
-
-
- Code24, Geo, Onethousandstars and 2 others
- 5
-
- Onethousandstars, Yuu, klobber and 4 others
- 7
-
-
- Code24 and Onethousandstars
- 2
-
-
-
-
- Onethousandstars and Mhaijik
- 2
-
-
- Atmosph3rik, kulkija, Destrin and 2 others
- 5
-
- klobber, Dinkledash, Destrin and 4 others
- 7
-
-
-
-
-
-
- gravetender and klobber
- 2
Alpha 2 Lua changes and novelties
in General Discussions
Posted
Thanks Patrox! The original post has been edited to fix this.
Cheers,
Nomad