BlackJacks bullion mission addon
Moderators: winston, another_commander
- Talisker
- Competent
- Posts: 50
- Joined: Mon Apr 23, 2012 1:47 pm
- Location: London (Corporate State, Mostly Industrial, Tech Level 12)
Re: BlackJacks bullion mission addon
Yoink!
Thank you
Thank you
What were the skies like when you were young?
Currently: piloting the Boa Clipper Photic Sneeze II around Galaxy 2, bearing gifts of dubious legality but high entertainment value.
Currently: piloting the Boa Clipper Photic Sneeze II around Galaxy 2, bearing gifts of dubious legality but high entertainment value.
- maik
- Wiki Wizard
- Posts: 2028
- Joined: Wed Mar 10, 2010 12:30 pm
- Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)
Re: BlackJacks bullion mission addon
Thanks, I put this link on its wiki page.Wildeblood wrote:Talisker wrote:licensing permitting, obviouslyhttps://www.box.com/s/1b042baf433f0bb92059this.name = "blackjacks"
this.author = "Rustybolts"
this.copyright = "Do with as you wish"
this.description = "Starts in Galaxy 2 at Telace.";
-
- Deadly
- Posts: 174
- Joined: Mon Jun 07, 2010 9:03 am
Re: BlackJacks bullion mission addon
Hi. Given recent updates, should this work with 1.76.1? In the last log I get
20:18:09.306 [script.javaScript.exception.notFunction]: ***** JavaScript exception (blackjacks 1.22): TypeError: mission.runMissionScreen is not a function
20:18:09.306 [script.javaScript.exception.notFunction]: ../AddOns/galaxy 2, Blackjack's Bullion 1.25.oxp/Scripts/blackjacks.js, line 10.
20:18:39.277 [script.javaScript.exception.notFunction]: ***** JavaScript exception (blackjacks 1.22): TypeError: mission.runMissionScreen is not a function
20:18:39.277 [script.javaScript.exception.notFunction]: ../AddOns/galaxy 2, Blackjack's Bullion 1.25.oxp/Scripts/blackjacks.js, line 10.
Rich.
20:18:09.306 [script.javaScript.exception.notFunction]: ***** JavaScript exception (blackjacks 1.22): TypeError: mission.runMissionScreen is not a function
20:18:09.306 [script.javaScript.exception.notFunction]: ../AddOns/galaxy 2, Blackjack's Bullion 1.25.oxp/Scripts/blackjacks.js, line 10.
20:18:39.277 [script.javaScript.exception.notFunction]: ***** JavaScript exception (blackjacks 1.22): TypeError: mission.runMissionScreen is not a function
20:18:39.277 [script.javaScript.exception.notFunction]: ../AddOns/galaxy 2, Blackjack's Bullion 1.25.oxp/Scripts/blackjacks.js, line 10.
Rich.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: BlackJacks bullion mission addon
I don't know anything about it; I've never played it and never poked around inside it. I did not hesitate to upload it the other night because I can vouch for my copy being unchanged from the last version RustyBolts published; I cannot, however, vouch for it actually working.richard.a.p.smith wrote:Hi. Given recent updates, should this work with 1.76.1?
Last edited by Wildeblood on Fri Jun 08, 2012 8:33 am, edited 1 time in total.
Re: BlackJacks bullion mission addon
It should be mission.runScreen, not mission.runMissionScreen. That's the source of the log errors above, just for clarity.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
-
- Deadly
- Posts: 174
- Joined: Mon Jun 07, 2010 9:03 am
Re: BlackJacks bullion mission addon
I tried 1.26 and the log now shows
08:45:34.431 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (blackjacks 1.22 (1.2.6)): Error: mission.runScreen: Invalid arguments ("pod.png") -- expected function.
08:45:34.431 [script.javaScript.exception.ooliteDefinedError]: ../AddOns/galaxy 2, Blackjack's Bullion 1.2.6.oxp/Scripts/blackjacks.js, line 10.
Rich.
08:45:34.431 [script.javaScript.exception.ooliteDefinedError]: ***** JavaScript exception (blackjacks 1.22 (1.2.6)): Error: mission.runScreen: Invalid arguments ("pod.png") -- expected function.
08:45:34.431 [script.javaScript.exception.ooliteDefinedError]: ../AddOns/galaxy 2, Blackjack's Bullion 1.2.6.oxp/Scripts/blackjacks.js, line 10.
Rich.
- Commander McLane
- ---- 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: BlackJacks bullion mission addon
Well, yes. The syntax of
This means that that OXP in its current form indeed isn't compatible to Oolite 1.76.
runScreen
is different from the syntax of the removed runMissionScreen
. They're not the same thing.This means that that OXP in its current form indeed isn't compatible to Oolite 1.76.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: BlackJacks bullion mission addon
Well, now we have started down this road, we might as well finish the job. What's the correct syntax, Commander McLane?
This is an example of what is in the script now:-
What should be there?
This is an example of what is in the script now:-
Code: Select all
if (guiScreen != "GUI_SCREEN_MISSION" && player.ship.dockedStation.isMainStation && galaxyNumber==1 && !missionVariables.bolts && system.ID==241){
mission.runMissionScreen('revengebolts_briefing','pod.png');
mission.setInstructionsKey ('bolts1');
missionVariables.bolts='STAGE1';
}
- Commander McLane
- ---- 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:
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: BlackJacks bullion mission addon
I already looked there. It's too cryptic for me to ken.Commander McLane wrote:See here.
- Commander McLane
- ---- 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: BlackJacks bullion mission addon
It's not that cryptic.
Obviously 'revengebolts_briefing' is the key in missiontext.plist, and 'pod.png' is a model which shall be shown. Thus it's:
Now we only have to keep in mind that these (and the possible background pictures, overlays, and what have you) are forming the first parameter for
And finally we put what he have translated now as the argument into
And there you are.
Code: Select all
mission.runMissionScreen('revengebolts_briefing','pod.png');
Code: Select all
messageKey:'revengebolts_briefing', model:'pod.png'
runScreen
(the second parameter would be the callback function if there were any), thus we need to combine them into one parameter with brackets:
Code: Select all
{messageKey:'revengebolts_briefing', model:'pod.png'}
runScreen
:
Code: Select all
mission.runScreen({messageKey:'revengebolts_briefing', model:'pod.png'});
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: BlackJack's Bullion mission addon
I'm flattered that you over-estimate my kenning ability.Commander McLane wrote:It's not that cryptic.
Let's try this: https://www.box.com/s/ed1c019b87b021ee54db
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: BlackJack's Bullion mission addon
Should probably work. Since 1.74 we have a better trigger for showing mission screens. I would propose the following:Wildeblood wrote:Let's try this: https://www.box.com/s/ed1c019b87b021ee54db
Code: Select all
this.name = "blackjacks"
this.author = "Rustybolts"
this.copyright = "Do with as you wish"
this.description = "Starts in Galaxy 2 at Telace.";
this.version = "1.2.6 (1.22)"
this.missionOffers = function()
{
if (player.ship.dockedStation.isMainStation && !missionVariables.bolts && system.ID==241){
mission.runScreen({messageKey:'revengebolts_briefing', background:'pod.png'});
mission.setInstructionsKey ('bolts1');
missionVariables.bolts='STAGE1';
}
if (player.ship.dockedStation.isMainStation && missionVariables.bolts == 'STAGE2'){
mission.runScreen({messageKey:'revengebolts_firearms', background:'firearms.png'});
mission.setInstructionsKey ("bolts2");
missionVariables.bolts='STAGE3';
}
if (player.ship.dockedStation.isMainStation && missionVariables.bolts == 'STAGE3' && system.ID==233){
mission.runScreen({messageKey:'revengebolts_robbery'});
player.ship.awardCargo("Firearms",1);
missionVariables.bolts='STAGE4';
mission.setInstructionsKey ('bolts3');
}
if (player.ship.dockedStation.isMainStation && missionVariables.bolts == 'STAGE4' && system.ID==127){
mission.runScreen({messageKey:'revengebolts_flee', background:'vipers.png'});
player.ship.bounty = 64;
missionVariables.bolts='STAGE5';
mission.setInstructionsKey ('bolts4');
}
if (missionVariables.bolts=='STAGE5'){
player.ship.bounty = 64;
}
if (missionVariables.bolts=='STAGE6'){
player.ship.bounty = 64;
}
if (player.ship.dockedStation.isMainStation && missionVariables.bolts == 'STAGE6' && system.ID==67){
mission.runScreen({messageKey:'revengebolts_finish', background:'end.png'});
player.credits+=9500;
missionVariables.bolts='STAGE99';
player.ship.bounty = 0;
mission.setInstructionsKey (null);
}
}
this.missionScreenOpportunity = function()
{
if(!player.ship.docked || galaxyNumber != 1) return;
this.missionOffers();
}
this.shipExitedWitchspace = function()
{
if (system.ID==99 && galaxyNumber==1 && missionVariables.bolts=='STAGE5'){
system.legacy_addSystemShips("witness", 1, 0.10);
}
if (system.ID==88 && galaxyNumber==1 && missionVariables.bolts=='STAGE1'){
system.legacy_addSystemShips("bolts", 1, 0.10);
}
}
missionScreenOpportunity
also allows to skip the test for a missionscreen. The opportunity only fires when it is correct to show them.One other thing is 'risky' in the original. The used images have names like 'end', 'firearms', 'vipers' etc. And because all images of all oxps go into one big image pool, there could be another oxp using those same names. Unique names are always better. e.g. by preceding them with 'blackjacks_'
EDIT:
and in one of the ship scripts I find:
Code: Select all
player.ship.awardCargo("Gold",20);
Code: Select all
player.ship.manifest.gold += 20;
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: BlackJack's Bullion mission addon
Done.Eric Walch wrote:Since 1.74 we have a better trigger for showing mission screens. I would propose the following:Its based on your new code were I changed the triggers. UsingCode: Select all
this.missionScreenOpportunity = function() { if(!player.ship.docked || galaxyNumber != 1) return; this.missionOffers(); }
missionScreenOpportunity
also allows to skip the test for a missionscreen. The opportunity only fires when it is correct to show them.
I saw that, too. Already done.Eric Walch wrote:One other thing is 'risky' in the original. The used images have names like 'end', 'firearms', 'vipers' etc. And because all images of all oxps go into one big image pool, there could be another oxp using those same names. Unique names are always better. e.g. by preceding them with 'blackjacks_'
Done. I fixed one of my pet peeve grammatical errors in the mission text, and changed the version numbers on the scripts to 1.2.7, and updated the wiki, so there's no confusion that-Eric Walch wrote:and in one of the ship scripts I find:That is also deprecated some time ago. Should be:Code: Select all
player.ship.awardCargo("Gold",20);
Code: Select all
player.ship.manifest.gold += 20;
this is indeed the most recent version: https://www.box.com/s/ed1c019b87b021ee54db
-
- Deadly
- Posts: 174
- Joined: Mon Jun 07, 2010 9:03 am
Re: BlackJacks bullion mission addon
Cool - someone has asked me to go somewhere and kill someone else. In Oolite, just to be clear. Thanks! Rich.