Page 1 of 1

Script warnings - DIY?

Posted: Wed Aug 19, 2009 9:44 am
by goran
I finally got debug.oxp to work and noticed that some warnings keep popping up in JS console.

I know that warnings about obsolete or depreciated names or methods are taken care of by the game but I choose to change scripts myself and replace names with ones suggested in warnings.

As have no knowledge of JS or oxp-ing, I wonder is that a good thing to do or there is some bad consequences that I'm not aware of?

p.s. When "Show console on warnings" is checked and game is in full screen, game break and stutter on every warning and console is not shown. Only my intuition helped me to press apple-F... :)

Re: Script warnings - DIY?

Posted: Wed Aug 19, 2009 10:34 am
by Commander McLane
gorans wrote:
As have no knowledge of JS or oxp-ing, I wander is that a good thing to do or there is some bad consequences that I'm not aware of?
The only bad consequence would be that your personal copy of all of the changed OXPs is now no longer identical to the download version. Which is not particularly bad, as long as you are aware of the fact, and don't assume that everybody else has fixed their personal copy as well.

By the way: Apart from fixing the warnings in your own console, it would also be a nice idea to alert the respective OXP authors to the problems you encounter with their OXPs. :)
p.s. When "Show console on warnings" is checked and game is in full screen, game break and stutter on every warning and console is not shown. Only my intuition helped me to press apple-F... :)
I would always assume that if you intend to use the console more extensively you would automatically use Oolite in windowed mode. Personally I have my game window on the right hand side of my monitor, and the console window to its left. So I see everything going on in the console with the blink of an eye.

Re: Script warnings - DIY?

Posted: Wed Aug 19, 2009 11:10 am
by goran
Commander McLane wrote:
By the way: Apart from fixing the warnings in your own console, it would also be a nice idea to alert the respective OXP authors to the problems you encounter with their OXPs. :)
I fixed Welcome Mat, but it's version 1.02 (as I understand, newer versions require targeting the buoy to get information) and not the latest one, so I didn't report it to Thargoid.

The other one is Bounty Scanner 1.04, it's the latest version so: FRAAAAAMEEEEEEEE :)
Commander McLane wrote:
I would always assume that if you intend to use the console more extensively you would automatically use Oolite in windowed mode. Personally I have my game window on the right hand side of my monitor, and the console window to its left. So I see everything going on in the console with the blink of an eye.
Sometimes I have to switch to full screen because my iMac g5 can manage a few FPS more then, and in 10-20 FPS range it can make a playable/non-playable difference. Those navy reserve battles can be pretty big, and I like shaders (even the simple ones....). 8)

Re: Script warnings - DIY?

Posted: Wed Aug 19, 2009 11:44 am
by Thargoid
gorans wrote:
I fixed Welcome Mat, but it's version 1.02 (as I understand, newer versions require targeting the buoy to get information) and not the latest one, so I didn't report it to Thargoid.
The current version has an optional piece of equipment. If you purchase that it works as your current older version does. If not then you have to buoy target, as you mention.

Posted: Wed Aug 19, 2009 12:35 pm
by goran
OK. There is the same warning in latest welcome.oxp:

Code: Select all

Warning: system.goingNova is deprecated, use system.sun.isGoingNova instead.
Active script: "Welcome Information Script" 0.6
There is also the following warning:

Code: Select all

Warning (strict mode): reference to undefined property this.DerelictCheckTimer
    Active script: "Fuel Collector" 0.06
    frame_fuel_collector.js, line 764:
        						log("this.DerelictCheckTimer is"+this.DerelictCheckTimer)
and another one:

Code: Select all

Warning: Invalid value type for this property. Value not set.
    Active script: "behemoth_fighter" 1.00
    behemoth-fighter.js, line 43:
            this.ship.target = this.attacker
And one exception:

Code: Select all

Exception: TypeError: attacker has no properties
    Active script: "targetAutolock" 1.0
    script.js, line 9:
    	if(missionVariables.targetAutolock == "TRUE" && player.ship.hasEquipment("EQ_SCANNER_SHOW_MISSILE_TARGET") && player.ship.target == null && !attacker.isCloaked)

Posted: Wed Aug 19, 2009 12:55 pm
by Thargoid
The Welcome Mat one is just a depreciation, not a major issue (the OXP will still work fine at the moment). I was going to cover them all when I did the work for Oolite 1.73 when it was released. But I've made an update for this early (as there isn't much in 1.73 that should affect this OXP).

