Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Thargoid Wars

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Thargoid Wars

Post 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){
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Thargoid Wars

Post 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.
Last edited by Eric Walch on Sat Jul 23, 2011 9:03 am, edited 2 times in total.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Thargoid Wars

Post 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.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Thargoid Wars

Post 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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Thargoid Wars

Post by Eric Walch »

Version 4.5.2 is now on-line with Capt. Murphy's fix.
Makara
Dangerous
Dangerous
Posts: 122
Joined: Sat Oct 17, 2009 6:34 pm

Re: Thargoid Wars

Post 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.
User avatar
Ironfist
Commander
Commander
Posts: 218
Joined: Tue Jun 28, 2011 2:16 pm
Location: London

Re: Thargoid Wars

Post 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
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Thargoid Wars

Post 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.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2321
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Thargoid Wars

Post 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).
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16073
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Thargoid Wars

Post 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.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Thargoid Wars

Post 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.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2321
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Thargoid Wars

Post 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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Thargoid Wars

Post 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.
Last edited by Eric Walch on Thu Jul 28, 2011 2:04 pm, edited 1 time in total.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Thargoid Wars

Post 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!
User avatar
Ironfist
Commander
Commander
Posts: 218
Joined: Tue Jun 28, 2011 2:16 pm
Location: London

Re: Thargoid Wars

Post 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.
64bit Mint 10 and Win 8 64bit on E8400 at 3.6GHz - ATI HD5750 graphics.
Concentration is the ability to think of absolutely nothing when it is absolutely necessary.
Post Reply