GameFreak
GameFreak

Reputation: 2931

How can I load and execute a lua file from within another lua file

I have a lua script which is run using the command line interpreter, the script needs to load a table from a file. The table is stored like this:

create_object_action = {
    reflexive = true,
    which_base_type = 29,
    how_many_min = 1,
    how_many_range = 0,
    velocity_relative = false,
    direction_relative = true,
    random_distance = 0
}

How can I load the data in the table into the global namespace?

Upvotes: 7

Views: 9640

Answers (1)

Warren Young
Warren Young

Reputation: 42383

dofile "mytables.lua"

Upvotes: 14

Related Questions