Murga-Projects Forums

Full Version: iGame3D MurgaLua'd
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just another question:

where is the searchpath for Data ?
Is there a way to extend or manipulate the search path ?

Data is at the same level as:
Data ig3d_mac_xcode
iGame3D ig3d_win_mingw

Ah, you checked out the whole thing.

The mac source (ig3d_mac_xcode), the Windows source (ig3d_win_mingw) and the Data folder.

Our idea was that the user would only checkout the source of his particular operating system and then checks out the Data folder into the source directory.

I guess we might need to reorganize that Wink

Since you already have the Data folder, you should simply move it into the source folder.

So that it looks like this:


The player app should be in


With this setup everything should work fine.
Yes, you can change the search path for the data folder.

To do this, put something like this into the game script.lua inside the Data folder of the player bundle.

setSceneInfo(IG3D_ROOT, "/Users/chrimo/MyiGame3D/")

from now on iGame3D will look for a Data folder inside /Users/chrimo/MyiGame3D
These files and directories must be present  in the package bundle to operate.
core.lua should not be edited, but it is useful to read.

At application launch the file iGame3D Data/Scripts/core.lua is run
followed by iGame3D Data/game script.lua

The definition for an external Data folder of scripts and other content
is defined in iGame3D script.lua

The default when using the SVN repository is set to 3 folders out of the application bundle.

Other situations might point inside the bundle for deployment (0) or one level (1) out of the bundle for easy editing.

These changes are easy to make by changing a value in the game script.lua.

The default game script we are using looks like this

function goDirsUp(path, numLevels)
--takes a path (with trailing /) and moves up numLevels levels and returns it
    local i
    local c=-1
    for i=#path,1,-1 do
        if string.sub(path, i,i)=="/" then
        if numLevels<=c then return string.sub(path, 1,i); end;    

--originating application path
bundleroot = getSceneInfo(IG3D_ROOT)

Set the value here to set the distance from the application bundle to the data folder.

gameroot=goDirsUp(bundleroot, 3)

Its default is at three to find the file outside of build/Development/iGame3D
If you put your levels and content into the Data folder of the package you'd set the value to 0, or simply replace the line with gameroot=bundleroot
If you drop your Data folder in the same folder as the app, set the value to 1

Windows doesn't have packages so we keep the Data folder in the app path

if murgaLua.getHostOsName()=="macos" then
setSceneInfo(IG3D_ROOT,gameroot) --custom gameroot

Now that we can find our Data we branch to customizable scripts.
The default level is a menu and loads functions to activate the console,
inspector, and a missing script editor.

if game_func==nil then loadLevel("Data/Levels/default") end

these informations, I missed make it more transparently, what happens inside...
Now, I think, I will manage it to create own simple applications.

Thanks for ALL *.*

Greetings from Hamburg/Germany
Hi again :-)

I've copied the DataDirectory from SVN directly into the container now...

but when trying to execute the player, I get the following error...
Any idea, wht I'm doing wrong ?

Thanks for some more hints

/Users/cmock/Desktop/iGame3D\\ Player ; exit;
x49ws40cmock:~ cmock$ /Users/cmock/Desktop/iGame3D\\ Player ; exit;
----- OpenGL Fullscreen setup -----

CGGetActiveDisplayList() returned: 0
Number of active displays found: 1
Picked display 1

Display 1 Information:
Resolution: 1280x800 pixels
Refresh Rate: 0.000000 Hz
Colors: 32-bit (Millions)
Trying to get a valid fullscreen OpenGL pixel format on device...
DMGetGDeviceByDisplayID() returned 0
aglChoosePixelFormat() returned a valid fullscreen OpenGL pixel format on this device!
aglCreateContext() succeeded.
aglSetCurrentContext() succeeded.
Stencil buffer bits: 8
OpenGL Version: 1.2 APPLE-1.5.18
GLSL is supported.
GL_ARB_fragment is supported.
Number of texture units: 8
[string "line"]:19: attempt to call field 'getHostOsName' (a nil value)
Can you post the game script, it looks like the error is there.

GetHostOsName shouldn't be returning a nil value.

It could be that the game script is still looking three folders out of the build folder for something?

Check that the script says murgaLua.getHostOsName()
Hi all,

with the excellent support of Tobias and Bill, it will compile, link and install now at OSX 10.5 (Leopard) !!!
WOW, magic sceneries controlled by murgaLua-Power...
I have no words for this.

Great job, well done by the iGAME3D crew.

You must give it a try!

Thanks for ALL
Hey folks,

To make life easier and reduce confusion here is the guide on how to check out iGame3D on OS X and on Windows. On both systems you will need Subversion (svn).

Under Mac OS X open up a terminal window and cd (change directory) to the place where you want iGame3D stored. Then enter the following:

svn co ig3d_mac_xcode
cd ig3d_mac_xcode
svn co Data

After that open up the .xcodeproj and build iGame3D. You can run it from there as well. NOTE: the actual player is in build/Development/
Don't try to run the player at the root directory.

Under Windows, open the system console and also cd (change directory) to the place where you want iGame3D stored. Then enter the following:

svn co ig3d_win_mingw
cd ig3d_win_mingw
svn co Data

Then you can use MingW/MSYS to build the player.exe or simply use the one that comes with the source.

Good luck


I've started a small iGame3D-FAQ with all my own questions...
Hopefully, I get answers from the world :-)

Is there already another FAQ available ? Else I can try to start this job.
Are there more questions of interest ?

Today I try to start to answer the first questions :-)

iGame3D FAQ written by a fan called chrimo :-D

What is iGame3D ?

Who are the makers of iGame3D ?

What is Lua ?

What is murgaLua ?

What is FLTK ?
What is Newton physics ?

What are emitters ?

What are exporters ?

What is Fluid ?

What is PNG ?

What graphic formats are supported ?

What are icons ?

What are images ?

What are FontPngs ?

What is WTF ?

What are shaders ?

What are materials ?

What are meshes ?

What are Levels ?

What are scripts ?

Does iGame3D support sound ?

What is Ogg ?

Does iGame3D support networking ?

Which operating systems are supported ?
    OSX >10.4

Where can I get iGame3D ?

Where can I get the last developer previews ?

Are there prebuild binary versions for iGame3D available ?
How can I start iGame3D applications ?
    iGame3D Player

How should I start with iGame3D ?
    Start iGame3D Player and what the sample applications.

How can I build my own iGame3D applications ?
    Data/Levels/MyApplicationName/game script.lua

Where can I find the Data directory ?

What is minimal neccessary for an application ?

How can I open a window for my own application ?

How can I add a background ?

How can I add an object ?

How can I move the object ?

How can I check collisions with other objects ?

Which iGame3D API calls are available ?

Pages: 1 2 3 4 5
Reference URL's