www.ClassicTW.com
https://www.classictw.com/

SWATH Script stop working when subspace message is sent
https://www.classictw.com/viewtopic.php?f=15&t=35700
Page 1 of 1

Author:  dulbrich [ Sun Apr 19, 2020 9:49 am ]
Post subject:  SWATH Script stop working when subspace message is sent

So I have noticed that the SWATH scripts stop working when a sub-space or comm-link message is sent. Is there a way to stop this from happening?

Sorry, noob question I know, but it has been many years since I have played and used SWATH. I thought there was a way to stop this from happening.

Author:  Deign [ Sun Apr 19, 2020 10:40 am ]
Post subject:  Re: SWATH Script stop working when subspace message is sent

dulbrich wrote:
So I have noticed that the SWATH scripts stop working when a sub-space or comm-link message is sent. Is there a way to stop this from happening?

Sorry, noob question I know, but it has been many years since I have played and used SWATH. I thought there was a way to stop this from happening.


I think you will find that any number of messages may interrupt a Swath script, including traders or aliens entering/leaving the sector and so forth. And often subspace or fedcom messages pass through without interrupting the script. It likely depends on what the script is doing and exactly what the incoming text is and when it arrives.

Most short scripts aren't vulnerable to this, and you may feel like the messages are more important than what the script is doing. But for scripts where this traffic is an unwanted problem I include commands at the start and end of the script that limit this traffic while the script runs:

int NA = Swath.NO_CHANGE;

EnterComputer.exec();
ChangePersonalSettings.exec(NA, NA, NA, NA, NA, NA, Swath.ON);
LeaveComputer.exec();
.
.
.
EnterComputer.exec();
ChangePersonalSettings.exec(NA, NA, NA, NA, NA, NA, Swath.OFF);
LeaveComputer.exec();

The last block can go in the endScript() method if you prefer. See how this works for you.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/