A UI modding adventure

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

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

User avatar
TheRealBix
Posts: 399
Joined: Thu, 2. Jul 09, 14:34
x4

Post by TheRealBix » Wed, 30. Apr 14, 13:43

I don't even know if it's possible in scripting to call the "guilty" turret.
There's no way to recognize the mother of a projectile fired for the moment, right ?

User avatar
YorrickVander
Posts: 2672
Joined: Tue, 29. Oct 13, 22:59
x4

Post by YorrickVander » Wed, 30. Apr 14, 15:40

TheRealBix wrote:So yes, if Egosoft don't do it, someone have to do it for them.
Understood mate, I've even made a couple of simple mods myself (Shady Slater, Copilot Convo etc) due to some of the more glaring and irritating design failures. My point here is simply that scripting a solution for friendly fire isn't really feasible without the actual collision physics allowing for fleet members not being hit :(
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Ayporos
Posts: 26
Joined: Sat, 28. Dec 13, 08:42

Post by Ayporos » Wed, 30. Apr 14, 20:35

YorrickVander wrote:I'm gonna go out on a limb and suggest this friendly fire is something ES needs to address in the exe - the normal game cheat of 'fire through' friendlies at the base code level would be the sane option.
How is that a sane option?

I might come over a bit idealistic here but if you ask me it'd be quite immersion breaking to watch an epic space battle between fleets take place and friendlies just shooting straight through each other.

How about spatial tactics? positioning? flak defensive lines (that your own fighters/drones better stay far clear of if they don't wish to be torn to bits)?


@Mad_Joker, regarding the 'station fleet' thing, I believe it'd be cleaner to group those into a 'fleet'(?) called STATIONS, under which the -actual- station fleets are located.. this way if you have, say, 20+ stations, the first 20 entries in your fleet management window isn't taken up by all those stations that may or may not have ships/fleets assigned to them.

Grouping them all together in one big 'STATION' parent entry means you can either expand that to look at your station fleets or ignore this one single fleet entry and work on all of your ship fleets.

That's just how I imagine it'd be best to go about keeping the fleet window uncluttered, I just mention it to make you aware of the fact that it could get messy real quick if one has many stations/fleets.

User avatar
YorrickVander
Posts: 2672
Joined: Tue, 29. Oct 13, 22:59
x4

Post by YorrickVander » Wed, 30. Apr 14, 20:46

Maybe i phrased that badly :) Replace 'sane' then with 'likely to happen in a reasonable timeframe' perhaps? Telling your fighters to stay out of the capitals firing solution (BSG springs to mind) would be great but I imagine there would be a lot of fiddly code and probably inherent lag for in-zone fights with the extra overhead.
X Rebirth - A Sirius Cybernetics Corporation Product

Split irritate visiting pilot with strange vocal patterns.

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Wed, 30. Apr 14, 21:05

Alright, here then a screenshot of the final version of the fleet management screen for now. Tomorrow is a holiday where I live, so I hope I will be able to release UFO tomorrow.

http://static-2.nexusmods.com/15/mods/1 ... 884615.png


{Images posted directly to the forums should not be greater than 640x480 or 100kb, oversize image now linked - Terre}

User avatar
TheRealBix
Posts: 399
Joined: Thu, 2. Jul 09, 14:34
x4

Post by TheRealBix » Wed, 30. Apr 14, 21:18

Oh well played with the tree-like display !

On the other side, there will not be a lot of space for characters.. I think for other languages like French, but even for english, in the right side dor exemple (location).
Maybe you could shorten some words like "Shields" and "Hull", or remove "Location" (it seems obvious this is the location).
Bref, you should try to gain some space and I don't see anything more to say at the moment.

Great job anyway ! :D

Night Nord
Posts: 996
Joined: Fri, 13. Jan 12, 20:09
x4

Post by Night Nord » Wed, 30. Apr 14, 21:29

Hey, at least someone have put the decompiler into good work, great! =)

BTW, about the column vs. point issue - it should be fixed in the latest version. The decompiler tries to guess obj.func(obj, foo, blah) calls being obj:func(foo, blah) calls instead, but sometimes it may still fail miserably due to considering two "objs" being different.

UI framework is pretty much crappy, that's true, but that's a legacy of being a little bit too universal - EgoSoft clearly planed UI to be somewhat moddable. At least eventmonitor/main monitor handlers have a distinctive plugin system in place. But other then that everything else just looks a bit too rushed (just as a whole game, that is).

