[PROGRAM] X-Studio Script Editor [v1.08 : 14th Feb 14]

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear » Fri, 14. Feb 14, 18:54

Orfevs wrote: Underline isn't exactly right. The parsed X3TC commented commands end up non commented invalid commands. since x-studio defaults to X2 with no readable header.
That means all advanced array handling, string handling, menu handling, and gosub/endsub end up invalid. And in TCAN.. that's a lot.
X-Studio doesn't support commented commands - it will just convert them into text which the game editor won't let you uncomment. I'm working on improving this.

Can you send me a few of these scripts? just put a few that have these problems in a ZIP file and send them to xstudio.development@gmail.com


Orfevs wrote:
mr.bear wrote:
Orfevs wrote:

Code: Select all

IDS_XML_UNEXPECTED_TEXT: Unexpected text ' (52)
	' was detected on line 92 of '8226-L044.xml'
0x0c94: Attachment: Appending relevant XML source code:

'...v:%s</t> (52)
	<t id="18">¸</t>(53)
	<t id="19">x:%s y:%s z:%...
That is a comment...
well there are those numbers in brackets after the strings: '(52)', '(53)'
the error message says 'Unexpected text ' (52) ', it's trying to say "why is there 52 in brackets after your string?"

if you look at the compiler window when X-Studio loads, it'll say that it didn't load your language file, it'll have a red 'error' icon next to it.
Nope. First off, that's a valid comment. Doesn't matter where you place the parentheses ( ) - they are comments and not read by X3TC at all.
In order to use () in your text, you need to place a backslash in front. Special character.

Code: Select all

1 <!-- Comment -->
2 -- Plain old error --
3 <t id="18">This is \(not a comment\)</t>(This is a comment)
you've put the X-style comment outside the XML. "(This is a comment)" only works within the string, in the quote above it's after the </t>, meaning you'd have to use XML comments "<!-- text text text -->", not X-style comments.

Orfevs wrote: Second. I never got any error message stating the text files couldn't be read. Probably because page ids are all hidden in arrays. I had to look up the log. I swear.. every damned comment. I had to either remove them or place them within <t></t> brackets - where they still are ignored.
At least I did find a single quote that wasn't replaced with " - so it wasn't all bad.. but that should have been a warning, not an error preventing the load of the textfile..
when text files can't be read you'll get an error similar to this:
[ external image ]

mr.bear
Rapunzel, Rapunzel, let down your bear...

Orfevs
Posts: 183
Joined: Thu, 22. Jan 09, 23:03
x3tc

Post by Orfevs » Fri, 14. Feb 14, 19:32

mr.bear wrote: Can you send me a few of these scripts? just put a few that have these problems in a ZIP file and send them to xstudio.development@gmail.com
Easy enough, it's in my sig.

While a bit bugged, it runs in X3TC and AP along with all comments outside in the textfiles. 8226,8227 and 8228. I also use

Code: Select all

skip if not.. 
rather than
do if..
 
since EScE cannot handle the "do if". Exscriptor refuses to acknowledge the "skip if not.." if I want some real error checking.
mr.bear wrote: you've put the X-style comment outside the XML. "(This is a comment)" only works within the string, in the quote above it's after the </t>, meaning you'd have to use XML comments "<!-- text text text -->", not X-style comments.
Works just fine. T files are read correctly even with excessive amounts of (comments) outside.
mr.bear wrote: when text files can't be read you'll get an error similar to this:
[ external image ]
Actually, I trawled the message window in search of textfile specific errors, but couldn't find any. That's why I went to the log in the first place. I should perhaps mention that I had a "old8226-L044.XML" that appeared in the log. By definition, that name is invalid and won't be loaded by X3TC. It was however loaded by x-studio. Didn't need to keep that file anyway, so I deleted it.

EDIT:
Just tried this... I'm not getting debug info after #1

Code: Select all

START $null-> call script 'lib.tcan.debug' : arg.Msg='Debug Test #1' arg.Flags=1 arg.Ref=null
$plugin.Name = get script name
infinite loop detection enabled=[TRUE]
set global variable: name='orf.tcan.nameshooter.open' value=null
* ----------------------------------------------------------------------
*if $Debug
$m = sprintf: fmt= 'NameLoader Opening!' , null , null , null , null , null
START $null -> call script 'lib.tcan.debug' : arg.Msg=$m, arg.Flags=1, arg.Ref=$plugin.Name,
*end
* ----------------------------------------------------------------------
START $null -> call script 'lib.tcan.debug' : arg.Msg='Debug Test #2', arg.Flags=1, arg.Ref=$plugin.Name,
Here's the log:

Code: Select all

[ setup.plugin.tcan ]¤ 7,10:38:00 ¤ TCAN De Buhg: ***** TCAN INIT ******
[ setup.plugin.tcan ]¤ 7,10:38:00 ¤ TCAN De Buhg: TCAN Config Array Created
[ setup.plugin.tcan ]¤ 7,10:38:00 ¤ TCAN De Buhg: TCAN ARRAY ( 100, Beta, 65599, 8226, 8226, 8228, 8228, 8227, ... )
[ setup.plugin.tcan ]¤ 7,10:38:00 ¤ TCAN De Buhg: Hotkeys Array Created.
[ setup.plugin.tcan ]¤ 7,10:38:00 ¤ TCAN De Buhg: Hotkeys Array: Size=3. ARRAY ( null, null, null )
[ setup.plugin.tcan ]¤ 7,10:38:01 ¤ TCAN De Buhg: Tag Symbols Read and Added to Array. Size=26
[ setup.plugin.tcan ]¤ 7,10:38:01 ¤ TCAN De Buhg: Aspect Array Created.
[ setup.plugin.tcan ]¤ 7,10:38:01 ¤ TCAN De Buhg: ASPECT Index Structures Resized, reset and reloaded: Array=ARRAY ( ARRAY(12), ARRAY(12), ARRAY(12), ARRAY(12), ARRAY(12), ARRAY(12), ARRAY(12), ARRAY(12), ... )
[ setup.plugin.tcan ]¤ 7,10:38:01 ¤ TCAN De Buhg: NameSet Array Created
[ setup.plugin.tcan ]¤ 7,10:38:03 ¤ TCAN De Buhg: NameSet Array Read from file. Array Size=100
[ setup.plugin.tcan ]¤ 7,10:38:03 ¤ TCAN De Buhg: Top Tier Clipboard Created
[ setup.plugin.tcan ]¤ 7,10:38:03 ¤ TCAN De Buhg: Clipboard changed: Size=10. ARRAY ( null, null, null, null, null, null, null, null, ... )
[ setup.plugin.tcan ]¤ 7,10:38:03 ¤ TCAN De Buhg: Menudata Array Created.
[ lib.tcan.odata.init ]¤ 7,10:38:03 ¤ TCAN De Buhg: Playership Object Data Created. Estimated=4, Actual=4. Data initialized.
[ lib.tcan.odata.init ]¤ 7,10:38:03 ¤ TCAN De Buhg: Ship/Station odata creation/initialization done.
TCAN setup complete. plugin Ver: 100, Data Ver=null
[  ]¤ 7,10:38:12 ¤ TCAN De Buhg: Debug Test #1
After that.. Silence.


- Orf
TCAN TC/AP Artificial Life, Menudriven Automated Ship/Station Namer
Spex: i7 4790K@4Ghz 16Gb DDR3 GTX970Strix(4Gb)
X:R 454 Hours. 15 hours unmodded.

User avatar
RedEclipse
Posts: 1269
Joined: Sat, 11. Sep 04, 16:43
x4

Post by RedEclipse » Thu, 27. Feb 14, 18:52

Hey Mr. Bear,

I'm thinking about a MD tool for Rebirth in C#.
This would translate MD stuff in a easier to read/write format, then translate back the code into MD format.

I'd like to know if you allready fixed a syntax for translated MD so we could work together on similar syntax.

If my memories are fine your tool was in... err need to check this back since it's been 3 years, I did not post there. :)
If you want it when it'll work, I see no problems to give sources.

Just started today :
[ external image ]
"AaaAaaAah ! They're everywhere...", Jane Doe, Freedom Force.