Target autolock is something similar, it's a minor glitch in the scripting if the target gets lost during script processing. I'll tweak that, again it's a minor change.

I'll issue the updates tonight if I get chance.

Posted: Wed Aug 19, 2009 1:11 pm
by goran
Is there a point of posting such warnings/exceptions/errors here? I'm pretty sure that oxp authors are aware of them.

To conclude, there is no bad consequences in changing system.goingNova to system.sun.isGoingNova and other warnings like that?

Posted: Wed Aug 19, 2009 1:18 pm
by Thargoid
Where they are depreciation warnings like that, yes make the change yes. The others are slightly more involved (for example the target autolock one needs

Code: Select all

if(missionVariables.targetAutolock == "TRUE" && player.ship.hasEquipment("EQ_SCANNER_SHOW_MISSILE_TARGET") && player.ship.target == null && !attacker.isCloaked)
amended slightly to

Code: Select all

if(missionVariables.targetAutolock == "TRUE" && player.ship.hasEquipment("EQ_SCANNER_SHOW_MISSILE_TARGET") && player.ship.target == null && attacker && !attacker.isCloaked)
But certainly alerts (either by PM or here) are welcome, at least by me.

Re: Script warnings - DIY?

Posted: Wed Aug 19, 2009 4:10 pm
by Frame
gorans wrote:

The other one is Bounty Scanner 1.04, it's the latest version so: FRAAAAAMEEEEEEEE :)
oh yeah that really tells me alot... :mrgreen:

alert is done via PM not large letters ;-)

I need more information..

version of Oolite
type of error

In case you are running trunk or known as 1.73... I really cannot be start to bother about 1.73 problems as problems can arise from svn version to svn version. When there is an official release... then ok..

Regarding the fuel collector, I cannot replicate The error..
Regarding the Bounty scanner as i wrote above, i need more info..

writing I found a bug is a bit illusive...

Edit 2:

To make it clear, I'm not currently aware of any errors of either the fuel collector or the Bounty Scanner.. I get no errors running the latest SVn version or Oolite 1.72.2

Posted: Wed Aug 19, 2009 4:32 pm
by Thargoid
I've seen that fuel collector error occasionally too. It normally comes when there is an object around which your script is thinking of as a derelict, but it isn't one.

Offhand I can't be more specific on the properties of said object, I just know a few of the ones I've spawned in OXPs have flagged that error up. I'll keep an eye out for it and let you know exact circumstances.

Posted: Wed Aug 19, 2009 4:48 pm
by Svengali
gorans wrote:
Is there a point of posting such warnings/exceptions/errors here? I'm pretty sure that oxp authors are aware of them.
If you've seen something notifying the author(s) doesn't hurt. It happens pretty easy to overlook something. And a small reminder to use the verifier does not hurt too .-)

Posted: Wed Aug 19, 2009 5:15 pm
by Eric Walch
Svengali wrote:
gorans wrote:
Is there a point of posting such warnings/exceptions/errors here? I'm pretty sure that oxp authors are aware of them.
If you've seen something notifying the author(s) doesn't hurt. It happens pretty easy to overlook something. And a small reminder to use the verifier does not hurt too .-)
And in some times it can happen the errors show only in combination with something else the author is not even aware of.
Specially things happening in witchspace or q-bomb kills are often missed in testing.

Posted: Wed Aug 19, 2009 5:16 pm
by Thargoid
Welcome Mat and Target Autolock are now updated and available from my box.net account via the links below.

And thanks for the heads-up.

Re: Script warnings - DIY?

Posted: Wed Aug 19, 2009 6:52 pm
by goran
Frame wrote:
gorans wrote:

The other one is Bounty Scanner 1.04, it's the latest version so: FRAAAAAMEEEEEEEE :)
oh yeah that really tells me alot... :mrgreen:

alert is done via PM not large letters ;-)
<snip>
To make it clear, I'm not currently aware of any errors of either the fuel collector or the Bounty Scanner.. I get no errors running the latest SVn version or Oolite 1.72.2
Large letters are (again) me trying to be funny.
Anyhow, I found no real bug, just some warnings, that's why I didn't make proper bug report or something.

In BountyScanner, there is a warning for shipDisplayName, solved with displayName, like this.lasttarget.shipDisplayName -> this.lasttarget.displayName. Latest trunk build.

Posted: Thu Aug 20, 2009 3:22 pm
by Frame
Thanks :-)

fixed...

updated it, same link as before... do not care about the status line showing 1.04,

its version 1.06 now. tested with svn 2295

Looking into the fuel collector

Cheers Frame...