Bad news are that visuals are still out-of-reach. We can't create new controls or change their appearance - damn binary Anark files. I've found a place in code which reads then and a way to disassemble/debug it - it should be fairly possible to create a decent structure of the format, but that's a tedious process and I just don't have so much time. If anyone interested I may send instructions and information I dug up so far (via PM, obviously. I doubt EgoSoft will be happy with decompilation instructions just lying around the forum).

But I see that another problem - Inability to change a game state via UI is somehow fixed, isn't it? Because a few versions earlier it was clearly impossible to affect any arbitrary game object state (other than a very small set of explicitly exported narrow functions) or issue a MD command. Even such a simple thing as ship renaming wasn't possible until EgoSoft did it exporting a corresponding function along the way.

Anyway, if you'll encounter any problems with the decompiler - just create an issue on github and I'll do my best and try to fix it asap. Well, unless that's a while loop with complex subexpressions - that will take a while to fix.

Ayporos
Posts: 26
Joined: Sat, 28. Dec 13, 08:42

Post by Ayporos » Thu, 1. May 14, 05:53

YorrickVander wrote:Maybe i phrased that badly :) Replace 'sane' then with 'likely to happen in a reasonable timeframe' perhaps? Telling your fighters to stay out of the capitals firing solution (BSG springs to mind) would be great but I imagine there would be a lot of fiddly code and probably inherent lag for in-zone fights with the extra overhead.
It's funny you mentioned BSG because that's -exactly- what I was thinking of. :wink:

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Thu, 1. May 14, 13:17

Wow, this was a much more painful birth than I had hoped it would be, but I have finally everything implemented. Now I'm just going to write some documentation, and then I'll finally release the mod with the new UI.

Mad_Joker
Posts: 274
Joined: Sun, 14. May 06, 11:21
x3

Post by Mad_Joker » Thu, 1. May 14, 18:31

So, I have finally release the new UFO version. The mod download only contains the compiled UI files, but you can find the sources on my GitHub repository.

Ayporos
Posts: 26
Joined: Sat, 28. Dec 13, 08:42

Post by Ayporos » Fri, 2. May 14, 06:16

Mad_Joker wrote:So, I have finally release the new UFO version. The mod download only contains the compiled UI files, but you can find the sources on my GitHub repository.
Thank you very much!

User avatar
TheRealBix
Posts: 399
Joined: Thu, 2. Jul 09, 14:34
x4

Post by TheRealBix » Sat, 3. May 14, 07:39

Wrong post ^^'

MutantDwarf
Posts: 682
Joined: Tue, 20. Jun 06, 02:29
x4

Post by MutantDwarf » Mon, 5. May 14, 01:04

This is absolutely awesome, MJ. Absolutely awesome.

moon123456
Posts: 8
Joined: Tue, 15. Apr 14, 17:22

Post by moon123456 » Tue, 6. May 14, 08:05

so many thx.

keep improving !

Night Nord
Posts: 996
Joined: Fri, 13. Jan 12, 20:09
x4

Post by Night Nord » Fri, 9. May 14, 21:40

So... there are magic functions

Code: Select all

arg1, arg2 = GetMenuParameters()
ReturnFromMenu(array)
and corresponding helper functions in the Helper script. That's a lot. Guess I should've paid more attention on some basic handlers.

Too bad it works only for conversations - it's impossible to implement everything in Lua, you still have to prepare arguments and apply returns using the horrific XML language. But that's a big help anyway.

Just a short run-through on how it (Lua<->MD ex) works:
You register your lua scripts into

Code: Select all

ui/addons/detailmonitor/detailmonitor.xml
. That will load them into the game (There are more addon categories than detailmonitor - eventmonitor or gameoptions, for instance)

Then you may call

Code: Select all

<open_conversation_menu menu="YourMenuName" params='valid_xml_expression_which_could_be_an_array' />
where "YourMenuName" is a lua-script base name which establish a particular set of callback functions to be a valid menu. And params could be just anything valid for XML - it will be translated into lua transparently, AFAIR.

When your menu (which could be written with or without EgoSoft's helper) opens you may read arguments passed into using function stated above, or just let the Helper to supply them to you (as it will call your callback when it's already loaded into given parameters). And when you are done, you may set return args with the function above or use convenient Helper functions to close-and-return.

You may establish a cue waiting for the return by waiting for gMainUniverse_main "section" to become active and probably some other flag (which you set before the call and unset after receiving the return) to detect if that's yours menu closed, not just any.

All the credit for that revelation goes to MJ.

Post Reply

Return to “X Rebirth - Scripts and Modding”