Oni Central Forum

A forum for the Oni community

You are not logged in.

#26 01/08/08 09:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

Since I can't open it on this PC, I assume that's your installer, not mine, right?  It's frustrating not to be able to read .scpts in Windows.

Well, perhaps it's not necessary now, but this is my installer, with a couple precautions to try to fix your problem (although I wish I could say I was confident it would work).  It also calls the Terminal up on the screen to allow you to see the progress reports from geyser's scripts.  I *was* going to implement my own progress indicator, but the code was getting quite complicated and I wanted to keep it simple.  There's not enough time at this point to be bugtesting all the code I was going to have to write to read from the Terminal output and determine what progress was being made.  Remember, mine goes in the edition folder, not the Oni folder.

If your attachment works but doesn't show progress, then perhaps it can just be modified to incorporate my latest code that opens Terminal and we'll be all set.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#27 01/08/08 10:01

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Mac programming

"If your attachment works but doesn't show progress, then perhaps it can just be modified to incorporate my latest code that opens Terminal and we'll be all set."
And then just when you think you're set, I'll change the arborescence of the installation scripts just to annoy you. Then again, you should be able to adapt easily.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#28 01/08/08 11:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

"Arborescence"?  Now there's a word I had to look up.  (idly wonders if geyser uses Babelfish sometimes when posting in English)

But yeah, adapting to a change in file locations won't be a big deal.  Honestly, I'm not sure the Installer as it is makes things a whole lot easier.  Most anyone can plug a line of code like "bash ./big_deal.sh" into the Terminal themselves.  If we could also incorporate EdT's tool that allows you to recompile individual levels, and maybe an Uninstall feature, it would definitely justify its existence.  Do you have a certain date in mind for releasing what you've got so far, geyser?  End of January?


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#29 01/08/08 11:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

Iritscen:  Your latest script works fine for me. My next suggestions is to make the installer work outside of the Edition folder.  So when updates are made to Edition, the user doesn't have to place the installer back into the new folder.

Most anyone can plug a line of code like "bash ./big_deal.sh" into the Terminal themselves.

Programmers, yes, just regular Mac users, no. I don't think most users would even use the Terminal or know the UNIX commands to change directories and so on.  That's why I wanted to make access to Edition as simple as possible.

Offline

#30 01/08/08 11:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

My thought on the location of the Installer, honestly, was the hope that geyser would, if it reached an acceptable level of dependability, include it in the xedition.zip, since he's already got that separate bundle for Mac users.  So, each version of xedition would include an Installer that would definitely work for that arrangement of files.  But it's easy to make it work from one level out, in Oni/, if you think that's better.

Any time you want to add version numbers somewhere, geyser, feel free.  You can just stick the number in the heading of a shell script; it's easy to find something like that with AppleScript.

And it's true that a friend of mine (an artist, you know how they are ;P) religiously avoids the command line.  He started using Macs in the first place to avoid stuff like that.

Anyway, EdT, what do you think about incorporating an Uninstall or Recompile feature?  Since you've already written the code....


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#31 01/08/08 12:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

I think an uninstall would be good (But why would anyone want to go back to the old version? tongue ).
The recompile will be great for advanced users.

The issue of having the installer included with xedition is how Mac programs are made.  The have both a resource and data file.  If you ever used a flash drive with Mac files on a PC, you will see a lot of extra files, that's because the PC views them separately.

Last edited by EdT (01/08/08 12:01)

Offline

#32 01/08/08 12:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

I know what you mean, but they will still stay applications when transferred back to a Mac.  I haven't even asked geyser, though, if he will include the Installer.

I will try to add your code into my Installer for the level recompiling.  That should be simple.  What would be involved in Uninstalling?  Replacing the modded GameDataFolder with the backup in GDFZero?  Or am I confused about which files are where?  If I had Oni in front of me I could answer this myself.

P.S.: You're right that no one in their right mind would want to go back... that is, unless they miss the opening and ending anime.  I always meant to ask geyser why those didn't work with the Edition.

Last edited by Iritscen (01/08/08 12:01)


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#33 01/08/08 13:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

The Edition script moves the original GameDataFolder  (GDF) to GameDataFolderZero(GDFZ)
To uninstall means deleting the GDF and renaming GDFZ back to GDF.

To fix the missing anime, we just need to copy the files intro.blk and outro.blk form GDFZ to GDF.  You can do that with your installer.

I know what you mean, but they will still stay applications when transferred back to a Mac.

That's good, because one time someone had a Mac program on a cd and while on a PC sent it to me but it was missing the resource fork, so it didn't work.

Offline

#34 01/08/08 13:01

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Mac programming

"I always meant to ask geyser why those didn't work with the Edition." Err, because I didn't copy them over to the new GDF? smile

"I know what you mean, but they will still stay applications when transferred back to a Mac." No, the resource fork will be lost.
One way around this is for you guys to get an SVN client and commit your installer to the project repository (no babelfish smile ).
Then people will be able to download the stuff as a tarball, which should preserve UNIX file permissions and resource forks.
If it doesn't preserve resource forks, heh, then you'd make your installer available as a separate, version-independent DL.


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#35 01/08/08 14:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

Um, I wasn't going to say anything, but "resource fork" is actually the term for a classic Mac app (OS 9 and earlier).  I figured you meant the package contents, which is what they're called now.  Package contents should in no way be lost when transferred to/from PCs, as they (edit: "they" = the apps) are directories in both cases.

Last edited by Iritscen (01/08/08 14:01)


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#36 01/08/08 14:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

Iritiscen: I stand corrected. In fact it was a classic app, that I had the problem with.  I'm glad to know that's no longer an issue.

Offline

#37 01/08/08 14:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

So, geyser, why not copy the movies?  Were you just trying to cut down on HD usage, or you were more interested in focusing on the game data and how to mod it?  Because I would like to see the Edition reincorporate the cutscenes, by the time it is being released in any sort of final way.  It's supposed to be the deluxe version of the original game, so why cripple it?  (I mean, aside from the fact that that woman in the cutscenes doesn't look anything like Konoko ;-)

Also, I say incorporate A LOT.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#38 01/08/08 14:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

I think its because he didn't add that bit of code which copies the movies. I'm sure he had more important things on his mind! smile

Offline

#39 01/08/08 15:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

Well, as you said before, the Installer can always fix that smile


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#40 01/08/08 16:01

geyser
Member
From: beyond the veil
Registered: 01/14/07
Website

Re: Mac programming

"Were you just trying to cut down on HD usage, or you were more interested in focusing on the game data and how to mod it?" Both. smile
"Because I would like to see the Edition reincorporate the cutscenes, by the time it is being released in any sort of final way." Cutscenes?
I'll move/copy the intro and outro, don't worry. Even though you're the one who complained about excessive HDD usage. Happy now? tongue


Behold the power of that which is yet unborn! For the swirling images that flow forth from the Chrysalis are only a shadow of the sleeper's true power.

Offline

#41 01/09/08 09:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

Yes, I am.  smile

I still added the movie copying to this version (v4) of the Installer, however, since for now xedition doesn't do it.

Known bugs/limitations:
- The Recompile option is tantalizingly close to working.  I spent every single free minute last night and this morning on this, which still wasn't much time.  I decided to let you have at it, Ed, since you fixed the path problem.  The question is why 'y' is not recognized as having been set by the series of else-if statements.  Since it doesn't work, I have the 'display dialog' line active instead of the 'do shell script' line, so you can see that y is still set to 0 when it goes to plug it into the mono recompile command.  It should be a global since it is declared at the top but it's behaving as if it's local to the 'else if (buttVal is "Recompile")' section.  Grr.  (Perhaps it's not being set correctly in the else-if series, if that's possible.)

- Commented out in the Recompile code section is a previous attempt at taking input from the user via a text field.  It didn't work either, so I moved to the (more user-friendly) 'choose from list' code.

- I can't remember testing the Install options after adding the cp commands for the movies.

- It's got a lot of dialogs now.  It's not fun designing an interface around a three-button limit when one button always has to allow escaping the action, but I think it produces a more focused interface than if everything were thrown into one window.

