Smivs- "Steep" is an understatement.
Like you said, it's incredibly frustrating but also wonderfully rewarding when a few simple lines of code finally work. I also can't agree more with what you say about "the good folks around this board". Take Eric's post right below yours- it's excellent advice for any greenhorn coder that you won't find in any JS wiki or FAQ or tutorial.
Tricky-
Tricky wrote:Also read other OXP scripts for examples on how to handle things.
So true. After trying one thing after another after another and having none of it work, I dove into the scripts of my installed OXPs to see how you guys did it. That was when I got my "Ah Ha!" moments. The wikis are important, but they now seem to me like just a starting point. I think you really need to read other people's working code to fully understand how things are put together.
Cmdr McLane- Thanks for the revised code! When I first briefly read about missionScreenOpportunity in the wiki, I wasn't sure how to integrate it. Do I put it before my 'If' statement? Do I put it after? Is it part of the 'If' statement? I'm definitely going to add and play around with it to understand it more.
As for the second flaw in the code: I'm first thinking that it's got something to do with the parens/braces, but I counted them & they all match up. Next guess- maybe a ";" is missing somewhere? Either after the last brace or the second-to-last brace... Now to the fine print. Damn- not even close!
But you bring up an important point- it's one of the many, many reasons why it took me hours to write a three line script. Here's another one: after I got clued in that player.ship.dockedStation was what I needed, I figured that I can use PS.dockedStation (because 'PS' is the abbreviation that works in the debug console). Needless to say, that wasn't happening.
ps.dockedStation? Nope.
Ps.dockedStation? Try again.
pS.dockedStation? You are wrong, JavaScript-breath!
OK- player.ship.dockedStation it is.