[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: Scripting / Modding Moderators, Moderators for English X Forum

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

Post by mr.bear »

jeroll3d wrote:Site dawnload message

"Your free download slot has expired.You can upgrade to a Premium account to remove this, and all other restrictions."

Oh, please!!! :evil:
Don't hurt me! I'm just a poor little bear... i'm trying to get something else sorted.

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

Preceeding messages relate to Beta II

----------- BETA II (Update 1) RELEASED -----------

Following messages relate to Beta II (Update 1)

----------------------------------------------------------------------
Monseigneur Cube wrote:Mr. Bear, is AP support something you plan on implementing? When users ask me this question, I usually crap on my desk. But I didn't notice it in your OP, but it does seem like a logical progression.

Is the difference between the versions just a text file?
yeah i am planning to add AP support, just not right away. the commands are stored in a kind of text file and adding them should be easy but finding every little piece of code thats affected will be annoying. I've added the ability to load/compile AP scripts in Beta II (Update 1) but obviously any AP commands will be loaded as 'Unrecognised Command'.
ScRaT_GER wrote:Congrats for the release!

Unfortunately it doesn't work for me.
Sorry for the minor wardrobe malfunction folks, this bug is now fixed in Beta II (Update 1)
Last edited by mr.bear on Sun, 6. May 12, 17:11, edited 1 time in total.
Rapunzel, Rapunzel, let down your bear...
User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 25130
Joined: Sun, 2. Apr 06, 16:38
x4

Post by X2-Illuminatus »

Congrats on the release. :)

However, Beta 2 crashes at startup when "loading language strings...".
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

Don't hurt me! I'm just a poor little bear... i'm trying to get something else sorted.
Check your PMs.
However, Beta 2 crashes at startup when "loading language strings...".
Same here. The error seems to be coming from the X-Studio.Logic.dll.
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear »

@ScratGet / Illuminatus -- I think I've found the problem.. I'm fixing it now.

(ScratGer - i got no PMs?)



EDIT: okay, this is the type of bug that requires several cigarettes to fix. brb.

also: I just noticed the VS justInTime debugger can launch itself from windows and find the source code automatically - awesome! (i never clicked 'debug' when an app crashes before)
Rapunzel, Rapunzel, let down your bear...
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

(ScratGer - i got no PMs?)
Oh, right. I sent it to myself. xD
Look again.
jeroll3d
Posts: 665
Joined: Thu, 26. Jun 08, 02:28
x3ap

Post by jeroll3d »

Thanks. :lol:
Entusiasta da série X3! The best game.
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear »

@jeroll3d - the hosting issues should now be fixed thanks to ScRaT_GER, who has let me host it on his server!

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

Preceeding messages relate to Beta II (Update 1)

----------- BETA II (Update 2) RELEASED -----------

Following messages relate to Beta II (Update 2)

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

I've tweaked it so it only loads game data (and also resolves external script calls) from PCKs at the moment. Extracted PCKs take precedence over those inside catalogues. I'll add code at some point to search for TXT or XML files if no PCK file is found.

EDIT: I've just noticed something that might crash the program on startup if you've already run it before. if this happens then please delete the registry key "HKEY_CURRENT_USER\Software\BearWare\X-Studio"
Rapunzel, Rapunzel, let down your bear...
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

The download link you provided doesn't work because of FTP - you have to use this one (HTTP):

http://x-studio.fbnz.de/X-Studio.Beta.2 ... y.2012.rar

