Where do I get the modified version of Lua 5.0?

Everything about mods can be found here.

Moderator: Morax

Where do I get the modified version of Lua 5.0?

Postby Lionhardt » 06 Feb 2018, 16:12

The wiki mentions that FA uses a modified version of Lua. I built Lua 5.0 from the official website, but apparently that version does not work for FA files. For example when I run the interpreter with a <mapname>_save.lua it sayst it does not know the typecaste or constructor like function calls BOOLEAN, STRING etc.

Snippet from such a file:

Code: Select all
MasterChain = {
        ['_MASTERCHAIN_'] = {
            Markers = {
                ['AmphPN10'] = {
                    ['hint'] = BOOLEAN( true ),
                    ['type'] = STRING( 'Amphibious Path Node' ),
                    ['adjacentTo'] = STRING( 'AmphPN03 AmphPN04' ),
                    ['color'] = STRING( 'ff00ffff' ),
                    ['graph'] = STRING( 'DefaultAmphibious' ),
                    ['prop'] = STRING( '/env/common/props/markers/M_Path_prop.bp' ),
                    ['orientation'] = VECTOR3( 0, -0, 0 ),
                    ['position'] = VECTOR3( 460.5, 32.9141, 204.5 ),
                },


Dunno... are these custom functions that are defined elsewhere and the map files get loaded where the functions are defined already or are these predefined functions of that modified lua interpreter? And where do I get that modified one if this is the case?
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Where do I get the modified version of Lua 5.0?

Postby nine2 » 06 Feb 2018, 16:28

I dont think you need modified lua 5.

The types you are looking for (boolean, string) are defined in a file somewhere in the scd files.

The problem is you are trying to build a file by itself, instead of the entire project.

How are you building this?
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Where do I get the modified version of Lua 5.0?

Postby Lionhardt » 06 Feb 2018, 16:36

I just ran the interpreter with it `lua map_save.lua`.

I want to write better version of the props transformation script i hacked together in python a few years back and for that I need to parse the tables in the save.lua into table objects... which works just fine with the exception of the functions BOOLEAN etc. But okay I can just define dummy function for them as I don't need their implementation... I think.
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Where do I get the modified version of Lua 5.0?

Postby nine2 » 06 Feb 2018, 16:37

Ultra hack job is you can paste the types into your map. It will work. Proper solution is to build everythijng
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Where do I get the modified version of Lua 5.0?

Postby Lionhardt » 06 Feb 2018, 16:41

Guess that won't be necessary for what I want to do. I will come back if I was wrong about that, thanks.
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Where do I get the modified version of Lua 5.0?

Postby ozonex » 06 Feb 2018, 16:43

FAF Map Editor Alpha v0.605 > Get it now!
User avatar
ozonex
Priest
 
Posts: 358
Joined: 16 Feb 2012, 20:11
Location: Poland
Has liked: 197 times
Been liked: 263 times
FAF User Name: ozonex

Re: Where do I get the modified version of Lua 5.0?

Postby Lionhardt » 06 Feb 2018, 16:56

Oy, nice. Thanks!
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Where do I get the modified version of Lua 5.0?

Postby Jip » 07 Feb 2018, 23:02

Anihilnine wrote:I dont think you need modified lua 5.

The types you are looking for (boolean, string) are defined in a file somewhere in the scd files.

The problem is you are trying to build a file by itself, instead of the entire project.

How are you building this?

To be more specific, it is this file:
mohodata/lua/dataInit.lua

Code: Select all
# Copyright � 2005 Gas Powered Games, Inc.  All rights reserved.

function BOOLEAN(b)
   return b
end

function INTEGER(i)
   return i
end

function FLOAT(f)
   return f
end

function VECTOR2(x,y)
   return { x, y, type = 'VECTOR2' }
end

function VECTOR3(x,y,z)
   return { x, y, z, type = 'VECTOR3' }
end

function RECTANGLE(x0,y0,x1,y1)
   return { x0, y0, x1, y1, type = 'RECTANGLE' }
end

function STRING(s)
   return s
end

function GROUP(group)
   group.type = 'GROUP'
   return group
end

Up to this point I still don't know its actual purpose.
Jip
Avatar-of-War
 
Posts: 51
Joined: 12 Jul 2015, 22:25
Has liked: 3 times
Been liked: 11 times
FAF User Name: Jip


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest