[S] [AL] [07.06.07] [X3 1.0.10] Race Invasions

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

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

User avatar
StarTrekMarc
Posts: 2143
Joined: Sat, 3. Apr 04, 16:38
x4

Post by StarTrekMarc »

Updated to v9.1

I think I found the problem of the endless loop.
Please try the new version :)

Thanks to Teemu Laurila for sending me the debuglog.

Greets
Marc
User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl »

Glad I could help, but I have bad news, I'm afraid :(

I've reached the four hour mark in my savegame after updating the script, and still no invasions. Maybe they are even more rare than that, but it doesn't seem so in my new test game, where the invasions work (and worked with 8.8 and 9.0 too).

So it got me thinking that maybe my savegame is still running the old versions of the scripts on infinite loop?

If so, how should I be able to update the running scripts? Possibilities that come to mind:

- Manually delete the ...attacker.good and ...attacker.bad scripts in the global scripts
- Use the re-initialize script chaches button
- Remove the script files and run the game for a while before re-installing

Or maybe a combination of the above?

Or maybe I just didn't wait long enough.

:? :?
User avatar
StarTrekMarc
Posts: 2143
Joined: Sat, 3. Apr 04, 16:38
x4

Post by StarTrekMarc »

There is no 4 hour mark ;) It was only for testing.

Yes, to clear the old version:
- Remove the script.
- Start the game, run the save.
- Save the game after some seconds and quit the game.
- Install the script.
- Start the game, run the save.
- Enjoy!

Greets
Hunter
User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl »

Unfortunately I just can't make this work. I ran the game for 15 (game) hours, after implementing the re-install routine, and still no invasions.

I checked the running global scripts, and still found both the ...good and ...bad scripts running. They had the same ID numbers as before the re-install, and those scripts continue running even when the script files are uninstalled. Thus it seems like the protocol you described isn't enough to re-initialize :?

I also tried to manually delete the two scripts when the script files were uninstalled. After starting the game after re-installing the script files, no invasions happen then either.

So what should I do to make the new script running? Manually run some setup-script after manually removing the running old scripts?

Many thanks for your help so far Marc, but I still have to ask for more, in hope of finally getting your script to run. I'd hate to give up after all this effort.

Maybe azrael573, too, could tell us what happened with his game?
azrael573
Posts: 138
Joined: Fri, 27. Jan 06, 05:47
x4

Post by azrael573 »

I wanna say the problem is the part where you decline the first time. I decline the first time and never saw any other offers to me. And I was playing over a month period of time. It seems like if we decline to do an invasion then they never show up again. Of course, this was with the older version 8, and not the new version 9, but I have been playing on 9 and its not giving me offers still, probably in part of my 1st declining. I thought its normal not to have many offers since having too many can be very tedious. But after playing for over a month, it seems to be too sparse for invasion missions. Maybe I should start a very new game and wait for the missions to come again, see if that would be the problem.


Azrael573
User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl »

Azrael: Starting a new game helps; at least it did for me. But I have played my current save for half a year or so, and wouldn't want to restart now that I start having a decend capship fleet.

I red the scripting manual for a bit, and the problem with a running savegame and scripts on infinite loops seems to be quite clear. Since the game saves a copy of every running script in a cache that gets stored with a savegame, there is no way to update running scripts. This makes sense. But then, unless you can terminate a script using another script (?), the only way to stop an infinite looper is to manually delete the script. This part is not a problem.

But I can't figure out how to start this script from the beginning after removing the infinite loopers. I tried running the control scripts with "init" and "reinit" settings, to no avail, it seems. As well as the obvious reload to run the registration script. This is all guesswork, so I'm hoping Marc could help ...
azrael573
Posts: 138
Joined: Fri, 27. Jan 06, 05:47
x4

Post by azrael573 »

Well, I'm completely clueless on the scripting aspects of this game, but I do agree, I would love to use this script on my current save game and not having to restart my entire game again. I don't play as much but I don't like the idea of starting over either.

Azrael573
User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl »

After learning to script a bit, I understood what's the problem with the infinite loop, and how to go around it. Invasions are finally working in my save, and I'm happily fighting the Xenon in Depths of Silence now 8) :)

The problem is that the state of the invasions script is stored in four global variables, which are naturally saved with the game. After the script is stuck in an infinite loop, these variables keep telling that the script is running, and now new invasions happen, because the script is told old ones are running. Fortunately it is a simple script to remove these global variables.

So in order to start the invasions script anew in your savegame do the following:

1. remove invasions script files

2. start the game and load your save

3. activate the script editor (if not active already)

4. remove running global scripts that refer to the invasion script (there should be two of these)

5. run a script that sets the following four global variables to null:
-al.control.invasion.stm.bad
-al.control.invasion.stm.good
-invasion.stm.running.bad
-invasion.stm.running.good

6. save your game and exit

7. install the invasions script files

8. start the game and wait for the invasions

This is the way I got it working.

I'll be happy to answer any guestions, if you want elaboration on this process. If you want the global variable nullifying script, PM me your email. I don't have a web space to put it on right now.

If you absolutely must not activate the script editor, there is a way the nulifying should be doable by abusing the AL-plugin system. Then the two infinite looping processes will be left in the backround, but they should be harmless since they don't do anything (except consume some CPU time).

Thanks for Marc for a great script. I'm having a blast with the Xenon right now. :)
azrael573
Posts: 138
Joined: Fri, 27. Jan 06, 05:47
x4

Post by azrael573 »

Send me the program or file for the fix, I'll make it available to the public on my personal webspace. (wyee@cox.net)

Azrael573
azrael573
Posts: 138
Joined: Fri, 27. Jan 06, 05:47
x4

Post by azrael573 »

Alright, I haven't tried it out yet, but I'll put it on my personal webspace. Here is the link for anyone who needs it. If there are any newer versions or other fixes for this particular script. Let me know, so I can update it.

http://members.cox.net/wyee/X3/clear.invasions.ttl.zip

Azrael573
Dante Leonhart
Posts: 123
Joined: Sun, 30. Jul 06, 04:42
x3tc

Post by Dante Leonhart »

Wait, I'm a little lost.

What exactly is the problem again and what does that link do, precisely? Something to do with loops and globals and only getting one call for help?
User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl »

Version 8.8 and 9.0 (maybe earlier too) could go into an infinite loop, resulting in no invasions happening. This is because the script thought an invasion was already going on, and it uses a check to prevent itself from running many parallel invasions. The fix nullifies the global variable that is used in this check. Thus after running that script, the AL script thinks no invasions are running, and will initiate new ones. After it initiates new ones, it will put the check variable back to normal. It is then up to you to kill the scripts that run in infinite loop.

So if you are stuck in a situation where you don't have any invasions, but have had two (global) invasions scripts running for a long time (several game days), you can use this procedure to reset the invasions script. Version 9.1 should fix going into the infinite loop. However, you need to do this if you want out of the loop, once your savegame gets there.

You can also abuse it to start a s**tload of invasions by repeatedly running it, while Race Invasions AL plugin is on. However, there might be a "progress" counter that will make invasions harder in time. This will also be reset.

One final thing. This is not supported by Marc, so it is possible something will go haywire with the Invasions script if you do this. But it seems to work just fine for me.
ORIOLE
Posts: 324
Joined: Wed, 20. Oct 04, 10:34
x2

Post by ORIOLE »

Is this script save to use now, without the loop issue :?:
Version 8.8 and 9.0 (maybe earlier too) could go into an infinite loop, resulting in no invasions happening.
Also, does it spawn many new ships, so many that it can affect the game's performance :?:
User avatar
ttl
Posts: 537
Joined: Sun, 6. Feb 05, 13:04
x3tc

Post by ttl »

As far as I know it's safe, and that's what Marc said too, i.e. version 9.1 fixed the problem. Works great for me.

I don't know how large the invasions can become, but there is only one or two at a time, so probably no performance issues, at least not OOS. But if you have a large invasion in a rocky system, you might be in for a twitchy ride IS.
Last edited by ttl on Tue, 22. Aug 06, 17:20, edited 1 time in total.
ORIOLE
Posts: 324
Joined: Wed, 20. Oct 04, 10:34
x2

Post by ORIOLE »

But does it affect performance, dropping your FPS because it spawn many new ships for each mission/attack?
azrael573
Posts: 138
Joined: Fri, 27. Jan 06, 05:47
x4

Post by azrael573 »

I doubt it, only because this script spawns a set of ships. Nothing like where xenon migration would spawn. The max I've had in invasions was like around 10. 10 isn't enough to drop FPS unless youre using race response fleet script, and that would pull more into the invaded sector.

Azrael573
ORIOLE
Posts: 324
Joined: Wed, 20. Oct 04, 10:34
x2

Post by ORIOLE »

Thx for the reply :) I will start a new game without it (will miss it tho :cry: ) and see if the performance improves.
Jakesnake5
Posts: 2880
Joined: Fri, 17. Feb 06, 04:55
x4

Post by Jakesnake5 »

We need a 2.0 version that'll use the M3+'s. :D
Perfection is in the hands of God, we bags of dirt can only do the best we can©
[ external image ]
Modders are a source of ideas to help the Game Makers improve what they have made. Cherrish them, for they are the fruit of thy labors.©
User avatar
DeadlyDa
Posts: 1883
Joined: Mon, 5. Jan 04, 04:46
x4

Post by DeadlyDa »

With STM's permission, I have a version available that uses the DDRS ships.

...'course, it doesn't do much good for those playing a straight X3 game :roll:
User avatar
StarTrekMarc
Posts: 2143
Joined: Sat, 3. Apr 04, 16:38
x4

Post by StarTrekMarc »

I have updated the script again.

FYI: http://forum3.egosoft.com/viewtopic.php?t=105114

Greets
Marc

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