News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
iGame3D MurgaLua'd
Author Message
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
RE: iGame3D Data Directories

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 Player.app/ Data/Scripts/core.lua is run
followed by iGame3D Player.app/ Data/game script.lua

The definition for an external Data folder of scripts and other content
is defined in iGame3D Player.app/Data/game 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

Code:
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
            c=c+1
        end
        if numLevels<=c then return string.sub(path, 1,i); end;    
    end
end


--originating application path
bundleroot = getSceneInfo(IG3D_ROOT)


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

Code:
gameroot=goDirsUp(bundleroot, 3)


Its default is at three to find the file outside of build/Development/iGame3D Player.app/
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

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


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.

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

11-29-2007 09:10 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
iGame3D MurgaLua'd - iGame3D - 11-24-2007, 06:54 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 09:36 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 09:53 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 10:13 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 10:50 PM
RE: iGame3D MurgaLua'd - chrimo - 11-24-2007, 11:21 PM
RE: iGame3D MurgaLua'd - Tobi - 11-25-2007, 04:36 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-25-2007, 05:14 AM
RE: iGame3D MurgaLua'd - Tobi - 11-25-2007, 05:37 AM
RE: iGame3D MurgaLua'd - chrimo - 11-25-2007, 06:16 AM
RE: iGame3D MurgaLua'd - chrimo - 11-25-2007, 06:38 AM
iGame3D Hello World - iGame3D - 11-25-2007, 09:20 AM
RE: iGame3D MurgaLua'd - chrimo - 11-27-2007, 06:01 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 12:26 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 06:04 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 06:32 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 06:36 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 07:11 AM
RE: iGame3D MurgaLua'd - chrimo - 11-28-2007, 07:29 AM
RE: iGame3D MurgaLua'd - Tobi - 11-28-2007, 07:43 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 02:58 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-29-2007, 03:25 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 03:50 AM
RE: iGame3D MurgaLua'd - iGame3D - 11-29-2007, 04:02 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 06:25 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:07 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 07:29 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:45 AM
RE: iGame3D MurgaLua'd - Tobi - 11-29-2007, 07:52 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 07:42 AM
RE: iGame3D Data Directories - iGame3D - 11-29-2007 09:10 AM
RE: iGame3D MurgaLua'd - chrimo - 11-29-2007, 09:24 AM
RE: iGame3D MurgaLua'd - chrimo - 12-02-2007, 10:56 PM
RE: iGame3D MurgaLua'd - iGame3D - 12-03-2007, 04:46 AM
RE: iGame3D MurgaLua'd - chrimo - 12-03-2007, 06:50 AM
RE: iGame3D MurgaLua'd - Tobi - 12-03-2007, 07:09 AM
RE: iGame3D MurgaLua'd - chrimo - 12-09-2007, 12:18 AM
RE: iGame3D MurgaLua'd - chrimo - 12-09-2007, 09:32 PM
RE: iGame3D MurgaLua'd - mikshaw - 12-12-2007, 02:47 PM
RE: iGame3D MurgaLua'd - chrimo - 12-12-2007, 08:35 PM
RE: iGame3D MurgaLua'd - mikshaw - 12-13-2007, 01:31 AM
RE: iGame3D MurgaLua'd - iGame3D - 12-13-2007, 02:55 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: