Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Loading LUA script files - Better to pre-load or

Author
Message
pdq
17
Years of Service
User Offline
Joined: 20th Jul 2006
Location:
Posted: 20th Jul 2008 00:46 Edited at: 20th Jul 2008 00:49
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:



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.

Login to post a reply

Server time is: 2024-04-27 16:48:13
Your offset time is: 2024-04-27 16:48:13