Page 3 of 3

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Posted: Mon Mar 13, 2017 10:04 pm
by Norby
phkb wrote: Mon Mar 13, 2017 9:36 pm
Just to be clear, the two events (escapePodSequenceOver and shipReleasedEquipment) have been in the game for a long time (at least v1.75). It's just that the Wiki pages didn't have any mention of them, so they were kind of invisible.
Ok so the last LogEvents update added about a dozen of new and two older events. Thanks phkb for fixing the wiki!

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Posted: Sat Jun 24, 2017 1:52 am
by cag
LogEvents is throwing an error: cyclic object value (don't ask me, I've never seen it before!)
This occurs when cycling the compass in a heavily populated system, eg. 4 orbs (planet,moon or sun), 4 stations, 3 buoys

Code: Select all

Exception: TypeError: cyclic object value
    Active script: logevents 1.1
    logevents.js, line 487:
    			n = JSON.stringify(target); // ** this is now line 487 **, sometimes get  TypeError: cyclic object value
To narrow it down, I modified $LogEvents_TargetName and got:

Code: Select all

in LogEvents_TargetName, caught error: TypeError: cyclic object value

target = [VisualEffect position: (-2235.38, 170098, 753921) scanClass: CLASS_VISUAL_EFFECT status: STATUS_EFFECT]

*** TypeError: cyclic object value
*** line: 487 in file: ../AddOns/Norby.LogEvents.oxp/Scripts/logevents.js
 line: 487 in function: ([object VisualEffect]) in ../AddOns/Norby.LogEvents.oxp/Scripts/logevents.js
> line: 416 in function: ("compass targeted",[object VisualEffect],"in mode COMPASS_MODE_BEACONS") in ../AddOns/Norby.LogEvents.oxp/Scripts/logevents.js
>> line: 334 in function: ([object VisualEffect],"COMPASS_MODE_BEACONS") in ../AddOns/Norby.LogEvents.oxp/Scripts/logevents.js
Here's how I modified $LogEvents_TargetName;

Code: Select all

this.$LogEvents_TargetName = function( target ) { //support for ShipVersion OXP to log ship version also
	if( !target ) return("lost target");
	var n = "";
	if( target.name ) n = target.name;
	else {
		try {
			n = JSON.stringify(target); // ** this is now line 487 **, sometimes get  TypeError: cyclic object value
		} catch( err ) {
			log(this.name, '**************************************************************************************' );
			log(this.name, 'in LogEvents_TargetName, caught error: ' + err );
			log(this.name, '    target = ' + target );
			if( err /*instanceof TypeError*/ ) this._rpt_error( err );
			log(this.name, '**************************************************************************************' );
			throw err;
		}
	}
	if( target.script && target.script.$Detectors_Origname )
		n = target.script.$Detectors_Origname;
	return( n + " " + target.entityPersonality );
Here's a dump of the offending entity:

Code: Select all

{
    beaconCode: "Thoth",
    beaconLabel: "Thoth (Moon)",
    dataKey: "planetaryCompass_moon",
    isBreakPattern: false,
    scaleX: 1,
    scaleY: 1,
    scaleZ: 1,
    scannerDisplayColor1: null,
    scannerDisplayColor2: null,
    hullHeatLevel: 0.234375,
    script: [Script "oolite-default-effect-script" version 1.84],
    scriptInfo: {},
    shaderFloat1: 0,
    shaderFloat2: 0,
    shaderInt1: 0,
    shaderInt2: 0,
    shaderVector1: (0, 0, 0),
    shaderVector2: (0, 0, 0),
    subEntities: null,
    vectorForward: (0.731917, 0.21657, 0.646061),
    vectorRight: (-0.616752, 0.613644, 0.493009),
    vectorUp: (-0.28968, -0.759302, 0.582706),
    collisionRadius: 0.00502493791282177,
    distanceTravelled: 0,
    energy: 0,
    heading: (0.731917, 0.21657, 0.646061),
    mass: 0,
    maxEnergy: 0,
    orientation: (0.259811 - 0.35231i - 0.229885j - 0.869212k),
    owner: null,
    position: (-2235.38, 170098, 753921),
    scanClass: "CLASS_VISUAL_EFFECT",
    spawnTime: 2.4590001106262207,
    status: "STATUS_EFFECT",
    isPlanet: false,
    isPlayer: false,
    isShip: false,
    isDock: false,
    isStation: false,
    isSubEntity: false,
    isSun: false,
    isValid: true,
    isInSpace: true,
    isVisible: true,
    isVisualEffect: true,
    isWormhole: false
}

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Posted: Sat Jun 24, 2017 12:15 pm
by Norby
Thank you cag for the report. LogEvents 1.2 is up with support for additional planets and moons in compass.

The "cyclic object value" happen in the core when I try to stringify a VisualEffect. It is odd but the try-catch is useful as a workaround, thank you for the idea.

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Posted: Mon Jan 29, 2018 3:32 pm
by Norby
LogEvents v1.3 uses the new events of Oolite 1.86 and got some minor fixes by cag.

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Posted: Wed Jan 31, 2018 11:22 am
by Damocles Edge
I will definitely be giving this oxp a whirl

The amount of times that I have had police ships open fire and swarm after me (even though I'm clean), well I've lost count of how many times but it's a lot.
Anything that can help shed light on what's going on sure will be appreciated.
Can't believe that I have never noticed this oxp before.

Cheers to you Norby :D

LogEvents OXP v1.4

Posted: Fri Jul 27, 2018 8:31 am
by Norby
LogEvents v1.4:
- Added a new event for Oolite 1.87.
- Removed Player word from each message to reduce log size.
- A minor fix in systemInformationChanged by cag.