Script warnings - DIY?

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

Moderators: winston, another_commander

Post Reply
User avatar
goran
---- E L I T E ----
---- E L I T E ----
Posts: 294
Joined: Sat Feb 23, 2008 12:32 am
Location: Zagreb, Croatia
Contact:

Script warnings - DIY?

Post 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... :)
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: Script warnings - DIY?

Post 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.
User avatar
goran
---- E L I T E ----
---- E L I T E ----
Posts: 294
Joined: Sat Feb 23, 2008 12:32 am
Location: Zagreb, Croatia
Contact:

Re: Script warnings - DIY?

Post 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)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Script warnings - DIY?

Post 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.
User avatar
goran
---- E L I T E ----
---- E L I T E ----
Posts: 294
Joined: Sat Feb 23, 2008 12:32 am
Location: Zagreb, Croatia
Contact:

Post 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)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
goran
---- E L I T E ----
---- E L I T E ----
Posts: 294
Joined: Sat Feb 23, 2008 12:32 am
Location: Zagreb, Croatia
Contact:

Post 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?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

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

Re: Script warnings - DIY?

Post 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
Bounty Scanner
Number 935
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post 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 .-)
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 »

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.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
goran
---- E L I T E ----
---- E L I T E ----
Posts: 294
Joined: Sat Feb 23, 2008 12:32 am
Location: Zagreb, Croatia
Contact:

Re: Script warnings - DIY?

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

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...
Bounty Scanner
Number 935
Post Reply