Current mod directory ?

Place to get help with not working mods / modding interface.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Current mod directory ?

Post 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 ?
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 15967
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Current mod directory ?

Post 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.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5411
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Current mod directory ?

Post 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"
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Current mod directory ?

Post 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 :?
My mods on the Factorio Mod Portal :geek:
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Current mod directory ?

Post by aubergine18 »

Isn't there an undocumented property lurking on _G that defines the mod name?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Modding help”