Page 2 of 3

Re: Thargoid Wars

Posted: Sat Jul 23, 2011 5:33 am
by Capt. Murphy
Was the loop continual? I only get stuck in the circumstances described above.

Looking at the code some more I think line 174 is necessary/there for circumstances where the player has already launched when the Timer fires - it just resets the attack so that next time you dock there will be an attack. However it does cause problems if the station attack mission screen has been inadvertently shown and the player accepted the bug fight before the Timer has fired. Commenting it out could potentially reduce the number of attacks overall if you are in the habit of docking, doing stuff quick and launching again in less than 60 seconds.

I've changed a few lines in my local copy which seems to solve the continual loop I've described whilst maintaining the other behaviour of the script. It stops the station attack mission screen being shown before the delay timer has fired in the event that this.missionScreenOpportunity is fired again independently of the the delay timer.

In the section below delete this.attackTimer; is new.

Code: Select all

this.stationAttack = function (){  // Delayed missionoffer, called by a timer
    delete this.attackTimer;
    if (guiScreen === "GUI_SCREEN_MISSION" || guiScreen === "GUI_SCREEN_REPORT" || guiScreen === "GUI_SCREEN_SAVE") return; 
    if (player.ship.docked) this.missionScreenOpportunity(); // force a delayed evaluation.
    missionVariables.thargoidwars_station_attack = "POSSIBLE";
}
and line 55 is changed from

Code: Select all

