Page 1 of 1

I want to give gems to old macs!

Posted: Mon Mar 10, 2008 11:46 pm
by Kaks
It's a bit of a long story...

Anyway, is there any way to tell which platform we're running on from within a legacy script? All I'd need is a way to tell between mac & not mac systems.

Posted: Tue Mar 11, 2008 8:19 am
by Ark
Oh man !!!!!!!I just wanted to upgrade an old oxp
I thought it would be easy. Now look the mess I create. :x

Re: I want to give gems to old macs!

Posted: Tue Mar 11, 2008 8:35 am
by JensAyton
Kaks wrote:
Anyway, is there any way to tell which platform we're running on from within a legacy script? All I'd need is a way to tell between mac & not mac systems.
There shouldn’t be, but if you try hard you might find an exploit. :-)

Posted: Tue Mar 11, 2008 9:30 am
by Kaks
Uh, try hard, 'great'! :P

Mind you, do we have a .platform property (or similar) inside the oolite global? If not, it might be worth adding in 1.71 to apply platform specific workarounds in the future.

@Ark: Yep, it's a bit like dominoes, touch one tiny little thing and, before you know it, everything starts collapsing around you. :)
Mind you, figuring out how to put it together again is what most programmers do for fun. Sick people, every one of them. :D

Posted: Tue Mar 11, 2008 4:31 pm
by JensAyton
Kaks wrote:
Mind you, do we have a .platform property (or similar) inside the oolite global? If not, it might be worth adding in 1.71 to apply platform specific workarounds in the future.
I considered this for a while, but decided against it. If someone does that, and we then fix the platform difference (all platform differences that affect OXPs can be considered bugs), The workaround is likely to stop working. So then we need to carefully maintain and document all the differences that have been discovered, and everyone has to keep taking them into account… urgh. That way lies, well, Microsoft.

Posted: Tue Mar 11, 2008 10:13 pm
by Kaks
Ahruman wrote:
That way lies, well, Microsoft.
:shock:

I've been using windoze way too long, m$'s started corrupting my very soul...

Posted: Wed Mar 12, 2008 5:53 pm
by davcefai
NOT a perfect solution but you could try:

Option 1. Load a graphic which is extremely likely to be present in an OS of interest. Assuming that you can see an error then you can try Windows, Mac and Linux in turn. I admit that this is hit and miss. For Linux you could look in the icons folder. For windows look for the splash screen. (No idea about Macs)

Option 2. This should be more rigorous but involves more work: Write an installer script which will ask the user which platform this is - or detect it from the installer. Then set a variable in the save file.

Option 3: The nightmare scenario. Release 3 versions of the OXP. :twisted: