Page 1 of 1

1.70-ified OXPs

Posted: Wed Jan 23, 2008 12:41 pm
by Kaks
I downloaded 3 OXPs that needed some TLC to make them compatible with 1.70. From the simplest to the most complex they are:

Falcon.oxp
Custompaints&Racers_v2_0b.oxp
Orb.oxp

I've been able to get them to work almost flawlessly(Orb.oxp being the almost in question):

Falcon.oxp
Just one typo: in falcon.oxp/Config/shipyard.plist replace

Code: Select all

		<integer>15</integer>
	<dict>
	<key>Falcon-S-player</key>
with

Code: Select all

		<integer>15</integer>
	</dict>
	<key>Falcon-S-player</key>
</dict> instead of <dict>!


Custompaints&Racers_v2_0b.oxp
First of all, inside the Textures folder, rename adder_racer_mod1_tex.png to adder_racer_AHmod1_tex.png

then change Config/shipdata.plist from

Code: Select all

		<key>model</key>
		<string>agr_green_redux_l.dat</string>
		<key>name</key>

to

Code: Select all

		<key>model</key>
		<string>agr_greens_redux_l.dat</string>
		<key>name</key>

greens instead of green!

finally, change the whole of Config/script.plist to read as follows [ edit:corrected my own typo! ]:

Code: Select all

{
	"tigergang" = (
		{
			conditions = ("status_string equal STATUS_EXITING_WITCHSPACE");
			do = ("set: local_d100roll [d100_number]",
				{
					conditions = ("planet_number lessthan 100");
					do = (
						{
							conditions = ("systemGovernment_number equal 0");
							do = ("subtract: local_d100roll 33");
						},
						{
							conditions = ("local_d100roll lessthan 33");
							do = ("addSystemShips: tigerboss 3 0.5");
							else =("addSystemShips: tigers 3 0.5");
						}
					);
				}
			);
		}
	);
}
I did come across the tiger gang, and died horribly within 10 seconds of meeting them... Note to self - do not visit anarchies! :D


Orb.oxp
This had quite a few typos all over the place, but - at long last - I got it working. I had to change quite a few files inside the oxp, though, so it might not be what Charlie (the author) intended it to be...

There's still a few problems with it - the AI script tries to make the players' AI sleep(good try! :D) & I can't figure out how that happens - and, personal thing, there's way too many orbs in galaxy 1 for my liking! :D

Personally, I want them to have a 'home galaxy' where they're very common, and then not so common everywhere else.

I've been thinking of 'remixing' this oxp using js scripting and release the results(I know javascript already, I thought I'd use that extra knowledge).

The thing is, Charlie - the original author - seems to be gone from the board, so I'd appreciate it if he could be contacted to confirm it's ok for me to go ahead.

PS: I couldn't find any reference to addShipsWithinRadius from javascript... is there a javascript example I can look at?

Posted: Wed Jan 23, 2008 12:47 pm
by LittleBear
If you send him a PM he'll get an e-mail, although I'm pretty sure he'll be fine with you fixing the bugs, bearing in mind most of his OXPs can't be played at all on 1.70 which is a shame. In fairness to Charlie and his typos he wrote these OXPs on 1.65. Everybody makes typos, but 1.65 just tries to muddle through if there is an error. On 1.70 if you make an error the game helps you by dumping you out of Oolite and logging the error in the stddr text with "missing , at line XXX" or whatever the problem is. When your writing an OXP on 1.70 this makes it a lot easier to spot and fix typos.

Posted: Wed Jan 23, 2008 1:00 pm
by Kaks
Yep, typos are very easy to make!
...& 1.70 error logs are a godsend! :D

All in all, I'm well impressed with Charlie's stuff! All the more amazing if you consider it's coming out of the Benulobiweed corporation! I've heard that the smell of 'weed spreads for light-years! :D

Thanks LittleBear, I'll PM Charlie!

