Hey, we have forums!

Author Topic: New crashing thread  (Read 19358 times)

0 Members and 3 Guests are viewing this topic.

Offline achurch

  • Bit Bit
  • ****
  • Posts: 90
    • View Profile
Re: New crashing thread
« Reply #15 on: April 04, 2011, 03:45:10 am »
One quick addendum to GMMan's post.

If you want to use just the patch for the crash bug, but stay with the old script interface (the one your scripts are written for now), run this command before the "cmake" line:

Code: [Select]
hg update custom-entity-crash-fix
That will switch to the repository branch containing just that particular patch (plus a few others from the official repository on icculus.org), removing all the other changes I made.

If you later decide you want to try out the new script interface and other changes, you can go back to the main branch and build a new executable with:

Code: [Select]
make clean
hg update tip
cmake
make

(The "make clean" isn't always necessary, but CMake sometimes fails to notice file changes, so it's safest to clean up before changing branches.)

Offline FrancesF

  • Bit Bit
  • ****
  • Posts: 83
    • View Profile
Re: New crashing thread
« Reply #16 on: April 04, 2011, 04:27:31 am »
I've got to say there are more emotional ups and downs to moddling than I would have believed.  There's the exhilaration of seeing a creature you've drawn come alive and swim around of the screen, there's the surprise and chagrin when something you hadn't foreseen between creatures you've created occurs, and then there's the total frustration of working at something you don't really have the tools for yet, and is way over your head.  Right now I'd like to throw my computer in the trash!

Here's what I've done so far:  downloaded and installed CMake, Xcode, and Mercurial.  CMake and Xcode went right into the main Application folder and the Developer/ Application folder respectively, like good little apps.  Mercurial I can't find anywhere, although it said installation was successful each of the four or five times I installed it hoping it would show up.   I postponed that worry for a bit and googled what I didn't understand of GMMan's instructions: the "Terminal", "cd," "directories," and how to "run" something in the terminal.   So, I've got that the "Terminal" is an app included with Macs, that lets you directly work with the unix code, "cd" means change directory, and "directory" means file.

New questions:

1)  GMMan, when you say "Aquaria's source", which exact files do you mean?

2)  When you run something, do you type the instruction in the terminal window, for example
Quote
hg clone http://www.achurch.org/cgi-bin/hg/aquaria
and then just hit enter to make it run?

3)  Is there anything specific I need to name this file that I put the Aquaria source in, or can it just be anything, for example, "Aquaria-ent-fix"?

4)  When you say, "copy the scripts included with the source," which scripts do you mean?

Sorry to be so ignorant.  But I really do want to get some interesting new creatures into this mod!

Frances

Offline achurch

  • Bit Bit
  • ****
  • Posts: 90
    • View Profile
Re: New crashing thread
« Reply #17 on: April 04, 2011, 06:21:32 am »
I've got to say there are more emotional ups and downs to moddling than I would have believed.  There's the exhilaration of seeing a creature you've drawn come alive and swim around of the screen, there's the surprise and chagrin when something you hadn't foreseen between creatures you've created occurs, and then there's the total frustration of working at something you don't really have the tools for yet, and is way over your head.  Right now I'd like to throw my computer in the trash!

Don't worry, that's just to prepare you for the thrill of finally getting it working. (:

Mercurial I can't find anywhere, although it said installation was successful each of the four or five times I installed it hoping it would show up.

I presume you mean that you were able to download and install the Mercurial package itself, but it's not showing up in the Finder? That's as designed; Mercurial is strictly a command-line tool (though there are separate packages which let you use a GUI as well). If you open a Terminal window, type "hg" and press Enter, you should see something like:
Code: [Select]
Mercurial Distributed SCM

basic commands:

 add        add the specified files on the next commit
 annotate   show changeset information by line for each file
 clone      make a copy of an existing repository
...
 update     update working directory (or switch revisions)

use "hg help" for the full list of commands or "hg -v" for details
That'll tell you it installed successfully.

[...] and "directory" means file.

Not exactly -- "directory" is what you may know as "folder", i.e. something that contains other files (and possibly more directories -- in that case they're also referred to as "subdirectories" of the containing directory). "File" usually means a single unit of information, such as a text document.

New questions:

1)  GMMan, when you say "Aquaria's source", which exact files do you mean?

I think I can answer this; it's a reference to all the files that comprise the source code to Aquaria. This includes the game's Lua scripts, for example, and also includes the C++ source code (files whose names end in ".cpp" or ".h") for the game engine itself, along with various supporting files. If you run the "hg clone" command, you'll get all of these at once.

2)  When you run something, do you type the instruction in the terminal window, for example
Quote
hg clone http://www.achurch.org/cgi-bin/hg/aquaria
and then just hit enter to make it run?

Yes, that's correct.

3)  Is there anything specific I need to name this file that I put the Aquaria source in, or can it just be anything, for example, "Aquaria-ent-fix"?

When you run the "hg clone" command, the directory will be named "aquaria" by default, but yes, you can name it anything you want. To use a different name, add it at the end of the command line, separating it from the repository location with a space:
Quote
hg clone http://www.achurch.org/cgi-bin/hg/aquaria Aquaria-ent-fix

4)  When you say, "copy the scripts included with the source," which scripts do you mean?

When you download the source, there's a subdirectory of the top-level "aquaria" (or whatever you name it) directory called "game_scripts". Within this is another subdirectory called "scripts", which contains all the Lua scripts used by the game. (There's a second subdirectory at the same named "_mods", which has the Lua scripts for the mods included with the game such as the editor tutorial.) You'll need to copy the files in this subdirectory on top of the ones that came with the Aquaria distribution you downloaded.

To do this, first locate Aquaria in the Finder (right-click and select "Show in Finder"), then right-click on the Aquaria icon in the Finder window and select "Get Info". You'll see a line that looks like "Where: /Users/achurch/Applications" (the part after the colon will change depending on where it's installed). The text beginning with the first slash is the location of Aquaria's data, also known as its "path".

In a Terminal window, enter this command (replace the bolded part with the path from the Get Info window):
Quote
ls /Users/achurch/Applications/Aquaria.app/Contents/Resources/scripts
You should see a few subdirectories listed, like "entities" and "global". This is just to confirm that you have the right path for the scripts. Note that if the path contains a space in it, you need to enclose the entire path in double quotes:
Quote
ls "/Users/My User Name/Applications/Aquaria.app/Contents/Resources/scripts"

Then, after changing to the Aquaria source directory, run this command:
Quote
cp -a game_scripts/scripts game_scripts/_mods /Users/achurch/Applications/Aquaria.app/Contents/Resources/
This will overwrite your existing scripts with the scripts from the source code, which are needed to work with the new executable you build by running "make".

If you're worried about overwriting the data you downloaded, you can make a backup copy of the entire application using the Finder.

One timesaving hint, in case you're not aware, is that if you enter part of a file or directory name in the Terminal window and press the Tab key, Terminal will look for a file or directory with the path you typed and autocomplete the path, if possible. So in the above case, you could type "g<TAB>" instead of writing out "game_scripts/".

Also, I'm not sure it's been mentioned yet, but after you build an executable from the source code, you have to tell it where the game data is located before you can start the game. Enter this command, which only needs to be run once in any given Terminal window:
Quote
export AQUARIA_DATA_PATH=/Users/achurch/Applications/Aquaria.app/Contents/Resources
Then you can run the game itself from the Aquaria source directory with:
Quote
./aquaria

Sorry to be so ignorant.  But I really do want to get some interesting new creatures into this mod!

Not a problem -- that's how we all learn!

Offline FrancesF

  • Bit Bit
  • ****
  • Posts: 83
    • View Profile
Re: New crashing thread
« Reply #18 on: April 04, 2011, 07:14:14 am »
Yes!  I just verified that Mercurial is there.  I'll tackle the rest tomorrow...

Thank you, achurch  :)

Offline GMMan

  • Giant Bit
  • ******
  • Posts: 254
  • "Uh... I'll be right here after you're done..."
    • View Profile
Re: New crashing thread
« Reply #19 on: April 04, 2011, 06:23:48 pm »
@achurch: I'm trying a build right now, but it always gets stuck on freetype. It seems that it can't find ftconfig.h, though I know it's there. I can aleviate it a bit by manually inserting the #define in each of the files that use it, but there are too many files I'd have to do that to. So is it my source or is it my compiler? Maybe I should clean out my CMake cache.
Follow me on Twitter: @gmman_bzflag

Offline achurch

  • Bit Bit
  • ****
  • Posts: 90
    • View Profile
Re: New crashing thread
« Reply #20 on: April 05, 2011, 02:44:24 am »
FreeType's include system is a royal PITA. I assume you're building with internal FreeType (AQUARIA_INTERNAL_FREETYPE=TRUE)? I'll take a look and see if I borked up the include paths there.

EDIT: Hmm, a clean build with internal FreeType worked fine for me. I forget, are you using CMake or not? If not, you might want to doublecheck the compiler flags -- the CMakeFile adds a bunch of extra flags just for the FreeType sources.
« Last Edit: April 05, 2011, 02:53:52 am by achurch »

Offline GMMan

  • Giant Bit
  • ******
  • Posts: 254
  • "Uh... I'll be right here after you're done..."
    • View Profile
Re: New crashing thread
« Reply #21 on: April 05, 2011, 05:02:00 pm »
All right, cleaning cache. Hopefully this time it will compile.

UPDATE: I think I figured it out. I read CMakeLists.txt and apparently I'm not supposed to be manually defining FreeType include dirs if I'm using internal. I removed all custom defined entries for libraries with the internal option, and I'm trying to compile again.

UPDATE2: I give up. I'm using a .lib file instead.
« Last Edit: April 05, 2011, 06:19:57 pm by GMMan »
Follow me on Twitter: @gmman_bzflag