Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Trunk 1.74.0.3142 Mission Scripting Problem

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

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Trunk 1.74.0.3142 Mission Scripting Problem

Post by Thargoid »

I'm running into an oddity when updating the mission scripting for Lave Academy for 1.74. I'm trying to open a mission screen with 5 choices, the first three of which will lead on to further mission screens with yes/no choices (to confirm selection of the 3 exam "missions"). If no is selected then the first screen is called again.

In theory you should be able to bounce between screens, but after the second or third time the callback function seems to become undefined (according to the barf in the js console). Something looks to be going weird here and I can't see why.

Current version avec bug is here. The screen is accessed from Lave Academy station via the marketplace screen (as in the old version, it replaces it).
Last edited by Thargoid on Sat Apr 17, 2010 11:15 am, edited 1 time in total.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

I've got some free time, so I'll look into it.

Out of curiosity, did it use to work ok in previous trunk builds? I'm asking because there's been a recent-ish (rev.3137 if I'm not mistaken) change to the way callback is implemented...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

No idea - I've just started doing that one tonight.

I've got an earlier version on my HD somewhere, will give it a try.

Edit to add - just tried it on 2972 - there is works fine. So the changes to the callback you mention seem to have broken something.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Yep. I got your oxp working ok by changing the new line 153 in OOJSMission.m from

Code: Select all

	DESTROY(callbackScript);
to

Code: Select all

	//DESTROY(callbackScript);
<gobbledigook>
However, since at the moment it's a weakRef underlying object ie a hard reference, I don't think it's too wise to just leave it undestroyed.

Ahruman, shall I reinstate the code that was there before 3137 (including the whole win DEP thing, with checks to make sure another world script didn't delete the callbackScript while we're handling the mission screen) ?
Or would you rather look into it yourself?
</gobbledigook>
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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 »

I’ll look at it tomorrow.
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 »

…Or not. *yawn*
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Just run into the same problem again, this time in Eric's update of Military Fiasco (2.5b02). The script itself looks fine (the function is there and seems valid from a glance-over) - would guess it's the same issue I saw above.

Code: Select all

Warning (strict mode): reference to undefined property this.choiceEvaluation
    militaryFiasco.js, line 112:
                                        model: "mil-hydra1"}, this.choiceEvaluation);
Warning: Mission.runScreen: expected function instead of 'undefined'.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Yep.

A lot of 1.74-ready oxps are affected by exactly the same bug.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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 »

Thargoid wrote:
Just run into the same problem again, this time in Eric's update of Military Fiasco (2.5b02). The script itself looks fine (the function is there and seems valid from a glance-over) - would guess it's the same issue I saw above.
I assume it is the same bug. I completely replayed Military Fiasco with the new missionscreen before release, so things were correct on release. Before release there were some glitches in Oolites code, but they were all ironed out by Kaks at that time.
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 »

Fixed in r3289.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Ahruman wrote:
Fixed in r3289.
Excellent, and with perfect timing as I updated my trunk to 3280 only this morning...

So it'll be another swift update tomorrow methinks and some testing.
Post Reply