[BETA] Custom Gui V0.8 - Update: 23/08/2007

The place to discuss scripting and game modifications for X³: Reunion.

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

ChemODun
Posts: 320
Joined: Mon, 12. Feb 07, 21:58
x3tc

Post by ChemODun » Tue, 14. Aug 07, 08:55

Cycrow wrote:
ChemODun wrote:Dont' start, when X3 folder has spaces in path, like D:\Program Files\X3. When I copy game to root - then all works fine.
will have to look into that, althou not sure y it doesn't work, especialyl as it only used the relative path and not the absolute path.

i do plan to make a better launcher at some point thou.
It say "can't find D:\Program".
Multiply entropy by absolute zero

Ñâîáîäà ñðåäè çâåçä / Freedom in space

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Tue, 14. Aug 07, 12:04

ok, i've updated the lanucher. Should work with spaces in the filename.

if its still not working, you can run it with --debug.

X3_Gui --debug

ChemODun
Posts: 320
Joined: Mon, 12. Feb 07, 21:58
x3tc

Post by ChemODun » Tue, 14. Aug 07, 12:34

Cycrow wrote:ok, i've updated the lanucher. Should work with spaces in the filename.

if its still not working, you can run it with --debug.

X3_Gui --debug
Thanks, all works fine ;-)
Multiply entropy by absolute zero

Ñâîáîäà ñðåäè çâåçä / Freedom in space

Ayreus
Posts: 82
Joined: Fri, 27. Jul 07, 00:10
x3

Post by Ayreus » Thu, 16. Aug 07, 05:20

had an interesting idea, and since you've already got the basic functionality it probably wouldn't be hard at all to stick an mp3 player in there. the only sticking point might be in setting up a file browser (though I guess you could just cop-out with a config file :wink:), since i'm guessing you'd have to make one from scratch--i honestly don't remember if you can use MFC (or whatever you'd want to use) from a DirectX dll or if it provides its own, but i never really got that deep into coding for client-side apps. i'm assuming (haven't tried it yet) that you don't have to define any visual objects...it'd be simple enough to make a transparent (alpha=0) dummy object if needed though.

anyway, soundtrack to the game's great, but even the best gets repetitive, so it would be nice to have the option of switching off the in-game soundtrack and using the gui to pipe in our own tunes.

more importantly, modders could also set up AL scripts in X3 to send in the player's current sector whenever they enter a new sector, effectively allowing them to create their own soundtracks, which would do wonders for some of the proposed Star Trek and Star Wars mods I've seen floating around in the forums (i'm assuming that this can't already be done through the usual modding routes, which I honestly haven't had time to look into yet).

just a thought :D

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 16. Aug 07, 09:13

well it can already play mp3's.

so it wouldn't be too hard to make it into a jukebox, perhaps creating it as an inbuilt system with its own gui.

adding in mfc would be possible but not terrible easy. It would prolly be better to build a file system from something else

Ayreus
Posts: 82
Joined: Fri, 27. Jul 07, 00:10
x3

Post by Ayreus » Thu, 16. Aug 07, 23:10

hmm...i really need to bone up on client-side coding anyway, so i could look into figuring out how to implement the file system after i've finished the encyclopedia project.

i had a few other ideas that would be nice, and would save a lot of work for scripters. this may be similar to a few of the ideas you've already had for making the gui more menu-friendly. i've thrown together the gui script that demonstrates a syntax this could use:

Code: Select all

//Variables in
Variable: TitleText, OptionCount, MenuOptions[$OptionCount$], TemplateFile

//Loads in template to be modified and retrieves template object references
Template: $TemplateFile$, $GUI.TemplObjRefs$
there are two major ideas here. the first concerns reading groups of the input array elements into a gui script array. the method used above is the old-school but easiest way to handle it, passing OptionCount as an argument before the MenuOptions array. i haven't seen any examples of being able to use arrays in the gui scripts like this.

the second major idea is gui template files, which would contain object prototypes that already contain attribute definitions which could be modified. the GUI.TemplObjRefs in this example would be a built-in global that is explicitly passed (for readability more than necessity; you could just have the parser do it behind the scenes) to Template. you could also allow scripters to specify which attributes can and can't be modified in template scripts:

Code: Select all

// Border prototype object, used to create the border around the gui
[this]->Border { 
	// Display texture for the border, split into 9 sections
	[this]->Texture: "Overlay/border.stx"; 

	// fade in the border, number in ms
	FadeIn: 600;
	
	// Include this to make all child object fade with the border
	FadeAllObjects;
}
objects and attributes that can modified in this example are prefixed with "[this]->". gui implementation scripts would then set about modifying the prototypes and possibly adding their own objects.

it might make sense to make sure that scripters always provide attributes for prototype objects in the template scripts to ensure that no "empty" objects make it through the implementation scripts. anyway, the template idea would make it much easier to rig up menu systems, since several different templates could be used by a single implementation script as long as they defined the same prototype objects. of course, if you wanted to implement switch statements for gui scripts, then scripters wouldn't be restricted by that either.
Last edited by Ayreus on Thu, 16. Aug 07, 23:25, edited 1 time in total.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 16. Aug 07, 23:22

im not sure the need for [this]

as each block is a single object, and each entry in the object is an attribute for that object.

for templates, do u mean something to allow you to change the varibles at any time during the gui, or do u mean something else ?

if so, im already adding something else, the use of global and local varibles that you can setup and changed throughout the course of the gui

Ayreus
Posts: 82
Joined: Fri, 27. Jul 07, 00:10
x3

Post by Ayreus » Thu, 16. Aug 07, 23:29

i was thinking more along the lines of using templates to define the basic layout that could be reused by several different gui scripts, as well as allowing gui scripts to use several different templates based on input from the X3 scripts.

anyway, "[this]->" probably isn't the best syntax for tagging modifiable objects/attributes.
Last edited by Ayreus on Thu, 16. Aug 07, 23:35, edited 1 time in total.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Thu, 16. Aug 07, 23:33

but how would these templates be used ?

the varibles can already be used to customize certain parts.

ie, you can use a varible to set the size of the gui, So each script can change the size of what the gui would be.

also, another way would be to use scripts to create the gui file. IE, using the log commands, you could create the whole gui script via X3 scripting, then you can create a template script to do that

Ayreus
Posts: 82
Joined: Fri, 27. Jul 07, 00:10
x3

Post by Ayreus » Thu, 16. Aug 07, 23:41

i see what you're getting at...i'd overlooked the fact you already had the log files to use. what i was thinking would be a way to keep templating purely within the gui scripts. now that you mention it, it was also a way to make gui scripts more dynamic without having to use local/global variables, so if you're putting those in anyway then i guess you wouldn't strictly need to use templates...are you planning to implement flow control then?

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Fri, 17. Aug 07, 00:20

not sure about flow control yet, that would add am uch higher level to the parser, so it'll be abit of work.

i might eventually implentment something like that

Ayreus
Posts: 82
Joined: Fri, 27. Jul 07, 00:10
x3

Post by Ayreus » Fri, 17. Aug 07, 00:34

you know, since the whole point of the custom gui is to build custom gui's, not executables, you probably wouldn't need anything fancier then a switch-type statement. never had to write a parser on the level yours operates (one of the nice things about coding network architecture components; just throw in a ready-made SOAP parser and be done with it :D), so i probably haven't the foggiest what that'd really take

flow control's probably not strictly necessary at this point anyway, even if it would be nice

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Fri, 17. Aug 07, 00:40

well i might look at implementing Lua into it, allowing you to code in Lua to create guis.

but that will be way after version 1.

just trying to fix a crash that has suddenly popped up when you alt+tab

Ayreus
Posts: 82
Joined: Fri, 27. Jul 07, 00:10
x3

Post by Ayreus » Fri, 17. Aug 07, 01:25

don't know the first thing about graphics programming and little about Windows programming, but it kinda sounds similar to a Session Layer conflict when concurrent network clients clash over session rights (resources in your case?)

bounty_hunter66
Posts: 550
Joined: Tue, 15. Aug 06, 13:36
x4

Post by bounty_hunter66 » Fri, 17. Aug 07, 02:55

i installed directx from cycrows link but still gives me that dam error! :cry: help?

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Fri, 17. Aug 07, 21:07

what error are you getting ?

Ayreus, im not sure the problem, especially as i've reverted back to the old code that didn't have it. But it still seems to be present. So im attempting to fix it

Ayreus
Posts: 82
Joined: Fri, 27. Jul 07, 00:10
x3

Post by Ayreus » Fri, 17. Aug 07, 21:53

wish i could help, mate. even though it's bad form, i don't suppose you could just intercept the alt+tab signal, at least until you get this figured out? i've been assuming that the crash happens when Windows tries to pop up the alt+tab screen, so if it never got the signal...well, it'd be nice if it were really that simple, i'm sure

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Fri, 17. Aug 07, 22:32

unfottuatlly, theres no easy way to detect an alt+tab.

because its not a full windows programm and just a dll, it doesn't know about the window that X3 uses, which means it cant detect what happens to it.

the problem has only just came up, it was working fine before, so im atempting to remove it peice by peice until i find the problem, the rebuilding it hopfully fixing it.

it originally cropped up when i added video files which i thought was causing the problem, until i relised it happens all the time

Deleted User

Post by Deleted User » Sun, 19. Aug 07, 00:41

Was playing with complete ship-render in your GUI window,
an interesting amount of control over X3-render is apparent.
I don't know if this could be useful for modding diagnostics -
X3 rendered in wire-frame:
[ external image ]
more:
http://www.Exogenesis.co.uk/wire1.jpg
http://www.Exogenesis.co.uk/wire2.jpg
http://www.Exogenesis.co.uk/wire3.jpg

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Sun, 19. Aug 07, 01:29

interesting, it looks like it switched to wireframe rendering, it can be done via DirectX, but not sure what would cause the Overlay to set the mode.

it is possible with it, but it shouldn't be able to

Post Reply

Return to “X³: Reunion - Scripts and Modding”