enterPlayerWormhole not working in interstellar space

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Re: enterPlayerWormhole not working in interstellar space

Post by Micha »

This bug has now hopefully been fixed (r4421). I tested with several ships following the player through a series of consecutive misjumps.

Along the way a few smaller wormhole-related fixes were made, the major one being that if a ship with escorts follows the player, the escorts would previously not have followed.

The biggest scripting-related change is that the AI message "WITCHSPACE OK" is now emitted for -every- ship leaving the system via a wormhole, not just for ships which create a wormhole.

I'd appreciate you giving these changes a very thorough testing (since you're working on a related script) as the code changes were non-trivial.
The glass is twice as big as it needs to be.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Re: enterPlayerWormhole not working in interstellar space

Post by TGHC »

Micha wrote:
the code changes were non-trivial.
Good work matey 8)
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Micha
Commodore
Commodore
Posts: 815
Joined: Tue Sep 02, 2008 2:01 pm
Location: London, UK
Contact:

Re: enterPlayerWormhole not working in interstellar space

Post by Micha »

Well, no, I should have written it properly to start off with.

We only want trivial changes at this stage of the game so that we don't inadvertently break more stuff than we fix.

I only mentioned it since this set of changes includes more than just a fix for this particular bug, and hence a thorough re-testing is required.
The glass is twice as big as it needs to be.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: enterPlayerWormhole not working in interstellar space

Post by Commander McLane »

Thanks, Micha! :D

I will start testing as soon as the latest nightly will include rev 4421.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: enterPlayerWormhole not working in interstellar space

Post by Commander McLane »

Have just downloaded the latest nightly (4424) and started testing.

The stranded trader correctly followed me through my wormhole and emerged only seconds after myself on the first try. However, I immediately noted one thing: when emerging the ship script shipSpawned handler doesn't trigger. Is this by design, and is there a reason for it? To me it appears more like a bug.

The handler also doesn't trigger in 1.75.
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: enterPlayerWormhole not working in interstellar space

Post by Eric Walch »

Commander McLane wrote:
However, I immediately noted one thing: when emerging the ship script shipSpawned handler doesn't trigger. Is this by design, and is there a reason for it? To me it appears more like a bug.

The handler also doesn't trigger in 1.75.
It is correct. shipSpawned triggers only for creation of a ship. Or better, not on creation, but on the first update. Almost the same, but on the first update all ships that spawned after the ship (like escorts, group members or other oxp ships) are already present.

For detection of going trough a wormhole, we still have shipExitedWormhole. For 1.74 it did fire for npc. (I used it in random hits for logging purposes) Not tested after the recent changes but I assume it should still work.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: enterPlayerWormhole not working in interstellar space

Post by Commander McLane »

Eric Walch wrote:
For detection of going trough a wormhole, we still have shipExitedWormhole.
That will do. Thanks! :D
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: enterPlayerWormhole not working in interstellar space

Post by Thargoid »

It works in 1.75.0 beta (I'm playing with it for the butterflies callback version). Not sure about current trunk.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: enterPlayerWormhole not working in interstellar space

Post by Commander McLane »

It also works in trunk.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: enterPlayerWormhole not working in interstellar space

Post by JensAyton »

Caveat: when you load a game containing saved wormholes, the ships in the wormhole will be created when the game is loaded, and will get a shipSpawned() event on the first frame after they exit the wormhole. Looking at the code, I believe this will happen after shipExitedWormhole().

For EMMSTRAN I’d like to do away with the current system of live ships being “suspended” in wormholes, and instead store them as property lists in the same way we do after loading a game with saved wormholes. It’s too late to do this for MNSR. (The inconsistency arose because of the order features were added: first ships being saved in wormholes, then JavaScript and event-based scripts, then saving of wormholes when the wormhole scanner was added.)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: enterPlayerWormhole not working in interstellar space

Post by Commander McLane »

Thank you for the information. I think the caveat doesn't apply for my special case, because the ships following the player will exit the wormhole shortly after him no matter what, leaving no possibility to save and reload in-between.

In the case of an NPC jumping out and the player following, the NPC will have left the wormhole before the player. But of course the player could not enter the NPC's wormhole in the first place, leaving the NPC in digital nirvana and maybe subsequently triggering the wrong event. I'll look into that.
Post Reply