I am using Barnski's LUA plugin. Let's say I have the following script file called: "Level1.lua"
This file contains the following code:
Load_Script("Ship.lua")
Make_Ship("scout.lua",0,100,0)
Make_Ship("fighter.lua",100,0,0)
Make_Ship("fighter.lua",0,0,100)
Make_Ship("fighter.lua",0,0,150)
The "Ship.lua" file contains generic functions that all ships use including the Make_Ship() function. It also declares the Ship[] array that stores information for all ship classes.
Now the first parameter in the Make_Ship() function is the name of another scripfile that is loaded. That script only contains properties that are unique to a particular ship class (a scout as opposed to a fighter)
The level loads three fighter ships.
This may sound silly, but does the "fighter.lua" get loaded three times into memory?
What if I want to make 100 fighters. Do I load "fighter.lua" 100 times? Or is there someway I can load the file once and make reference to it every time I want to make an instance of a fighter during runtime?
Thanks.