EnglishGermanFrenchRussianItalianSpanish
Log inRegister
 
Clearing invalid scripts
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
rhine770





Joined: 24 Oct 2015
Posts: 6 on topic

Thank you for registering your game
PostPosted: Sat, 2. Sep 17, 06:54    Post subject: Clearing invalid scripts Reply with quote Print

I don't know whether to ask this in the scripting and modding section or here, so sorry, if this doesn't belong here.

I am playing a modified version of X3AP (still using 3.1) with XRM. A few weeks ago, I encountered a problem with a mod calling a certain script every time I saved and loaded the game. These scripts were piling up on my save over time before I realized this. Luckily, I found out the mod causing the problem and removed it, but I still have the script pile there (about 2000 !ship.cmd.follow.spacefly why the mod even called this script is a mystery to me.)

My question is pretty simple, how the heck do I remove these dead scripts? Is there a command or something I can do to clear them up? I know some of those called upon are valid, but the rest are just there taking up space and I imagine contributing to lag.

Back to top
View user's profile Send private message
Alan Phipps
Moderator (English)
Moderator (English)

MEDALMEDALMEDAL

Joined: 16 Apr 2004
Posts: 17031 on topic
Location: Stonehenge, UK
Thank you for registering your game
PostPosted: Sat, 2. Sep 17, 13:58    Post subject: Reply with quote Print

Moving to S&M where more scripting experts will see this.


_________________
A dog has a master; a cat has domestic staff.
Back to top
View user's profile Send private message
Joubarbe





Joined: 31 Oct 2006
Posts: 2706 on topic
Location: France
Thank you for registering your game
modified
PostPosted: Sat, 2. Sep 17, 18:22    Post subject: Reply with quote Print

It's not as easy as you think. To remove a script from the stack, you have three options:

1/ The script has an update routine, and when you change its version, it resets itself and can potentially "return null", i.e be removed from the game.

2/ You have a mean to restart your game by saving all your previous game data.

3/ If the script is attached to an object, you can delete this object from the game.

Unfortunately, the first two options do not apply to you, because I really doubt your script has an update routine, and the second option only applies to Litcube's Universe (the famous Export/Import feature).
So the only thing you can do is to either wait for the destruction of these ships, or kill them yourself... (preferably with a cheat) But 2000... Meehh that's gonna take some time!

EDIT: and as Cycrow said below, you can "interrupt" the script, but that requires some scripting knowledge.


_________________
Mayhem - Satellites Monitoring - Internal Distribution Network - ADS (Joubarbian Edition) - Bounty Board - The Joubarbian Toolkit - EasyConnect


Last edited by Joubarbe on Sat, 2. Sep 17, 19:59; edited 1 time in total
Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20473 on topic
Location: London
Thank you for registering your game
PostPosted: Sat, 2. Sep 17, 18:48    Post subject: Reply with quote Print

Scripts are usually either global, or they are run on objects.

for global scripts, you can manually kill them from the script editor.

for the others, its abit more difficult, as they could be running on any of the objects in the game.

you could write a script that gets a list of all ships/stations, then checks if that script is running on any of the tasks, and then call !lib.interrupt on that task which will stop it.

The script !ship.cmd.follow.spacefly is one of the spacefly command scripts, and is usually run on spaceflys. If you really have lots of those scripts active, it likely means you also have lots of spaceflys.

you could simply find all spaceflys and destroy them


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
rhine770





Joined: 24 Oct 2015
Posts: 6 on topic

Thank you for registering your game
PostPosted: Sat, 2. Sep 17, 23:52    Post subject: Reply with quote Print

Welp, I don't have any scripting knowledge and simply kill all those space flies? Skull If it's manually, it would be easier just to start a new game and cheat every back in. Well, maybe if they all spawn in one place... but, how easy would it be to kill them with a script like Joubarbe said?

Ah well, I can just start a new game and make liberal use of your cheat scripts Cycrow. Any scripts out there that increase combat/trade rank, by the way?[/u]

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Tue, 12. Dec 17, 23:48

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.06468 seconds, sql queries = 19