Hi,
I've come across an oddity.
A ship performs a scripted jump to a specific system via ship.exitSystem(systemID).
A seperate worldscript then uses ship.remove(true) just after the wormhole expires. The player is still in the original system. Checking the entities status at that point returns STATUS_DEAD and isValid returns false.
If the player then jumps to the target system, the same ship is there, the status reports as STATUS_IN_FLIGHT and isValid returns true again. However the ship behaves kind of like a derelict. It's moving, but no engine glows, it's throwing sparks and a single laser shot will make it disappear (not explode).
I think this should be fairly easy to reproduce via debug console.
ship.remove(true) issue - 1.76
Moderators: winston, another_commander, Getafix
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
ship.remove(true) issue - 1.76
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
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
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: ship.remove(true) issue - 1.76
Easy to check and easy to fix. Needs just a check to prevent dead ships from being added at the othersideCapt. Murphy wrote:I think this should be fairly easy to reproduce via debug console.
E.g. the line:
Code: Select all
if ([ship status] == STATUS_DEAD) continue; // skip dead ships.
Although, the command
remove()
gives a ship an negative energy of -50000. In my first test to confirm your bug, I got an anaconda venting plasma at the other side. And it blew himself up within a few seconds. UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: ship.remove(true) issue - 1.76
Thanks Eric,
The couple of times I witnessed it the ship did hang around for a while, although to be honest I either shot it or quit the game to stare at the script again within about 10 seconds so it may well have quietly died of it's own accord pretty quickly. I'm reinventing (the hopefully slightly more efficient) wheel yet again for the next release of Escort Contracts if you haven't guessed.
The couple of times I witnessed it the ship did hang around for a while, although to be honest I either shot it or quit the game to stare at the script again within about 10 seconds so it may well have quietly died of it's own accord pretty quickly. I'm reinventing (the hopefully slightly more efficient) wheel yet again for the next release of Escort Contracts if you haven't guessed.
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
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