this.shipEnteredPlanetaryVicinity = function(planet)

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

Moderators: winston, another_commander, Getafix

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Eric Walch wrote:
In the revision from 9 december the check is done with::
- (OOAegisStatus) checkForAegis. starting at line 3627. You see all the checkings. Quite complex and I don't really see why it is written that complex. This complexity probably leads to the bug. Specially the following part looks odd:
That code is indeed a mess, for a variety of reasons. Backwards-compatibility is one, and another is that kaks and I have modified it in ways that seem to have overlapping functionality.

I think we need to work out how to rewrite it in a way that’s cleaner, 1.65-compatible, and provides the new features necessary, but possibly dropping compatibility with intermediate test releases.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Ok, tested it, the traders do get their right messages:

Code: Select all

Oolite [ai.message.receive] -[AI reactToMessage:] (AI.m:353): AI route1traderAI.plist for Mosquito Trader 302 in state 'HEAD_FOR_PLANET' receives message 'AEGIS_CLOSE_TO_PLANET'
Oolite [ai.takeAction] -[AI takeAction:] (AI.m:411): Mosquito Trader 302 to take action setStateTo: GO_TO_STATION
  Oolite [ai.message.receive] -[AI reactToMessage:] (AI.m:353): AI route1traderAI.plist for Mosquito Trader 302 in state 'HEAD_FOR_PLANET' receives message 'EXIT'
  Oolite [ai.message.receive] -[AI reactToMessage:] (AI.m:353): AI route1traderAI.plist for Mosquito Trader 302 in state 'GO_TO_STATION' receives message 'ENTER'
  Oolite [ai.takeAction] -[AI takeAction:] (AI.m:411): Mosquito Trader 302 to take action setTargetToSystemStation
  Oolite [ai.takeAction] -[AI takeAction:] (AI.m:411): Mosquito Trader 302 to take action setDesiredRangeTo: 5000.0
  Oolite [ai.takeAction] -[AI takeAction:] (AI.m:411): Mosquito Trader 302 to take action setDestinationToTarget
  Oolite [ai.takeAction] -[AI takeAction:] (AI.m:411): Mosquito Trader 302 to take action checkCourseToDestination
Oolite [ai.message.receive] -[AI reactToMessage:] (AI.m:353): AI route1traderAI.plist for Mosquito Trader 302 in state 'GO_TO_STATION' receives message 'NOTHING_FOUND'
Oolite [ai.message.receive] -[AI reactToMessage:] (AI.m:353): AI route1traderAI.plist for Mosquito Trader 302 in state 'GO_TO_STATION' receives message 'CLOSE_TO_PLANET'
Oolite [ai.message.receive] -[AI reactToMessage:] (AI.m:353): AI route1traderAI.plist for Mosquito Trader 302 in state 'GO_TO_STATION' receives message 'AEGIS_CLOSE_TO_MAIN_PLANET'
Oolite [ai.message.receive] -[AI reactToMessage:] (AI.m:353): AI route1traderAI.plist for Mosquito Trader 302 in state 'GO_TO_STATION' receives message 'COURSE_OK'
First AEGIS_CLOSE_TO_PLANET and after that: CLOSE_TO_PLANET and AEGIS_CLOSE_TO_MAIN_PLANET.

This fits the code sniplet in my previous message. There the JS handler is suppressed when planet is not main planet, but the AI message are send. I just fail to see why it does work with more planets.
Ahruman wrote:
I think we need to work out how to rewrite it in a way that’s cleaner, 1.65-compatible, and provides the new features necessary, but possibly dropping compatibility with intermediate test releases.
I think the CLOSE_TO_PLANET and AEGIS_CLOSE_TO_MAIN_PLANET are from intermediate versions that were never documented on the wiki. And I certainly never have seen them in use. So I think they could get skipped.
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

i failed to read thargoids reply carefully...

In leesti

I went to the moon, positioned my self just above to moons surface, on the planet side of the moon as center as possible in regard to the main planet...

I then flew towards to main planet.. and Entered Planetary Vicinity triggerd....

I think this happens when two Globes overlaps eachothers Vicinity area...
the reason why it only works with system redux, is of course that it adds the moon in question...

here is the picture quite similar to Thargoids...

Image

The Debug console generates this from various scripts i have running

Code: Select all

Script Message: we exited vicinity
Script Message: we entered planet vicinity :[Planet ID: 221 position: (5956.43, 80903, 329284) type: PLANET_TYPE_GREEN radius: 7.000km]
we are to close at multiple globe system (lots of these)
Script Message: we exited vicinity
Script Message: we entered planet vicinity :[Planet ID: 141 position: (0, 0, 401050) type: PLANET_TYPE_GREEN radius: 30.850km]
we are to close at multiple globe system
Script Message: we exited vicinity
Script Message: we entered planet vicinity :[Planet ID: 221 position: (5956.43, 80903, 329284) type: PLANET_TYPE_GREEN radius: 7.000km]
we are to close at multiple globe system
Script Message: we exited vicinity
Script Message: we entered planet vicinity :[Planet ID: 141 position: (0, 0, 401050) type: PLANET_TYPE_GREEN radius: 30.850km]
> system.mainPlanet
> system.mainPlanet
[Planet ID: 141 position: (0, 0, 401050) type: PLANET_TYPE_GREEN radius: 30.850km]
As you can read i reproduced it twice...

Maybe Leesti is a one off... but i´m going to test at Quitri just to be sure...

Edit: nope i can´t trigger it in Quitri using the same method..

Thargoid tested it the one place where the mainPlanet would trigger the event, there may possibly be other places... however it lead us to what exactly was wrong inside the code...

Amazing...


EDIT 2: i reproduced the effect at Quitri... It is the overlapping vicinities that are making it possible to trigger the event...

For Quitri i went far on the oppesite side of the moon facing the planet.. then flew towards the moon but aiming so that i just would´nt crash into it... sure enough, there came the event
Bounty Scanner
Number 935
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:

Post by Commander McLane »

I can confirm that in my experience the shipEnteredPlanetaryVicinity is only triggered by the added moon, not by the planet itself.

I am running System Redux in a customized version, which adds a maximum of only 1 moon, and no planets. Therefore I only get main planets without moons or with one moon.

I am getting the Planetfall-message only in systems with a moon, and only if the moon is close enough to the corridor that I pass it within 3 times its radius.

Which seems to indicate that indeed only the moon is triggering the shipEnteredPlanetaryVicinity, not the main planet itself.
Post Reply