| View previous topic :: View next topic |
| Author |
Message |
haxx_blaster
Joined: 20 Jan 2006 Posts: 13
|
Posted: Tue Feb 07, 2006 6:17 pm Post subject: Using 2 .Lua's together |
|
|
If i do a (dofile "game.lua") can i from that Game.Lua get etc "Base" from the lua i came from?
Between index.lua and game.lua
I really need help with this, either i am stuck. :P |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Tue Feb 07, 2006 7:10 pm Post subject: |
|
|
How hard would that be to find out ??
You might need a startup program that is never revisited to set initial
values of variables, load pics, etc so they don't happen again, but
after that I don't see why you can't jump from one file to another.
The only problem I have found is that the file is loaded from memory
stick each time, even if it has already been loaded to RAM.
This will cause things to slow down while moving from one file to another.
Traditionaly, new data is loaded between levels of a game.
Art. |
|
| Back to top |
|
 |
CaptainChickenpants
Joined: 01 Feb 2006 Posts: 5
|
|
| Back to top |
|
 |
haxx_blaster
Joined: 20 Jan 2006 Posts: 13
|
Posted: Wed Feb 08, 2006 12:16 am Post subject: |
|
|
| Art wrote: | How hard would that be to find out ??
You might need a startup program that is never revisited to set initial
values of variables, load pics, etc so they don't happen again, but
after that I don't see why you can't jump from one file to another.
The only problem I have found is that the file is loaded from memory
stick each time, even if it has already been loaded to RAM.
This will cause things to slow down while moving from one file to another.
Traditionaly, new data is loaded between levels of a game.
Art. |
I have tryed to change "BGSound" to "BGSound2" from Menu.lua when "BGSound" is loaded from Game.lua And i diden't work at all. |
|
| Back to top |
|
 |
haxx_blaster
Joined: 20 Jan 2006 Posts: 13
|
Posted: Wed Feb 08, 2006 4:23 am Post subject: |
|
|
| I got it to work with another lua file, i will do it throught 3 lua files then. |
|
| Back to top |
|
 |
fattymc03
Joined: 11 Feb 2006 Posts: 18
|
Posted: Tue Feb 21, 2006 6:50 am Post subject: |
|
|
you want to use: require "filename.lua" at the top of your program
that kinda creates a package. you'll be able to access anything in filename.lua from whatever file you put that line in |
|
| Back to top |
|
 |
|