Page 4 of 9

Posted: Tue Jun 15, 2010 11:41 am
by Ramirez
Thanks, that seems to work OK. I've used the other approach well enough in some of my other scripts, along with liberal use of the switch statement, but in the case of TD a simple linear script would be much easier for me to handle.

Posted: Sun Jun 20, 2010 9:42 am
by tinker
In the shipdata.plist for Trident Down, line 1001 there is a error.

Code: Select all

         <key>model</key>
         <string>griff_station_bay.dat</string>
I think the dat filename should begin 'td-' to match the model in the models folder.

Code: Select all

         <key>model</key>
         <string>td-griff_station_bay.dat</string>

Posted: Tue Jun 29, 2010 6:30 pm
by Ramirez
Now that I've actually got some free time the translation work on this OXP is going pretty well. In the process I'm making some much-needed improvements, including better handling of the special weapons that are involved.

One thing I've run into is the question of using timers, as I want to improve the set-piece where you get to set off a remote-controlled bomb. I'd like to use a ship script to do a simple countdown - are there any simple examples of how the timer can be used? I've looked at the wiki and also the recent example in the scripting requests thread but I can't seem to apply the methods correctly.

Posted: Tue Jun 29, 2010 8:25 pm
by Kaks
The nova mission does use timers, you might want to look there... :)

Posted: Tue Jun 29, 2010 8:53 pm
by Thargoid
A simpler method may be to use the messageSelf: and pauseAI: commands within the entities AI to do the counting for you.

Details in the wiki of the two commands.

Posted: Mon Jul 05, 2010 7:28 pm
by Ramirez
After a fairly intensive week of OXP-ing I've translated my magnum opus so it's now free to play under 1.74. The I've reduced the number of dependent OXPs down to three and have made some small improvements here and there. I've been testing the script as I've gone along so things should work OK, but as ever, if anyone spots anything I'll fix it a.s.a.p.

Trident Down v2.0

Posted: Mon Dec 20, 2010 8:37 pm
by Mauiby de Fug
Minor thing:

Code: Select all

[files.notFound]: ----- WARNING: Could not find texture file "inews.png".
Case sensitive thing - the file is "iNews.png", and in the trident_down.js file it is referred to as both "inews.png" and "iNews.png".

I simply replaced all instances of "inews" with "iNews".

I have to say, I'm about to start this mission, and I'm looking forward to it immensely! Should be exciting!

Posted: Mon Dec 20, 2010 9:16 pm
by Mauiby de Fug
Somewhat more seriously:

Code: Select all

[script.javaScript.exception.badLeftsideOfAss]: ***** JavaScript exception (trident-down-raceedat-station.js.anon-script): SyntaxError: invalid assignment left-hand side
[script.javaScript.exception.badLeftsideOfAss]:       /home/robert/.Oolite/AddOns/Trident Down v2.0.2.oxp/Scripts/trident-down-raceedat-station.js, line 18:   if(missionVariables.trident_down == "DEFENDRACEEDAT2" || missionVariables.trident_down = "DEFENDIMPERATORDEAD")
[script.javaScript.load.failed]: ***** Error loading JavaScript script /home/robert/.Oolite/AddOns/Trident Down v2.0.2.oxp/Scripts/trident-down-raceedat-station.js -- compilation failed
While this doesn't affect me yet (I've only just started the mission, but I was in the area due to having finished Lovecats, so though I'd drop in!), it looks like it might well be a problem later on!

Also, the station seems to have some weird things in the middle of the dock, making it far harder to dock manually:
Image

I don't know if this is intentional or not...

Posted: Mon Dec 20, 2010 11:33 pm
by Ramirez
It looks like I've missed out a double equals in line 18 of the trident-down-raceedat.js script. I'll do a quick fix when I can.

I don't know if anyone's successfully played through the javascript version of this, so feel free to PM me if things aren't working as expected!