- I think the Install option failed when it had to actually open the Terminal instead of just bringing it to the front.  If this happens to you, it's because the Terminal can't 'activate' fast enough to take the 'do shell script' command.  Frankly I think that's a shortcoming in AppleScript, not my code, but it can be worked around with a kludgy 'delay [x] seconds' command after the 'activate' line, or a more sophisticated approach such as making sure that the Terminal is open and ready before sending the 'do shell script' command, which I will probably implement on the next pass.  For now, you may have to already have Terminal open for the Install to work.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#42 01/09/08 11:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

I like what you have done so far.

I didn't have any problems with the install option failing.  The terminal open and the update and full install worked.
I noticed that the AEI quits when the terminal opens, is that what you intended?

I will give it a try with the recompile path issue.  That was a good idea having all the levels listed so the user can choose which one they want. I especially liked the fact that you had the level number and name together.

This app is coming along much better than I expected, thanks to your help.

Offline

#43 01/09/08 11:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

We make a good team -- for instance, I have no idea how to use mono, I just copied the code from the script in your Tool, as you know.  I'm glad you liked the 'choose from list' part since I skipped breakfast this morning to write that, immediately after waking up.  It's a wonder it's even close to working.  You can see from the dialog it gives you that the string concatenation works fine, it's just that 'y' has issues.

And actually, I did not intend for the AEI to quit when Terminal opens.  I didn't have time to figure out why that happens (maybe all the code it's going to run is just done so it says, "Okay, buh-bye").  Frankly, I'm shocked that either Install worked for you if Terminal wasn't already open.

I have been debating with myself over whether the AEI should do anything at the end like saying "I'm done."  The issue is that we can't confirm that the commands it sent actually succeeded.  Even the Edition scripts don't give a final "success or failure" message so it's not possible to report that back to the user.  Maybe something for geyser to think about.  It's certainly possible to pull the last line of text from the Terminal if we know that line reports success/failure.  As it is, I don't mind AEI quitting because it has nothing to say at the end to the user, but of course any proper Installer should report back upon finishing.

Also, I wish that we had at least another two Mac users to report bugs.  Do you know anyone you can recruit?  Finally, have you been trying this code on your PPC Mac in addition to your Intel Mac?


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#44 01/09/08 12:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

I've been testing on both PPC and Intel.

Quick report, I took a portion of your script and it works, I get the correct y value.

set x to "Level 3: Bio-Research Lab"

if (x is equal to "Level 1: Syndicate Warehouse") then
    set y to 1
else if (x is "Level 2: Manufacturing Plant") then
    set y to 2
else if (x is "Level 3: Bio-Research Lab") then
    set y to 3
end if
display dialog (y)
set cmd_string_recomp to "cd " & "install; mono OniSplit.exe -import:sep ../../GameDataFolder/level" & (y as string) & "_Final ../../GameDataFolder/level" & (y as string) & "_Final.dat"

display dialog cmd_string_recomp

This shows your logic is correct. Will continue working on it.

EDIT: I added this:

set x to choose from list {"LEVEL 0: GLOBAL DATA", "Level 1: Syndicate Warehouse", "Level 2: Manufacturing Plant", "Level 3: Bio-Research Lab"}

Now I get the error message "The variable y is not defined."

Grrr. I've got to leave for awhile, will continue later on today.

Last edited by EdT (01/09/08 12:01)

Offline

#45 01/09/08 12:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

That bolsters my hunch that the problem is an out-of-scope error.  y is being worked with inside one if statement and then accessed within another.  That shouldn't matter, but if that's the problem, moving the line 'set cmd_string_recomp to "cd " & [...]' up to right below the else-if series (before the only 'set cont to true' in the code), it might work.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#46 01/09/08 12:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

See my edited post above, we posted at the same time.  Later...

Offline

#47 01/09/08 12:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

Why does

 set x to "Level 1: Syndicate Warehouse"

Work

and

set x to choose from list {"LEVEL 0: GLOBAL DATA", "Level 1: Syndicate Warehouse", "Level 2: Manufacturing Plant", "Level 3: Bio-Research Lab"}

Not?

That is the source of the problem.

Now I'm late...

Offline

#48 01/09/08 12:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