User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear » Thu, 27. Feb 14, 22:30

hey RedEclipse,

have you seen what i posted on the previous page?

[ external image ] [ external image ]

It's still experimental, I wrote a compiler/decompiler and started on the GUI.

I got quite far until I found this known bug .NET framework which prevents me from nesting controls deep enough to display MD scripts (which are highly recursive).

EDIT: it leads to the window not resizing properly after adding too many 'subcues' to a cue:

[ external image ]


mr.bear
Last edited by mr.bear on Fri, 28. Feb 14, 23:03, edited 1 time in total.
Rapunzel, Rapunzel, let down your bear...

User avatar
RedEclipse
Posts: 1269
Joined: Sat, 11. Sep 04, 16:43
x4

Post by RedEclipse » Fri, 28. Feb 14, 10:27

I've seen it but did not understood at first glance.

For exemple, I'd want to translate that :

Code: Select all

              <do_if value="typeof $Target" exact="datatype.component">
                <do_if value="$Target.exists">
                  <set_value name="$Component" exact="$Target"/>
                  <signal_cue cue="GuidanceMission"/>
                </do_if>
              </do_if>
Ideally into that sort of things:

Code: Select all

              if(typeof(Target) == datatype.component)
              {
                if(Target.exists)
                {
                  Component = Target;
                  signal_cue(GuidanceMission);
                }
              }
And let the user write either in MD, either in this kind of code, using xsl from the translated md part to propose auto-completion tools in the new code to propose polymorphics methods as in Visual (in a far far away future :)).

I do not understand why you say MD is recursive (MD newbie here but technically I only see xsl part that could be called recursive, so I guess I would need some sort of // thread to solve param - I'm still in the design phase anyway).
I also did not understand your bug properly... Imho if you were .NET before, going back to C++ winapi is quite a long project but... I'm not an exert in winapis. :)

I'm not sure to run into this problem, my interface is really simple (for the moment), and will be ugly anyway.
"AaaAaaAah ! They're everywhere...", Jane Doe, Freedom Force.

User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear » Fri, 28. Feb 14, 23:03

ok, it sounds like you're taking quite a different approach than i did.

best of luck,

mr.bear
Rapunzel, Rapunzel, let down your bear...

Shush
Posts: 244
Joined: Sat, 6. Dec 03, 16:21
x4

Post by Shush » Wed, 5. Mar 14, 14:38

Hey Mr. Bear,

Firstly; thank you for an extremely professional MSCI editing environment!

Now that I have buttered you up, a bug report:

Code: Select all

Issue:      using a % sign as the last character of a string within an MSCI script causes your parser on re-loading the script to remove the % sign.
Example1:   $string = '100%' becomes $string = '100'
Example2:   $string = '100%%' becomes $string = '100%'
Cause:      reloading of the script or restarting of X-Studio
Workaround: do not re-load scripts and do not exit X-Studio
Cheers.

User avatar
RedEclipse
Posts: 1269
Joined: Sat, 11. Sep 04, 16:43
x4

Post by RedEclipse » Tue, 11. Mar 14, 16:02

mr.bear wrote:ok, it sounds like you're taking quite a different approach than i did.

best of luck,

mr.bear
Progressing... Still ugly. :p
http://www.hostingpics.net/viewer.php?id=36485667MC.jpg

Known bugs in the "Start" cue (miss a "new" before the cue, it's how I translate "instanciate = true) and non translated conditions (still thinking of a design for that, I stoped there @00:00AM yesterday).

(very very) partial scanner only for MD -> MC for the moment. MC -> MD in a month or more.

Again, my intention is not to go against your stuff, in fact I'll make the scanners/compiler public, or something like that I don't really know, once done if you like that you'll be free to use them.
"AaaAaaAah ! They're everywhere...", Jane Doe, Freedom Force.

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Tue, 11. Mar 14, 17:55

When you work on a mod located is some place, lets say: D:/games/X3/mods/BigBang1, Xstudio will open any script, if you right klick on a script call and then choose "Open Target Script", if that script is is the same folder.

BUT, if a script, like a vanilla script, is being called, this script will be in the C:/gamefolder.
Trying to open that script will lead to this error:
The external MSCI script 'script.in.some.place' is unavailable or could not be accessed
Could you add an option, to add paths, where Xstudio should also look for scripts, or is that option included, and I am not able to find it?

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 11. Mar 14, 18:59

Rather than right-click, just drag-and-drop files onto X-Studio.

User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear » Tue, 11. Mar 14, 19:09

Shush wrote:using a % sign as the last character of a string within an MSCI script causes your parser on re-loading the script to remove the % sign.
I haven't seen that before. I will look into it.
mr.bear

RedEclipse wrote:Progressing... Still ugly. :P
http://www.hostingpics.net/viewer.php?id=36485667MC.jpg
that screenshot looks promising. some syntax colouring might help make things easier to understand.
mr.bear

Nicoman35 wrote:When you work on a mod located is some place, lets say: D:/games/X3/mods/BigBang1, Xstudio will open any script, if you right klick on a script call and then choose "Open Target Script", if that script is is the same folder. BUT, if a script, like a vanilla script, is being called, this script will be in the C:/gamefolder.
Could you add an option, to add paths, where Xstudio should also look for scripts, or is that option included, and I am not able to find it?
hi nicoman,
I hadn't thought of that. it's a bit late in the day to be adding features to x-studio (i'll be releasing x-studio 2 next week) so i've added your feature to that instead. it searches the document folder first, then the game folder.
mr.bear
Last edited by mr.bear on Tue, 11. Mar 14, 21:19, edited 2 times in total.
Rapunzel, Rapunzel, let down your bear...

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Tue, 11. Mar 14, 20:01

DrBullwinkle wrote:Rather than right-click, just drag-and-drop files onto X-Studio.
I DO drag-and-drop them now, but as a lazy man, I do much apreciate things that make things even easyer than that. :D


mr.bear wrote:..it's a bit late in the day to be adding features to x-studio (i'll be releasing x-studio 2 next week) so i've added your feature to that instead. it searches the document folder first, then the game folder.
WOOT - once again - many thanks for your support, Mr. Bear!

User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear » Tue, 11. Mar 14, 21:23

here's a preview of some of the new features: code refactoring, difference viewer, language file tag editor

[ external image ] [ external image ] [ external image ]

global find & replace, named script-arguments in all script-call commands, intellisense-style commenting, and better syntax-error feedback

[ external image ] [ external image ] [ external image ] [ external image ]

i don't have a picture yet but x-studio II has in-built script version control, and some commands now support variable arguments. (eg. 'sprintf', 'create new array', and all script-calls)

also, all the 'normal' editing features work properly throughout the program: undo/redo, cut/copy/paste, code indentation, national symbol input etc.

mr.bear
Last edited by mr.bear on Tue, 11. Mar 14, 21:33, edited 1 time in total.
Rapunzel, Rapunzel, let down your bear...

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 11. Mar 14, 21:28

Diff... sweet! Looks like a lot of great stuff!

(any chance of properly indenting if/else/end statements inside of subs?)

User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear » Tue, 11. Mar 14, 21:35

I came to hate x-studio's automatic indentation because it made my code bounce around too much when I was editing it. identation is manual in x-studio 2 (like visual studio).
It automatically places the cursor for you when you start a new line, and there are 'format selection' and 'format document' editor commands.
simple answer is 'yes', subroutine code is properly indented

mr.bear
Last edited by mr.bear on Tue, 11. Mar 14, 21:38, edited 1 time in total.
Rapunzel, Rapunzel, let down your bear...

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 11. Mar 14, 21:37

Nice. :thumb_up:

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Wed, 12. Mar 14, 09:07

*slobber*

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Tue, 18. Mar 14, 02:22

Nicoman35 wrote:*slobber*
/agree

Loving the new visual studio look 'n' feel
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

User avatar
hourheroyes
Posts: 346
Joined: Mon, 9. Apr 12, 05:14
x4

Post by hourheroyes » Wed, 19. Mar 14, 03:49

Website down? Doesn't look like I can get on the site

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Wed, 19. Mar 14, 08:51

hourheroyes wrote:Website down? Doesn't look like I can get on the site
Works for me...

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”