X4 UI modding/scripting discussion

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
JSDD
Posts: 1378
Joined: Fri, 21. Mar 14, 20:51
x3tc

X4 UI modding/scripting discussion

Post by JSDD » Thu, 17. Aug 17, 12:30

Edit: Several posts split off from the X4 - UI and scripting thread for further discussion - Sparky


just want to state the obvious:
x3 SE scripting is MUCH BETTER (!!!) than scripting in an "xml-based laguage"

some might say, X3 SE is / was xml-based, but that's not what it looked like IN THE EDITOR, the "thing" that scripters use to script ;)

replacing "the editor" with visual web developer, then you have X3 MD scripting (one of the most un-readable code on the X-planet)
replacing "the editor" with X3 SE, then you have the kind of scripting we all want: "readable", "procedual" code, you know what instructions take place immediaely (like void do_something(void); ), and what takes its time (@fly to sector xyz)

the point is:
it doesnt matter how the code will be represented (xml, binary, lua style, whatever), we want a tool to be able to code "conveniently"

that way, maybe lucike would come back, help egosoft to creating a better game ...


in my opinion, keep the xml-based stuff, but give us a tool which we can use to code "conveniently", that means without having to type:

Code: Select all

<action> do.something() >
<timing>0</timing>
</action>
<action> do.something().else() >
<timing>@#f*ck_ing_after.do.something()</timing>
</action>
the x3se typing would be:

Code: Select all

do.something ... arg1, arg2, ...
do.something.else ... arg1, arg2, ...
@do.something.timeconsuming: skipwaitinguntilcompleted=false... arg1, arg2, ...

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

since this topic is about "UI and scripting" and X-games are "event-driven":
give us the possibility to structure our own "menu", no matter how, but most likely xml-based code to tell the engine:
---> open background rectangle x=... y=... width=... height=... color=0xFFAA00FF

Code: Select all

<label name="whatever">
<position x=... etc youknowwhat />
</label>

<button name"anotheruniquenme" callback="mycallbackfile.xml" />
give us the opportunity to "load" / "open" this custom menu, add our own callback functions, and i think most of us will be happy :)


a menu script could then look like:

Code: Select all

$menuhandle = open menu: name: "mycustommenu.xml"
if ($menuhandle)
@wait for menu: $menuhandle // makes this script wait until <menu_closed> event
end

//just respond here or handle the input in a callback script
again, this could be ALL ONE xml-FILE, _UI + script + otherstuff, we only want the ability the see the code logic kind of "procedural" without <xml-tags/>

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

by the way:
editing while playing is IMPORANT, but doesnt have to be an ingame editor, but we want to be able to test the scripts immmediately while coding, <ALT> + <TAB> -ing quickly isnt a big problem, but having to restart / reload a game is kind of a problem (imho)
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Thu, 17. Aug 17, 13:50

JSDD wrote: .......*snip*.......
give us the possibility to structure our own "menu", no matter how, but most likely xml-based code to tell the engine:
---> open background rectangle x=... y=... width=... height=... color=0xFFAA00FF

Code: Select all

<label name="whatever">
<position x=... etc youknowwhat />
</label>

<button name"anotheruniquenme" callback="mycallbackfile.xml" />
give us the opportunity to "load" / "open" this custom menu, add our own callback functions, and i think most of us will be happy :)


a menu script could then look like:

Code: Select all

$menuhandle = open menu: name: "mycustommenu.xml"
if ($menuhandle)
@wait for menu: $menuhandle // makes this script wait until <menu_closed> event
end

//just respond here or handle the input in a callback script
again, this could be ALL ONE xml-FILE, _UI + script + otherstuff, we only want the ability the see the code logic kind of "procedural" without <xml-tags/>
.....*snip*.....
That would be awesome but ..... imho it doesn't work. I've spent a lot of time trying to develop an XML/UI interface, in vain. Main problem is the UI which is coded by an unsupported program (Anark & Fcollada) and does not allow direct parsing from XML.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
JSDD
Posts: 1378
Joined: Fri, 21. Mar 14, 20:51
x3tc

Post by JSDD » Thu, 17. Aug 17, 14:12

euclid wrote: That would be awesome but ..... imho it doesn't work. I've spent a lot of time trying to develop an XML/UI interface, in vain. Main problem is the UI which is coded by an unsupported program (Anark & Fcollada) and does not allow direct parsing from XML.

i dont understand it, what exactly the problem is ...
--> xml-parsing and getting strings / IDs out of xml-files shouldnt be a problem
--> creating "rectangles" or other shapes on screen depending on the parsed values isnt a problem either
--> detecting events on those shapes and transferring them to the created menus is also not a problem

now comes the scripting part:
--> depending on parsed xml-files (for UI), where is the problem in calling the right callback for the right button ?
(since that is already possible in X3, see "send incoming question: callback=...")
--> what the scripter does in callbacks shouldnt matter to the engine

we already have the possibility in X3 SE to:

Code: Select all

send incoming question: text=... callback="myscript"
the text determined the buttons to display in the message, the callback can access the answer (= input event) as an script argument

imagine the "text" is a <UI>...</UI> node (in any file) which describes the menu layout ...
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Thu, 17. Aug 17, 15:44

It seems you have a good idea how this could actually work. So, by all means, open a corresponding thread over at the S&M forum and I'm sure you'll find lot of support (you got mine) for developing such an interface.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Thu, 17. Aug 17, 17:22