I'll try out Update 2 now.
EDIT: Still the same error when loading the language strings. :(
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear »

ScRaT_GER wrote:The download link you provided doesn't work because of FTP - you have to use this one (HTTP):

http://x-studio.fbnz.de/X-Studio.Beta.2 ... y.2012.rar

I'll try out Update 2 now.
EDIT: Still the same error when loading the language strings. :(
Cheers for the info about the link, I've updated the download.

i'm a bit confused you're still experiencing that bug, i'll have to try fixing it tomorrow :(
Rapunzel, Rapunzel, let down your bear...
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

i'm a bit confused you're still experiencing that bug, i'll have to try fixing it tomorrow
Maybe you could modify the program, so that it delivers more helpful error messages (or any at all). Maybe, as a first measure, put a big try-catch block around your main (its written in C++ or C# iirc) and print any exception.
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear »

unfortunately its written in C which doesn't support exceptions. could you post your 'Console.log' please? (created in the x-studio folder) that should give me some idea of where the problem is.

there is vast amount of error checking btw, ive just missed something somewhere.. :cry:.
ive put a lot of work into the error handling - you'll see what i mean when you see the error dialog! im gutted its crashing like this :(

EDIT: ive just read that windows provides its own 'structured exeption handling' which can be used from any language - i'll give that a go.
Last edited by mr.bear on Wed, 9. May 12, 01:18, edited 1 time in total.
Rapunzel, Rapunzel, let down your bear...
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

Unfortunately it only says the following:

Code: Select all

X-Studio Editor (Beta II)
------------------------
Loading game data from folder 'C:\Spiele\X3 Terran Conflict\'...
Not very helpful...
unfortunately its written in C
oO
Wow, not that I don't like C, but it seems to be an odd choice for programmming an IDE in. Kudos to you, sir!
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear »

ScRaT_GER wrote:Unfortunately it only says the following:

Code: Select all

X-Studio Editor (Beta II)
------------------------
Loading game data from folder 'C:\Spiele\X3 Terran Conflict\'...
Not very helpful...
okay at least that tells me its still a problem loading your language files. Does the progress dialog say "loading master language file" or "loading supplementary language files" when it crashes?

ill put a lot more information in the console for the next update.
ScRaT_GER wrote:
Mr.Bear wrote:unfortunately its written in C
oO
Wow, not that I don't like C, but it seems to be an odd choice for programmming an IDE in. Kudos to you, sir!
thanks :) i wanted a challenge.
Rapunzel, Rapunzel, let down your bear...
User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 »

What files does it need from the X3 directory for this program to work? I am trying to make this work on my USB without having to copy the entire X3 directroy across.
Good work BTW it is great right now.

EDIT: If I already have one argument whenever I try to make a second one it just isn't made.

Here is an image. When ever I click the ok button for the new script argument dialog box it closes the box and nothing is added to the argument list.

EDIT 2:Another problem. Whenever I try to change the for what script I want to select, nothing happens, it just stays on the latest loaded script.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear »

jack775544 wrote:What files does it need from the X3 directory for this program to work? I am trying to make this work on my USB without having to copy the entire X3 directroy across.
Good work BTW it is great right now.

EDIT: If I already have one argument whenever I try to make a second one it just isn't made.

Here is an image. When ever I click the ok button for the new script argument dialog box it closes the box and nothing is added to the argument list.

EDIT 2:Another problem. Whenever I try to change the for what script I want to select, nothing happens, it just stays on the latest loaded script.
hey jack, thanks for the feedback, its appreciated!

EDIT 1: I have the same problem, I'll fix it now.

Code: Select all

BUG:005. New script arguments are not actually created
EDIT 2: Do you mean "if you click here, nothing happens"?

What happens if you click here instead?

Code: Select all

BUG:006. Sometimes you cannot switch between documents
Rapunzel, Rapunzel, let down your bear...
User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 »

Yes the window menu works but the tabs don't.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear »

ok. i'm fixing both of them now...

EDIT: i've fixed the switching document bug.


EDIT 2: I've fixed the argument bug, but i've found a few more - i'm fixing them now.

EDIT 3: i've fixed all the argument bugs
Last edited by mr.bear on Wed, 9. May 12, 15:21, edited 2 times in total.
Rapunzel, Rapunzel, let down your bear...
User avatar
jack775544
Posts: 1277
Joined: Tue, 13. Dec 11, 08:27
x4

Post by jack775544 »

A very weird problem is happening. Whenever I close and reopen a script all the variables change around.

So a script that is supposed to look like

Code: Select all

Script j754.create.ship
Version: 1
for Script Engine Version: 50

Description
This creates a ship at a random place in a select sector
Arguments
0: Race , Var/Race , 'The race of the new ship if random' 
1: Class , Var/Class , 'The class if the ship is random' 
2: Sector , Var/Sector , 'The sector the ship is made in' 
3: Ship , Var/Ship , 'The ship type if specific' 
4: Number , Number , 'The number of ships you want created' 
5: Owner , Var/Race , 'The owner of the ship' 
Source Text

001   if $sector OR $number OR $Owner 
002   |return null
003   end
004   
005   $ARace = array alloc: size=10
006   $ARace[0] = Argon
007   $ARace[1] = Boron
008   $ARace[2] = Teladi
009   $ARace[3] = Split
010   $ARace[4] = Paranid
011   $ARace[5] = Xenon
012   $ARace[5] = Kha'ak 7
013   $ARace[7] = Pirates
014   $ARace[8] = Yaki
015   $ARace[9] = Terran
016   
017   while $number 
018   |
019   |$number = $number - 1 
020   |$x = random value from -25000 to 25001 - 1
021   |$y = random value from -25000 to 25001 - 1
022   |$z = random value from -25000 to 25001 - 1
023   |
024   |if $Ship 
025   ||
026   ||if $Class 
027   |||return null
028   ||end
029   ||
030   ||if $Race 
031   |||$ARace.size = size of array $ARace
032   |||$ARand.Race = random value from 0 to $ARace.size - 1
033   |||$SRace = $ARace[$ARand.race]
034   ||else
035   |||$SRace = $Race 
036   ||end
037   ||
038   ||$Ship.arr = = get ship array: of race $SRace class/type=$Class
039   ||$Ship.arr.size = size of array $Ship.arr.size
040   ||$Ship.rand = random value from 0 to $Ship.arr.size - 1
041   ||$SShip = $Ship.arr[$Ship.rand]
042   ||
043   |else
044   ||$SShip = $ship 
045   |end
046   |
047   | = = create ship: type=$SShip owner=$Owner addto=$Sector x=$x y=$y z=$z
048   |
049   end
050   
051   return null
052   
053   

For some reason changes into

Code: Select all

Script j754.create.ship
Version: 1
for Script Engine Version: 50

Description
This creates a ship at a random place in a select sector
Arguments
0: Race , Var/Race , 'The race of the new ship if random' 
1: Class , Var/Class , 'The class if the ship is random' 
2: Sector , Var/Sector , 'The sector the ship is made in' 
3: Ship , Var/Ship , 'The ship type if specific' 
4: Number , Number , 'The number of ships you want created' 
5: Owner , Var/Race , 'The owner of the ship' 
Source Text

001   if $x OR $SRace OR $Ship.rand
002   return null
003   end
004   
005   $Ship.arr.size = array alloc: size=10
006   $Ship.arr.size[0] = [Argon]
007   $Ship.arr.size[1] = [Boron]
008   $Ship.arr.size[2] = [Teladi]
009   $Ship.arr.size[3] = [Split]
010   $Ship.arr.size[4] = [Paranid]
011   $Ship.arr.size[5] = [Xenon]
012   $Ship.arr.size[5] = [Kha`ak]
013   $Ship.arr.size[7] = [Pirates]
014   $Ship.arr.size[8] = [Yaki]
015   $Ship.arr.size[9] = [Terran]
016   
017   while $SRace
018   
019   $SRace = $SRace - 1
020   $Ship.arr = random value between -25000 and 25000
021   $Ship = random value between -25000 and 25000
022   $Sector = random value between -25000 and 25000
023   
024   if $SShip
025   
026   if $y
027   return null
028   end
029   
030   if $z
031   $Race = size of array $Ship.arr.size
032   $Owner = random value between 0 and $Race
033   $Number = $Ship.arr.size[$Owner]
034   else
035   $Number = $z
036   end
037   
038   $Class = get ship array: of race $Number class/type=$y
039   $ARand.Race = size of array $ARand.Race
040   $ARace.size = random value between 0 and $ARand.Race
041   $ARace = $Class[$ARace.size]
042   
043   else
044   $ARace = $SShip
045   end
046   
047   = create ship: type=$ARace owner=$Ship.rand addto=$x x=$Ship.arr y=$Ship z=$Sector
048   
049   end
050   
051   return null
052   
053   

So for some reason the position of all the variables change postions.

Also whenever I try to view the dodgy script in Internet Explorer all the source code is grey.
Normal Colour and code
Dodgy Colour and code
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
User avatar
mr.bear
Posts: 444
Joined: Sat, 11. Dec 10, 01:38
x2

Post by mr.bear »

yeah the scripts won't display properly in a web browser, I'm not planning to fix that soon I'm afraid. do you often view scripts in a web browser?

Code: Select all

BUG:001 - 'Syntax is not highlighted when viewing scripts in a web-browser'
I've seen the variable-switching bug before but i thought i'd fixed it! I'll have a look at it now.

Code: Select all

BUG:007 - Variables switch places with each other after saving and loading a script
Rapunzel, Rapunzel, let down your bear...
User avatar
ScRaT_GER
Posts: 1962
Joined: Tue, 8. Jan 08, 18:19
x3tc

Post by ScRaT_GER »

Does the progress dialog say "loading master language file" or "loading supplementary language files" when it crashes?
Neither. It just says: "Loading language strings"

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