Posted: Wed Jan 23, 2008 1:51 pm
by Commander McLane
Seems to have been successful! Charlie reported back here only seven minutes after this post!

Anyway, I had an argument with Charlie back then, because in my opinion the main problem with Orb.oxp is not the typos, but a more serious flaw. Charlie tried to govern the behaviour of Orbs by creating them as cascading escorts: Have one main ship, give it escorts with special AIs, and give those "first" escorts again their escorts with special AIs.

This never worked, because (a) in 1.65 escorts could not have special AIs, but only the native escortAI, and (b) escorts cannot have escorts. So while the Orb obviously did things in this OXP, they didn't do these things the way Charlie intended to. According to my diagnosis most of the Orb that are spawned by the engine (with one of the roles used by the system populator or as debris) are working fine, while almost all that are created by Charlie's script are just lame ducks hanging in space, because they have the wrong AI.

Now 1.70 gives a little more scripting flexibility and options, as far as escorts are concerned (and we have learned about the switchAITo: in launch_actions in between; back in Charlies days we didn't know about that). So I think at least part of this basic flaw can be fixed. Maybe you want to have a deeper look into it, Kaks? :)

Posted: Wed Jan 23, 2008 4:38 pm
by Kaks
Wow, that's what I call instant results, I hadn't PMd him yet when he reappeared on the forum! :)

I had a 'quick look' at addShipsWithinRadius, and after a couple of hours I got the answer:

"addShipsWithinRadius: OrbBase 1 wpm 0 0 16000 8000",

in old money is the same as the following in javascript:

system.legacy_addShipsWithinRadius("OrbBase", 1, "wpm",[0, 0, 16000], 8000);


Amazing how the time flies when you don't know what you're doing! :)

I've just PMd Charlie now. Good to know he's around, I really like what he does with his OXPs.

The AI stuff is a bit out of my league at the moment, but it definitely is something I want to muck around with.

Posted: Wed Jan 23, 2008 4:41 pm
by Eric Walch
Kaks wrote:
Yep, typos are very easy to make! ...& 1.70 error logs are a godsend!
I agree. But as Oolite was developed on a Macintosh, scripters on such machines probably had (and have) some advantage. Mac 1.65 was never forgiving with typos. It never activated wrong code. During testing my scripts, it often happened that I flew to a just added ship to see that it was doing nothing. It was always a typo in the AI that made that the AI was not activated. The same happened with the typo's in legacy scripts that prevented the script to run at all.

For the mac there exist plist editors. There is one on the OSX installation disk. That one checks the syntax and does not open wrong code. Not very helpful as one has to search for the bug, but at least one knows there is a syntax bug in it. Last week I downloaded plistEdit Pro. This one gives exactly the same error report as Oolite 1.70, so I think they use the same code source.

Back to charlies Orb. Half a year ago I also removed many syntax errors from his script on my machine until my plist editor told me the code was syntactic OK. I was amazed by the graphics. But it crashed Oolite within a few minutes and I never dared to install it again. I had already found so many syntax errors that I was afraid of much more structural problems.

Those crashes by an OXP are in most cases caused by referring to non-existing .dat files. The author had the .dat file in an other folder so it worked for him. I think the Orb has also bad file references. (This is not found by a pure syntax check)

Posted: Wed Jan 23, 2008 5:07 pm
by Kaks
Yes, I had to go through some horribly mangled code in the past, mainly because of internet explorer's 'forgiving' nature, so I can definitely see where you're coming from.

As far as I can tell, orb.oxp depends on navyships.oxp which in turn depends - partially - on kestrel.oxp & merlin.oxp

I haven't got either kestrel or merlin, and oolite does complain about those 2 ships missing, but so far so good: I did run out of virtual memory a few times just before entering a system, but that seems to happen pretty randomly, with or without orb.oxp