suggestion relating to UI: why not rely on some generically written UI Scripts which can be suited for almost any Situation by Parameter and define all Menus with nested Tables in MD? at least thats my approach, and so far it works fine for me..
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Thu, 17. Aug 17, 18:29

That's interesting Uni, still I think we should continue this over at the S&M forum ;-)

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Ilintar
Posts: 122
Joined: Sat, 5. Jul 08, 23:39
x3tc

Post by Ilintar » Fri, 18. Aug 17, 00:10

Just an idea - maybe use MPS? It allows you to keep a declarative language, while instantly making an editor with both syntax and semantic validation available AND allows keeping the treelike structure of XML without the overhead of the bulky XML markers.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Fri, 18. Aug 17, 01:20

Taking on euclid's suggestion, I've split off these posts from the original thread. If this would be better served in a different scripting forum, I'm sure euclid or Uni can move it or get it moved :)

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Sat, 19. Aug 17, 13:39

Good move Sparky but this thread has gone awfully quiet now. What happened to the initial "good ideas & claims"? ;-)

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

User avatar
JSDD
Posts: 1378
Joined: Fri, 21. Mar 14, 20:51
x3tc

Post by JSDD » Sat, 19. Aug 17, 13:46

euclid wrote:It seems you have a good idea how this could actually work. So, by all means, open a corresponding thread over at the S&M forum and I'm sure you'll find lot of support (you got mine) for developing such an interface.
what do you mean by that ?
egosoft's job is to develop that, so that we (scripters & modders) have the ability to design a better UI
Ilintar wrote:Just an idea - maybe use MPS? It allows you to keep a declarative language, while instantly making an editor with both syntax and semantic validation available AND allows keeping the treelike structure of XML without the overhead of the bulky XML markers.
a few weeks ago i discovered that:
http://www.noesisengine.com/docs/Gui.Co ... orial.html

--------------------------------------------------------------------------
UniTrader wrote:suggestion relating to UI: why not rely on some generically written UI Scripts which can be suited for almost any Situation by Parameter and define all Menus with nested Tables in MD? at least thats my approach, and so far it works fine for me..
does that allow you to change the "appearance" of the UI ?
i thought of "HUD mods", in x3 you only could change the "interface textures", if we'd the ability to re-design for example how you do "freight exchange" (for example by a drag & drop method between 2 opened windows), that would be a fantastic

if not: we are bound to egosoft's design, remember the clicking work in X3 !?
or the "my properties" menu ? omfg

multiple active opened windows (which respond to input) isnt impossible, in fact its as easy as with 1 active window, you just need to specify another "menuID" to identify the window in the input response function, getting that ID by tracking the cursor's position ("on-mouse-over"for example) or "visual feedback"

i'm sure egosoft can easily implement that if they want to ..
To err is human. To really foul things up you need a computer.
Irren ist menschlich. Aber wenn man richtig Fehler machen will, braucht man einen Computer.


Mission Director Beispiele

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Post by euclid » Sun, 20. Aug 17, 00:30

JSDD wrote:
euclid wrote:It seems you have a good idea how this could actually work. So, by all means, open a corresponding thread over at the S&M forum and I'm sure you'll find lot of support (you got mine) for developing such an interface.
what do you mean by that ?
egosoft's job is to develop that, so that we (scripters & modders) have the ability to design a better UI
.....*snip*....
We (at leat Uni & me) are poking the Devs ever since to provide more features to do what we are aim to do but.... in the meantime we have to cope with what we have. So, if you got any idea (not only you, this is for all here) how to code an XML/UI interface the please .. brainstorm it ;-)

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

Ilintar
Posts: 122
Joined: Sat, 5. Jul 08, 23:39
x3tc

Post by Ilintar » Mon, 21. Aug 17, 18:23

euclid wrote: We (at leat Uni & me) are poking the Devs ever since to provide more features to do what we are aim to do but.... in the meantime we have to cope with what we have. So, if you got any idea (not only you, this is for all here) how to code an XML/UI interface the please .. brainstorm it ;-)

Cheers Euclid
I wrote one a few comments ago - you can use MPS, it can generate a whole schema from an XSD, it has an editor generator once you have established the schema which gives you a MD editor with smart completion / structure completely for free without the need to code anything and it's on the Apache 2.0 license so you can basically use it for any commercial product you want.

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Tue, 22. Aug 17, 13:47

An interesting topic. (Backstory, I have done a fair bit of SE in x3, but I never got into the MD nor XR modding)I had actually considered such a thing (creating a customized coding tool) back in the X3 days, but after a bit of investigating, I put it aside (for uni, and now actual programming work)

Whilst I do think that editing an xml is much slower than actual coding, creating a coding program would be very difficult.

I had considered looking into Roslyn (The thing Microsoft uses to process stuff like c#) and did take a peek at whimsy's x scripter. After learning about how the Roslyn stuff worked I realised how complex it was to creating coding tools and it quickly drained my interest in modding.

As a quick reference, pherhaps take a look at how roslyn works before you consider dedicating effort to this:
https://github.com/dotnet/roslyn/wiki/Roslyn%20Overview

nivek500
Posts: 1
Joined: Sat, 1. Dec 18, 12:24
x4

Re: X4 UI modding/scripting discussion

Post by nivek500 » Sat, 1. Dec 18, 15:38

So X4 won't have an Script editor similiar to X3: albion prelude in game?
is there any other decent way to be able to edit either way?

Post Reply

Return to “X Rebirth - Scripts and Modding”