load.lua questions

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
WillShattuck
Wayist
Posts: 16
Joined: Wed Feb 20, 2008 4:25 am

load.lua questions

#1 Post by WillShattuck »

Hi DG,

I finally got TE4 downloaded tonight. What's funny is I started going through the code before I even played the game. heh.

In figuring out how the ToME4 module loads (so I can make a Template Module), I noticed that body parts are loaded directly in load.lua instead of being called by a loadDefinition. Is there a reason some are coded directly in load.lua and others are loaded?

dofile - is the precompiling certain Lua code files ahead of time so it doesn't have to interpret them as they come up?

loadDefinition - this is loading variables into memory so they can be more easily referenced?

I do admit that I know nothing about Lua (well, next to nothing. Tonight I read from the Lua manual), but am interested.

Thanks.

[NOTE: this may not be in the right forum. Feel free to move it if needed.]

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: load.lua questions

#2 Post by darkgod »

Body parts:
It wasnt big enough to justify its own file mainly ;)

dofile: It just runs the given lua file, doing whatever the file does

loadDefinition: classes that have this method use it like dofile but in a specialized way, this allows the called file to have access to special functions to define new stuff, depending on the class used.

A template module is a good idea, I wanted to do one but I keep stalling it to work on the ToME module :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply