DSLua Community
Welcome, Guest. Please login or register.
May 18, 2012, 10:21:24 PM
1371 Posts in 262 Topics by 33109 Members
Latest Member: Limewire Download
DSLua Community  |  DSLua - Best scripting language for Nintendo DS  |  Home-brew/Hacks/Games/Projects  |  Includes and Saving... « previous next »
Pages: [1]
Author Topic: Includes and Saving...  (Read 2315 times)
sylus101
Waxing Crescent
**
Posts: 68



« on: March 04, 2007, 11:55:37 AM »

Last question for a bit, well 2 of them.

Is there a way to include another script file for use of storing long lists of functions?

Also, is there anyway to save progress in a game somehow? I was thinking of a text file with flags that could be set and then called at some point...
Logged
Jeremysr
First Quarter
***
Posts: 215



WWW
« Reply #1 on: March 04, 2007, 01:43:14 PM »

Yep, you can run other scripts by using either require() or dofile(). They work almost exactly the same. So if you have lots of functions for your program in a seperate file, put this near the top of the main program file:

require( "functions.lua" )

or

dofile( "functions.lua" )

The difference has something to do with require() looking in other directories for the file you have, and is supposed to be used for libraries. But both will work.

For saving, just use the basic file input/output functions here: http://www.lua.org/pil/21.1.html . If you need help with them just post. Smiley
Logged
sylus101
Waxing Crescent
**
Posts: 68



« Reply #2 on: March 05, 2007, 02:19:55 AM »

Due to the packaging of the GBFS type of DSLua, do you think input/output will be a problem? They'd call files that don't really exist on the cart but inside the .nds file...
Logged
Jeremysr
First Quarter
***
Posts: 215



WWW
« Reply #3 on: March 05, 2007, 01:30:34 PM »

Oh, yeah. With GBFS files I'm pretty sure you can only access files inside the ROM. You should probably just use the CF version. It works on a lot more hardware. And we might not have it in version 0.7.
Logged
sylus101
Waxing Crescent
**
Posts: 68



« Reply #4 on: March 05, 2007, 03:50:40 PM »

My situation, hopes and dreams:

Got an R4 cart and can't run any version on my DS at the moment.

I understand you can pretty much only run the GBFS version with an emulator so that's what I'm stuck with for now.

I don't know the eta on the DLDI change, but it sounds promising. I run DSOrganize on the R4 with the right DLDI patch for my cart and it works very very well.
I'm hoping to see the same from DSLua.
... any idea how far off the DLDI edition 0.7 is?

**EDIT** I was playing around just to try, and blue and green CF versions work okay in Dualis, still with the ARM 7 unchecked. I'm hopeful these versions as well may work with DLDI.
« Last Edit: March 05, 2007, 05:32:37 PM by sylus101 » Logged
Pages: [1]
« previous next »
    Jump to: