[RELEASE] HUD Requests OXP and LogEvents OXP

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

Moderators: winston, another_commander

Would you get an improved HUD?

Poll ended at Mon Jun 10, 2013 5:57 pm

Yes
2
40%
No
3
60%
 
Total votes: 5

User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Post 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!
cag
Deadly
Deadly
Posts: 202
Joined: Fri Mar 17, 2017 1:49 am

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Post 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
}
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Post 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.
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Post by Norby »

LogEvents v1.3 uses the new events of Oolite 1.86 and got some minor fixes by cag.
User avatar
Damocles Edge
---- E L I T E ----
---- E L I T E ----
Posts: 256
Joined: Thu Mar 30, 2017 9:57 pm

Re: [RELEASE] HUD Requests OXP and LogEvents OXP

Post 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
O.C.T.D (Oolite Crash Test Dummy) Hmm Hmm Hmm Hmm......
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

LogEvents OXP v1.4

Post 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.
Post Reply