Posted: Mon Dec 20, 2010 11:48 pm
by Mauiby de Fug
Huh. Double equals. I should have spotted that!

Edited in my copy. And don't worry - I'll holler if things go horribly wrong! 'Tis an impressively large mission (looking at the size of the scripts and plists), so should keep me occupied for quite a while!

Posted: Tue Dec 21, 2010 4:46 am
by Mauiby de Fug
trident_down.js, line 1113 - incorrect message key

Code: Select all

		{if(missionVariables.trident_down == "LEISERA2A" || missionVariables.trident_down == "LEISERA1")
            {mission.runScreen({messageKey: "trident_down_leisera2", choicesKey: "trident_down_cont", background: "korshlogo.png"}, function(choice)
should be

Code: Select all

		{if(missionVariables.trident_down == "LEISERA2A" || missionVariables.trident_down == "LEISERA1")
            {mission.runScreen({messageKey: "trident_down_leisera2a", choicesKey: "trident_down_cont", background: "korshlogo.png"}, function(choice)
i.e. there was a missing "a" in "trident_down_leisera2a"

Other than that, I haven't encountered any problems so far. Although I'm a bit bemused by the "Navigation Buoy" for the Korshkov facility - it's not aligned to the docking bay. I can see the point in giving it the beacon when it's aligned, so as to aid docking and inform people where the bay is, but when it isn't, it seems a little odd, and the beacon might as well have been given to the station itself.


Edit: Another incorrectly named message key, line 166:

Code: Select all

        if(missionVariables.trident_down == "DICEBE2")
                    {mission.runScreen({messageKey: "trident_down_execupdate"});
should be

Code: Select all

        if(missionVariables.trident_down == "DICEBE2")
                    {mission.runScreen({messageKey: "trident_down_execupdate2"});
i.e. the "2" was missing in "trident_down_execupdate2"

Posted: Wed Dec 22, 2010 2:01 am
by Mauiby de Fug
A few more typos I've found in trident_down.js:

Lines 365, 398, and 432: "choiesKey" instead of "choicesKey".

Lines 171 and 1355: "issionVariables.trident_down_jumpcount" instead of "missionVariables.trident_down_jumpcount".

I've now got to the stage where I have to make a big choice. I have 4 options. This is evil torment!

Posted: Thu Dec 23, 2010 2:14 am
by Mauiby de Fug
Line 1121 in trident_down.js

Code: Select all

        if(missionVariables.trident_down == "INTERVENTION" && !missionVariables.trident_down_leisera == "SET")
should be

Code: Select all

        if(missionVariables.trident_down == "INTERVENTION" && !missionVariables.trident_down_leisera)
The == "SET" is not necessary and actually prevents it from working. It took me a while trying to work out why this rumour wouldn't work, whereas the first one did.

Similarly, line 692

Code: Select all

			if(missionVariables.trident_down == "INTERVENTION" && !missionVariables.trident_down_lequteor == "SET")
probably should be

Code: Select all

			if(missionVariables.trident_down == "INTERVENTION" && !missionVariables.trident_down_lequteor)
although I haven't yet got there...

Edit: Yep, changing them both worked.

Next typo in line 416

Code: Select all

		missionVariables.trident_down_lequtoer = null
should be "lequteor"

Edit 2:

Line 420

Code: Select all

		{mission.runScreen({messageKey: "trident_down_biantieswstorybreak1", background: "bianti"});
Should be "bianti.png"

Running a search through the file gives the same mistake on lines 1031 and 1045.

I have to say, I'm impressed with the number of threads and mission screens! Must have been very difficult to keep track of!

Posted: Thu Dec 23, 2010 5:15 pm
by Ramirez
Profuse apologies for all those errors - I've really tried to be more thorough with my more recent stuff but there's no substitute for repeated testing!

I'll be away from my Mac for a week or so, so I'll aim to address any problems you find when I get back. The particular thread you're on is actually one of the more straightforward options, the others are rather more complex. I do have the scripts with me though so I'll scan through and see if I manage to spot anything.

I found what the problem was with Raceedat station - I was doing a like_ship but had missed out some roles and subentity info and so strange things were happening. Try copying the following entry into the shipdata:

Code: Select all

 <key>raceedat-station</key>
      <dict>
         <key>like_ship</key>
         <string>coriolis-station</string>
         <key>model</key>
         <string>td-coriolis.dat</string>
         <key>roles</key>
         <string>raceedat-station station(0.0) rotating-station(0.0) coriolis(0.0)</string>
         <key>equivalent_tech_level</key>
         <integer>12</integer>
         <key>name</key>
         <string>Raceedat Station</string>
         <key>ai_type</key>
         <string>stationAI.plist</string>
         <key>rotating</key>
         <true/>
         <key>scanClass</key>
         <string>CLASS_STATION</string>
         <key>smooth</key>
         <true/>
	<key>subentities</key>
		<array>
			<string>*FLASHER* 108 -35 562 0.0 2 0 6</string>
			<string>*FLASHER* 54 -35 562 	0.0 2 0.1 3</string>
			<string>*FLASHER* 0 -35 562 	0.0 2 0.2 3</string>
			<string>*FLASHER* -54 -35 562 0.0 2 0.3 3</string>
			<string>*FLASHER* -108 -35 562 0.0 2 0.4 6</string>
			<string>*FLASHER* -108 0 562 	0.0 2 0.5 3</string>
			
			<string>*FLASHER* 108 0 562 	0.0 2 0.6 3</string>
			<string>*FLASHER* 108 35 562 	0.0 2 0.7 6</string>
			<string>*FLASHER* 54 35 562 	0.0 2 0.8 3</string>
			<string>*FLASHER* 0 35 562 	0.0 2 0.9 3</string>	
			<string>*FLASHER* -54 35 562 	0.0 2 1 3</string>	
			<string>*FLASHER* -108 35 562 0.0 2 0 6</string>
			
			<string>*FLASHER* -10 0 258 	120.0 1 0 4</string>
			<string>*FLASHER* 10 0 258 	120.0 1 0 4</string>
			<string>*FLASHER* 0 -10 258 	120.0 1 0 4</string>
			<string>*FLASHER* 0 10 258 	120.0 1 0 4</string>
			<string>*FLASHER* -5 0 258 	60.0 2 0 3</string>
			<string>*FLASHER* 5 0 258 	60.0 2 0 3</string>
			<string>*FLASHER* 0 -5 258 	60.0 2 0 3</string>
			<string>*FLASHER* 0 5 258 	60.0 2 0 3</string>

			<string>*FLASHER* 0 584 -588 	0.0 2 0 36</string>
			<string>*FLASHER* -584 0 -588 0.0 2 0.2 36</string>
			<string>*FLASHER* 0 -584 -588 0.0 2 0.4 36</string>
			<string>*FLASHER* 584 0 -588 	0.0 2 0.5 36</string>
		</array>
		<key>thrust</key>
		<real>100</real>
		<key>weapon_energy</key>
		<real>0.0</real>
		<key>weapon_offset_x</key>
		<real>0.0</real>
	<key>script</key>
	<string>trident-down-raceedat-station.js</string>
     </dict>

Posted: Thu Dec 23, 2010 9:25 pm
by Mauiby de Fug
Cool, I'll c&p it in and see what happens when I get back to Raceedat.

No need to apologise for the errors! With such an large and extensive oxp I'm surprised that there's not more of them! I'm fairly certain that I'm finding most, if not all, the problems on the path I'm taking.

I had noticed that some of the others are a little more complex, from what I've seen in the scripts. I've got an old saved game at the 4-way split off, so if I feel like it I can go back and see what I missed out on!

I have to say, debugging this is teaching me a lot about how oxps work. 'Tis far more useful to see why things don't work sometimes! So this is a rather enjoyable learning experience!