Deprecated JS commands

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Deprecated JS commands

Post by Ark »

Does anybody knows the oxp that generates those lines in the stderr in oolite 1.71

Code: Select all


2008-04-29 19:55:18.468 oolite.exe[3260] [script.javaScript.warning.206]: ----- JavaScript warning: Mission.missionScreenTextKey is deprecated and read-only.
2008-04-29 19:55:18.468 oolite.exe[3260] [script.javaScript.warning.206]: ----- JavaScript warning: Mission.imageFileName is deprecated and read-only.
2008-04-29 19:55:18.468 oolite.exe[3260] [script.javaScript.warning.206]: ----- JavaScript warning: Mission.musicFileName is deprecated and read-only.
2008-04-29 19:55:18.468 oolite.exe[3260] [script.javaScript.warning.206]: ----- JavaScript warning: Mission.choicesKey is deprecated and read-only.
2008-04-29 19:55:18.468 oolite.exe[3260] [script.javaScript.warning.206]: ----- JavaScript warning: Mission.instructionsKey is deprecated and read-only.
I was under the impression that it was from random hits ver 1.1(the only oxp that I am aware of not being compatible with 1.71) but apparently I was mistaken since i have just installed ver 1.2 and those lines are still there
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

I got them too, and what I also get is the mission music on the F7 screen when in flight!!

Don`t know if the two are related, but if they were, I think the F7 thing is from localhero which, I have to say, never worked as it should on my system.

:?:

L
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Lestradae wrote:
I got them too, and what I also get is the mission music on the F7 screen when in flight!!

Don`t know if the two are related, but if they were, I think the F7 thing is from localhero which, I have to say, never worked as it should on my system.
Yes, for sure you've got music INFLIGHT when pressing F7. You have the Hyperradio installed :wink: ! And the warnings are not from Localhero 1.05.

BTW: @Lestradae. What kind of problem is it with Localhero? Maybe you could specify your problem (->Localhero-Thread).

I know that the timer doesn't start again if you get killed. But this seems to be a Oolite problem. this.timer.start(); doesn't do anything since v1.71.
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 »

Svengali wrote:
this.timer.start(); doesn't do anything since v1.71.
Did it occur to you to report this?
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Ahruman wrote:
Svengali wrote:
this.timer.start(); doesn't do anything since v1.71.
Did it occur to you to report this?
Yes, but before I wanted to find a solution :-)
No, you are right. I should have reported it - and not trying to frickle around on my own.

EDIT: I was not totally sure, that I didn't made a mistake in my script.
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 »

Hmm, start() works. However, creating a stopped timer by passing a negative delay does not work as documented (fixed for 1.72 and 1.71.2).

One bug report too many is better than one too few, even though I’d be happy to see less of them. :-)
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 »

The error code Ark is quoting are from the JS version of "Asteroid storm". I just don't know why. I can't find none of the wrong commands inside the OXP to correct, but when I remove the OXP, the errors stop.

EDIT: And also transports.oxp is generating these warnings while I am not able to find the commands itself in the code.


On the" this.timer.start()", I don't think it stop working. In one oxp I stop it on docking and start it again on launching. I have seen no problems. I had just one occasion were I thought it didn't work. But now I am not sure anymore what it was.
Last edited by Eric Walch on Thu May 01, 2008 10:56 am, edited 1 time in total.
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 »

For reference, here is my test script for timers:

Code: Select all

/*  ahruman-timer-test.js
    JavaScript test.oxp
    
    A script which exercises the Timer class.
*/
this.name           = "ahruman-timer-test";
this.author         = "Jens Ayton";
this.copyright      = "This work is hereby placed in the public domain.";
this.description    = "A test of Timer functionality in Oolite.";
this.version        = "1.1";


this.doSomething = function doSomething()
{
    log("jsTimerTest.timerA", "timerA fired.");
}


this.doSomethingElse = function doSomethingElse()
{
    log("jsTimerTest.timerB", "timerB fired.");
}


// Called after all OXPs are launched, before the game has begun.
this.startUp = function()
{
    // Call this.doSomething() after one second 
    this.timerA = new Timer(this, this.doSomething, 7);
    
    // Call this.doSomethingElse() every five seconds, even if the game resets. 
    this.timerB = new Timer(this, this.doSomethingElse, 1, 5);
    this.timerB.isPersistent = true;
    
    // Create a stopped timer, to test start()
    this.timerD = new Timer(this, function () { log("jsTimerTest.timerD", "timerD fired."); }, -1, 3);
    
    // Increment this.counter every 3 seconds, starting half a minute from now 
    this.counter = 0;
    this.timerC = new Timer(this, function ()
                                    {
                                        this.counter++;
                                        log("jsTimerTest.timerC", "timerC fired; counter = " + this.counter);
                                        if (this.counter == 10)
                                        {
                                            log("jsTimerTest.timerC", "Killing timerC.");
                                            this.timerC.stop();
                                            delete this.timerC;
                                            this.timerD.start();
                                        }
                                    }, 30, 3);
    
    log("jsTimerTest.setUp", "Set up some timers, such as " + this.timerA + ".");
}
and here’s the output after a minute and a half:

Code: Select all

[jsTimerTest.setUp]: Set up some timers, such as [Timer nextTime: 7, one-shot, running, not persistent, function: "doSomething"].
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerA]: timerA fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerC]: timerC fired; counter = 1
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerC]: timerC fired; counter = 2
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerC]: timerC fired; counter = 3
[jsTimerTest.timerC]: timerC fired; counter = 4
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerC]: timerC fired; counter = 5
[jsTimerTest.timerC]: timerC fired; counter = 6
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerC]: timerC fired; counter = 7
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerC]: timerC fired; counter = 8
[jsTimerTest.timerC]: timerC fired; counter = 9
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerC]: timerC fired; counter = 10
[jsTimerTest.timerC]: Killing timerC.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerD]: timerD fired.
[jsTimerTest.timerB]: timerB fired.
[jsTimerTest.timerD]: timerD fired.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

@Ahruman: To end your sleepless nights - it was my mistake. I have excluded a necessary check somewhere else in the script. The timer is working.
Post Reply