You're right, I take back my slandering of y.  Your test shows that the problem is that the result of 'choose from list', x, is being used in a statement like "if (x is [some text]) then [something]".  I don't know why that's a problem.  BUT, we can try this instead:

if ((x as string) is "Level 1[yada yada]")

The (x as string) might help.  Because AppleScript doesn't have explicit types that are required at declaration, this problem happens sometimes and you need to tell AS what kind of variable something is.  Anyway, that's my latest guess.  I will try it tonight if you aren't around to try it.

Source of my latest hunch: http://developer.apple.com/documentatio … ion_2.html (search for 'choose from list' and then look at the statement that checks the value of newWord).


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

#49 01/09/08 17:01

EdT
Moderator
From: Los Angeles, CA
Registered: 01/13/07
Website

Re: Mac programming

Success!

(x as string) was the key.

Now can you make the app run from the Oni folder not the Edition folder.  I don't think we should bother geyser with having another file to deal with. 

What about adding the mono installation to this app?  It could be something as simple as a link to it or as complex as downloading the package and then installing it for the user.

I think if we can make it as easy (foolproof) as possible to install Edition, more people will try it.

Offline

#50 01/10/08 09:01

Iritscen
Moderator
From: NC, USA
Registered: 10/22/07

Re: Mac programming

(x as string) was the key.

Yes it was.  Attached is the latest version of the Installer (v1.0b), with working Recompile option.  Everything works for me, so now three things are called for to get past the beta stage:

1. Bug-testing.  You have pretty much already vetted this app, Ed, but I still think it would be nice to find another Mac user or two to test it on different machines/OS versions.  Also, don't be afraid to test the Uninstall option if you haven't already; it simply moves the GDF folder to your Trash and renames GDFZero to GDF, so you can easily undo that yourself afterwards.

2. Error handling.  What types of problems should AEI look for (like missing folders)?  Because right now, it's just going to quit with a possibly cryptic message if something is amiss; it's better to give some coherent feedback to the user to tell them what they did wrong.

3. Copy editing.  There's a few statements in the Installer that geyser should be aware of so he can approve them.  Below is all of the text that appears in messages to users:

"   Welcome to the Anniversary Edition Installer. If you are installing the Edition for the first time, you may wish to backup your installation of Oni.
   Clicking 'Advanced' will present options for recompiling individual levels and uninstalling the Edition."

"   If you have a replacement file (a mod) that you want to incorporate into Oni's game data, place it in the appropriate folder of GameDataFolderZero by level, then click 'Recompile' and you will be given a choice of which level to recompile. This will only work after the Edition has been fully installed.
       Clicking 'Uninstall' will immediately remove the modified GameDataFolder and restore Oni to its original state, but it will not erase the edition folder, which can be used in conjunction with this Installer to re-install the Anniversary Edition at any time."

"   To proceed, you must have an existing installation of Oni, and an unzipped Anniversary Edition folder named 'edition'. This Installer must be in the edition folder, and the edition folder must be in the folder that contains the Oni application (make sure it is simply called 'Oni' or 'Oni.app').
       Click Full Install to install a fully-featured copy of the Edition, and Update Install to install only the mods/additions to Oni's game data. Please note that the Full Install will take at least 20 minutes, but it is recommended for each update/installation of the Edition."

(EdT has already pointed out that this message should also mention that you need mono.)

Now can you make the app run from the Oni folder not the Edition folder.  I don't think we should bother geyser with having another file to deal with.

What does geyser think on this point?  Is it too much to ask to include the AEI.app folder in with xedition?  I just wanted to avoid giving the user something extra to download.  How many programs come with installers completely separate from the data they install?

What about adding the mono installation to this app?  It could be something as simple as a link to it or as complex as downloading the package and then installing it for the user.

Good point (and I forgot to mention in the dialogs that mono is needed!).  This will take some research on my part, as I have never had to do this kind of thing before.  There are Unix commands for getting/installing packages....

I think if we can make it as easy (foolproof) as possible to install Edition, more people will try it.

Hence why I advocate including it in xedition.zip.


Check out the Anniversary Edition Seven at ae.oni2.net!

Offline

Board footer

Powered by FluxBB