if (station_attack === "ATTACKED"){
to

Code: Select all

if (station_attack === "ATTACKED" && !this.attackTimer){

Re: Thargoid Wars

Posted: Sat Jul 23, 2011 8:41 am
by Eric Walch
Capt. Murphy wrote:
In the section below delete this.attackTimer; is new.
I never noticed any loop when playing, only the occasionally intended second attack. But, that could be my playing style of rarely launching fast.

I will add a variation of your fix by making sure that the code only runs when called from the timer. I will not use a test for 'this.attackTimer' but add a new variable to test for.
And I think your way of just deleting 'this.attackTimer' will only result in deleting the reference to the timer, but the timer below it will still fire. It needs to be stopped first.

Re: Thargoid Wars

Posted: Sat Jul 23, 2011 8:50 am
by Capt. Murphy
Given that it's being deleted in the function that's called by the timer it should already have fired before deletion?

edit to add - the continual loop shows up for me because I've illegal goods tweak installed, and kept the contraband in the hold, so was getting an illegal goods mission screen followed by the repeat station attack screen every time I redocked after a station attack. I doubt there's many other OXP's that have conditions that repeat in the same way.

Re: Thargoid Wars

Posted: Sat Jul 23, 2011 9:04 am
by Eric Walch
Capt. Murphy wrote:
Given that it's being deleted in the function that's called by the timer it should already have fired before deletion?
Yes, deleting 'this.attackTimer' at the location were you did it will work correct.

Re: Thargoid Wars

Posted: Sat Jul 23, 2011 12:39 pm
by Eric Walch
Version 4.5.2 is now on-line with Capt. Murphy's fix.

Re: Thargoid Wars

Posted: Sat Jul 23, 2011 1:14 pm
by Makara
Nice work guys - this would always be an OXP in my "recommended for all" list so it is good that any quirks can be ironed out (dashes off for the new, improved version to replace my bodge). Thinking about it, I don't normally launch fast except for when there's a station attack - that alarm really gets the ol' blood pumping.
Capt. Murphy wrote:
edit to add - the continual loop shows up for me because I've illegal goods tweak installed, and kept the contraband in the hold, so was getting an illegal goods mission screen followed by the repeat station attack screen every time I redocked after a station attack. I doubt there's many other OXP's that have conditions that repeat in the same way.
Hmmm - I'm running Illegal Goods tweak too. I don't remember the loop coinciding with having naughtyness in my hold but didn't stop to take note so there could have been something in there.

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 11:56 am
by Ironfist
Guys,

Downloaded and installed version 4.5.2 last night.
Got my first station attack and a crash, only errors in the log file are these last 4 lines
12:41:51.375 [ship.missileLaunch.invalidPosition]: ***** ERROR: The missile_launch_position defines a position (0, 0, -20.5) behind the <ShipEntity 0x1eb54e98>{"Thargoid Warship" position: (-68829.5, 35264.8, 457556) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT}. In future versions such missiles may explode on launch because they have to travel through the ship.
12:41:52.125 [ship.missileLaunch.invalidPosition]: ***** ERROR: The missile_launch_position defines a position (0, 0, -20.5) behind the <ShipEntity 0x1eac1010>{"Thargoid Warship" position: (-73643.9, 35902.8, 425715) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT}. In future versions such missiles may explode on launch because they have to travel through the ship.
12:42:07.578 [ship.missileLaunch.invalidPosition]: ***** ERROR: The missile_launch_position defines a position (0, 0, -20.5) behind the <ShipEntity 0x1eac1010>{"Thargoid Warship" position: (-73858.7, 34550.8, 427712) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT}. In future versions such missiles may explode on launch because they have to travel through the ship.
12:42:10.140 [ship.missileLaunch.invalidPosition]: ***** ERROR: The missile_launch_position defines a position (0, 0, -20.5) behind the <ShipEntity 0x1eabf980>{"Thargoid Warship" position: (-64938.4, 18149.7, 461817) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT}. In future versions such missiles may explode on launch because they have to travel through the ship.

Any thoughts on where to start looking?
Thanks in advance

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 12:48 pm
by Eric Walch
Ironfist wrote:
Guys,

Downloaded and installed version 4.5.2 last night.
Got my first station attack and a crash, only errors in the log file are these last 4 lines

Code: Select all

12:41:51.375 [ship.missileLaunch.invalidPosition]: ***** ERROR: The missile_launch_position defines a position (0, 0, -20.5) behind the <ShipEntity 0x1eb54e98>{"Thargoid Warship" position: (-68829.5, 35264.8, 457556) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT}. In future versions such missiles may explode on launch because they have to travel through the ship
.....
Any thoughts on where to start looking?
Thanks in advance
At least it is not in Thargoid Wars oxp. That oxp does not contain a thargoidship at all. All the thargoids it summons come from other oxps. However it could be that the addition of certain thargoids induce a crash. Try to misjump. Than you probably also get a lot of thargoids added, and see if that also crashes. If yes, remove the thargoid containing oxps one at a time and repeat it until you found him.

The above error report are errors, but not of a crashing type. The current code is already replacing it with better positions.

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 1:01 pm
by Wildeblood
Ironfist wrote:
12:42:10.140 [ship.missileLaunch.invalidPosition]: ***** ERROR: The missile_launch_position defines a position (0, 0, -20.5) behind the <ShipEntity 0x1eabf980>{"Thargoid Warship" position: (-64938.4, 18149.7, 461817) scanClass: CLASS_THARGOID status: STATUS_IN_FLIGHT}. In future versions such missiles may explode on launch because they have to travel through the ship.

Any thoughts on where to start looking?
Not there, I don't think; that error always gets logged when there are Thargoids about. If it bothers you, go into the shipdata.plist file and correct the missile launch position of the Thargoid mothership, which should be (0, -20.5, 0) , not (0, 0, -20.5).

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 1:08 pm
by Cody
Wildeblood wrote:
that error always gets logged when there are Thargoids about
Except with Griff's Thargoids... they use the correct launch position, I think.

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 1:28 pm
by Thargoid
Second Wave used to have this issue in one of the earlier versions (the shipdata settings were from an older version of Oolite) - if you've got that OXP installed and it's an older version then please update the current one (that doesn't have this issue). Links for that via the sig below.

The current value set for the trunk Thargoid Warships are 0.0 -46.0 91.0 , but it will of course be model dependent if the OXP generating this is using a different model. But as Eric says the trunk code will (for now) correct this on-the-fly anyway.

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 1:42 pm
by Wildeblood
That's in the Neolites, I just checked. It's also got the same numbers for aft eject position, which is definitely 'wrong'. (Do they ever eject anything, anyway?) I had always assumed the tharglets were supposed to appear directly below the centre of the mothership.

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 2:03 pm
by Eric Walch
Wildeblood wrote:
I just checked. It's also got the same numbers for aft eject position, which is definitely 'wrong'. (Do they ever eject anything, anyway?)
Yes it was always wrong. For some reason the eject position of thargoids was the same as the missile launch position and nobody noticed until 1.75 (Except Griff who did it right but everybody else copied the wrong values without realising they were behind the ship).

Wildeblood wrote:
I had always assumed the tharglets were supposed to appear directly below the centre of the mothership.
Tharglets are launched as if it were missiles. In the past the code put them behind the ship and launched them at high speed forward, through the mothership. The only thing preventing them from crashing is that missiles are non-collidable during their first 0.25 seconds. Because of their high launch speed they passed the mother in the time that collision was disabled. But there were bugs in that part of the missile launch procedure that were ironed out in 1.75. At the same time the high launch velocity was reduced. Without changing the launch position to a correct one, it would result in always crashing the targlets. Now there is a check in place that corrects dangerous positions to a default position below and in front of the ship. Instead of correcting the values, you could also remove the entry. That would also lead to using the default position.

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 2:04 pm
by Thargoid
Tharglets are fires as missiles by the warship (see the shipdata.plist entry for the mother - its missiles are defined with the tharglet role and the AI spawns them by firing a missile off), so will appear at the missile launch position in shipdata.plist (which of course should be in front of the ship).

The figures don't actually matter too much except cosmetically, as long as they don't put the mothership then directly in the flightpath of the spawned tharglet.

Edit - Ninja'd!

Re: Thargoid Wars

Posted: Thu Jul 28, 2011 3:10 pm
by Ironfist
Guys,
Thanks for all the info, I will check through the other OXPs and correct the problem. I wonder what caused the crash - no messages in the debug console and those lines I posted where the only errors in the log.