Page 1 of 1

Current mod directory ?

Posted: Fri Aug 05, 2016 8:26 am
by binbinhfr
Hi,

I'm not sure, but I remember that I read sometimes something about a current mod directory variable ?
Something to replace __MyModName__ in data.lua by __current__ ? Did I dream ? Or do we have to always specify the
name of the relative path ?

Re: Current mod directory ?

Posted: Fri Aug 05, 2016 10:01 am
by Rseding91
"__MyModName__" *is* the mod directory path. You can use any mod name to reference the mod files.

I'm not sure what you're asking about.

Re: Current mod directory ?

Posted: Fri Aug 05, 2016 10:08 am
by Klonan
You can say like

Code: Select all

this_mod = "__My_Long_Named_And_Inconvenient_To_Type_Mod__"
And then just use it in its place:

Code: Select all

icon = this_mod.."/graphics/my_great_icon.png"

Re: Current mod directory ?

Posted: Fri Aug 05, 2016 10:44 am
by binbinhfr
OK, so there is no generic name to point to the current mod directory. You always have to type your mod's name. I thought I saw something like that in past releases... Nevermind :?

Re: Current mod directory ?

Posted: Fri Aug 05, 2016 11:42 am
by aubergine18
Isn't there an undocumented property lurking on _G that defines the mod name?