Scripts causing crash

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

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

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

Scripts causing crash

Post by s9ilent »

Ok... one of my scripts is making X3 crash (I know its a script because if I cut and paste them out of the directory, the game works fine)

But... Even if I remove the init.scripts and leave the rest in (Where they are not being called). The game still crashes. Is there a way to tell which script is causing the crash and fix it?


What really confuses me is that all the scripts where made with the in game script editor so.... yeh I'm totally stumped
(It only started crashing after I closed the game and restarted it)
User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus »

You need to remove the setup. scripts these start on loading the game without them nothing else should run.
User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. »

Your textfile is fine?
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I found the source of the problem (It's not in an init script or called in any part of an init script. It is however a return script called by a question thats called by a script thats called by a question thats linked to an init script. However I dont think it should be causing problems because of its links)


Its my a.swl.fn.sizestation.xml

As to why this is causing the game to spontaneously crash on load is absolutely confusing me. (It didn't crash the game when I first made/tested the script)

Code: Select all

001   * For Energy-> Consumables Divide by 6 to get multiplier
002   [THIS] -> factory production task: on=[FALSE]
003   [THIS] -> add product to factory or dock: Consumables
004   [THIS] -> add primary resource to factory: Hypermatter
005   [THIS] -> factory production task: on=[TRUE]
006   $output = [THIS] -> get number of products per cycle
007   
008   [THIS] -> factory production task: on=[FALSE]
009   [THIS] -> remove product from factory or dock: Consumables
010   [THIS] -> remove primary resource from factory: Hypermatter
011   
012   
013   
014   
015   $size = $output / 6
016   return $size

There are no arguments, the desc is just a basic text only desc
And the THIS is usually a station, but as its not being called by anything, it shouldn't matter. Once again *Confused*
User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus »

Yeh also if your text files have lines like this
<t id=1></t>
without anything in there it will crash but as you never removed the text files I doubt it is this, unless you did remove them.


Is it calling on null objects?
User avatar
SymTec ltd.
Posts: 5285
Joined: Mon, 11. Apr 05, 21:11
x3tc

Post by SymTec ltd. »

Code: Select all

001   * For Energy-> Consumables Divide by 6 to get multiplier 
There is a ">". This will make the game crash. For removal, remove it from the script by opening the script in the notepad and removing this part of the comment both in the text and in the codearray.
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

Thanks SymTec, didn't think of that
*calm's down out from his ape like fury*

Note to self. Do not include special charachters in strings vars or ... well strings in general
Last edited by s9ilent on Sun, 15. Apr 07, 11:11, edited 3 times in total.
User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus »

Does ">" matter in comment lines?
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz »

YES.

Any XMLish characters (even in comment lines) can destroy the script.

You can save it like that, just never load it again.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus »

thats stupid comment lines are meant to be ignored surely
B-O'F
Posts: 724
Joined: Sat, 21. Feb 04, 02:15
x3tc

Post by B-O'F »

Hi Shovinus and all,

Yes, comment lines are meant to be ignored - but Egosoft made a slight error in their coding... hunt for a post by Gazz many moons ago, where he first found it..

The bug has been reported, but not yet fixed.

Boron - Ol Fh'art
Public Service announcement

Growing old is not a disease - it is a delayed symptom of birth trauma.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22437
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

comments are ignored by the script editor when runnign the scripts.

but they are not ignored by the xml parser when loading the scripts into memory.

it happens with the < and > characters coz they are XML special characters that indicate the start and end of a block.

so if it finds one of these characters it assumes u've started or stopped an XML tag and it confuses the parser
User avatar
Shovinus
Posts: 563
Joined: Sat, 9. Dec 06, 19:19
x3

Post by Shovinus »

Ah now I understand, that makes alot more sense

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