Posted: Wed Jan 23, 2008 10:03 pm
by Captain Hesperus
Kaks wrote:
Yes, I had to go through some horribly mangled code in the past, mainly because of internet explorer's 'forgiving' nature, so I can definitely see where you're coming from.

As far as I can tell, orb.oxp depends on navyships.oxp which in turn depends - partially - on kestrel.oxp & merlin.oxp

I haven't got either kestrel or merlin, and oolite does complain about those 2 ships missing, but so far so good: I did run out of virtual memory a few times just before entering a system, but that seems to happen pretty randomly, with or without orb.oxp
I believe that later versions of Falcon.oxp required the kestrel as escorts (they were pretty much the only escorts that could keep pace with the damn things).

Captain Hesperus

Posted: Thu Jan 24, 2008 6:17 pm
by Charlie
Glad to see my sloppy coding being the cause of so much discussion! :wink:
Shame this means the .oxp's aren't.

Ho, hum - lots to do, lots to catch up on...
...I'm glad to see that for those who slogged their way through liked what they did see.

Also v. happy to see kind people willing to put the time into clearing up my mess. (sorry Kaks - Tolstoy wouldn't be embarrassed by the length of the PM I just sent you)

One of my biggest faults (apart from v. sloppy coding) was developing .oxp's from within my main game install rather than in isolation.
It means a lot of my .oxp's only worked if you had similar tastes in add-ons as me.

Ah, yes - another fault: Releasing beta-code on to the forum (Orb = pre, pre alpha?) and then moving on to other stuff before fixing what I'd done.
Maybe I should work for Microsoft?

Posted: Sat Jan 26, 2008 5:52 pm
by Kaks
Indeed, Falcon wants its Kestrels. Got kestrel.oxp & I'll probably get merlin as well. With that I'll have the whole of Benuli Benubo 'weed's output on the hard drive. Something tells me that I'll have to go through each & every one of them to sort out the remaining problems with Orb.oxp.

Charlie, even as betas, your OXPs are very much appreciated! It would be a shame losing them from the ooniverse. They might be from different time/space continuums, but they definitely add a lot of extra colour to the galaxies. Me, I'm planning to get a Falcon one day. I've replied your PM with a minor Russian epic of my own, you'll be pleased to know! :)

Anyway, I'm still converting away. The latest build of Oolite is less than happy with every single OXP I fed it - mostly minor stuff, I'm happy to say: apparently there's quite A LOT of things that the engine doesn't quite understand, but would try to interpret anyway. The latest build still does that, but at least it says something now when stuff doesn't seem to quite add up.

I've just found out that asteroids.oxp (sorry Charlie) didn't actually work properly in 1.70, even though it didn't give me any errors. 3 asteroids had an old texture file name - which I couldn't find anywhere. I'm mixing up & renaming the missing textures right it now, and should be available Real Soon Now.

In the meantime I discovered a few more minor problems with custompaints&racers v20b. I've contacted Arexack_Heretic & he's quite busy in real life, but he's quite happy for me to go ahead with my 'remastered' version. I've converted his script to javascript & added quite a bit of my own scripting to that. I still need to finish testing for bugs in my code, but that should also be available - hmm - Not Quite So Soon Now.

So much to do, so little time!

'laters

Kaks

Posted: Sat Jan 26, 2008 6:52 pm
by Captain Hesperus
'Ere, Charlie. He's a good lad, this one! Going through all your stuff to make it bug-free and all, he hasn't even asked for his wages....

<_<

>_>

Let's get him contracted into B.Inc's workforce (if the GalCoppers haven't arrested/fired them all) on a lifetime slave deal contract, with all the usual company perks.

More Benulobiweed, anyone?

Captain Hesperus

Posted: Tue Jan 29, 2008 3:19 pm
by Kaks
Hey, I don't actually have to clear trumble infestations here, and the dental plan is as good as they promised. It's not that bad a deal!

I still can't figure out why employee nametags come with subcutaneous electrodes, though... :D