[MOD 0.8.8] iMod - Nuclear power! (64-bit Windows only)

Topics and discussion about specific mods
immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

[MOD 0.8.8] iMod - Nuclear power! (64-bit Windows only)

Post by immibis »

Installing this voids your warranty! (i.e. the Factorio staff might not want to help you with problems if you have this mod)
and it definitely will not work in 0.9!

Installation instructions
1. Download this zip file
2. Unzip the zip file into your mods folder.
3. Move iflib.dll to <your factorio folder>\bin\x64. It should be in the same folder as Factorio.exe.

If anyone wants to see the source code for iflib.dll, it's in the iMod/iflib-src folder.

Features
  • Aquifer pumps - get water from the ground! Very inefficient.
  • Walls made of copper - they're a bit weaker, and easier to pick up.
  • Walls made of another material, which are much stronger.
  • Bigger lamps, electric poles and substations.
  • Smaller roboports.
  • Nuclear power! To get uranium ore in an existing world, explore new areas or cheat it in.
  • A new type of lab and science pack, which are required to research nuclear power.
  • A way to get lots of stone.
  • A few placeholder icons. (Why is this under "Features"? IDK.)
Screenshots
Image
Image
(edit: this screenshot was supposed to show the area covered by the roboport. Instead, I'll tell you that the screenshot is slightly bigger than the coverage area)
Image
Image
Image
Image
Image

Things you should know:
  • The ore crusher is very inefficient when used in a certain way. This is not a bug. (Well, originally it was, but now it's a feature :) ). It's up to you to find a workaround. If a similar thing happens with the uranium hydration pool, same thing (but you're less likely to run into that accidentally). I'm not going to spoil what causes this, but if you're watching the GUI when you do it, it's pretty easy to notice.
  • The efficiency of a uranium hydration pool increases with water temperature.
  • Water colder than 0 degrees or hotter than 100 degrees will not have the right colour. Nothing I can do about that.
  • Nuclear Boilers run on uranium plates - no other uranium product works as a fuel.
Last edited by immibis on Fri Feb 14, 2014 10:37 pm, edited 3 times in total.

Vitduo
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sun Nov 17, 2013 7:28 pm
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by Vitduo »

Where iflib.dll?

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by FreeER »

Vitduo wrote:Where iflib.dll?
yeah, seems immibis forgot to include it :)
I can't say I understand what he's managed to do, and I'm still checking the mod out myself (just got it installed lol), but
Here's mine:
iflib.zip
Compiled on/for win 7 x64 using VS 2013 express for desktop
(3.3 KiB) Downloaded 323 times
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me :)
Or drop into #factorio on irc.esper.net

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by immibis »

Fixed - iflib.dll is now in the download zip.

Vitduo
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sun Nov 17, 2013 7:28 pm
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by Vitduo »

Thanks, FreeER. But I have error. With version by both FreeER and immibis. Strangely because I have win7 x64 and iflib.dll in <factorio folder>/bin/x64/
And say that I dont have MSVCR100D.dll
https://www.dropbox.com/s/xn2gpmmoyhmqi ... 0error.png
Last edited by Vitduo on Thu Feb 13, 2014 1:05 pm, edited 1 time in total.

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by immibis »

Updated again... this time without the debug mode setting that makes it only work if you have Visual C++ installed.

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by cube »

That DLL file really surprised me :-) Could you tell me what you use it for? I took just a very quick look at the sources and the only thing I found out is that it's some lua thing.

Also, I have some bad news for you. Lua module loading is very restricted in 0.9.0 and it will not be possible to load binary modules anymore :-)
But if there is some functionality you really need with high performance, we could move it into the game core (or re-allow the binary modules).
I have no idea what I'm talking about.

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by ficolas »

Wow tha impressed me :O
Didnt even know you could use c++ there (I know very little c++, almost nothing)
But dont really know why you used c++, I guess that for perfomance

kolt made some graphics for the f-mod when I was going to add nuclear power, now that there is a mod that does it, I wont.
https://forums.factorio.com/forum/vie ... =15&t=1968
Use them if you like them :)

Also are you the same Immibis that made Immibis peripherals, tubestuff etc?

Edit: Destroying an entoty like from ur mod, doesnt work correctly, the hydratation pool and aquifier pump the leaves "dummy" entities behind, and the reactor crashes the game.
Last edited by ficolas on Thu Feb 13, 2014 11:06 pm, edited 1 time in total.

Vitduo
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sun Nov 17, 2013 7:28 pm
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by Vitduo »

ficolas wrote:Also are you the same Immibis that made Immibis peripherals, tubestuff etc?
I think you are right. I thought about it.
Minekruft! Cumputercurft! :mrgreen:

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by immibis »

cube wrote:That DLL file really surprised me :-) Could you tell me what you use it for? I took just a very quick look at the sources and the only thing I found out is that it's some lua thing.

Also, I have some bad news for you. Lua module loading is very restricted in 0.9.0 and it will not be possible to load binary modules anymore :-)
But if there is some functionality you really need with high performance, we could move it into the game core (or re-allow the binary modules).
The DLL allows arbitrary memory access from Lua... which is why it voids your warranty. It basically allows Lua code to escape the sandbox, because Lua modding seems very limited. It's used for two things right now: setting liquid properties (amount and temperature) and randomizing recipes without hitting this bug.

The DLL contains just enough of Lua's code to allow it to create functions that can be called from Lua - it's the most reasonable way to interact with Lua (the interpreter itself, not Lua code), and it only works because you're using an unmodified version of Lua (otherwise the code in iflib wouldn't match the code in the game's Lua interpreter).

If you disable binary module loading (btw, was that because of this, or something else?) I'll just have to find another way to load arbitrary code :P

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by immibis »

ficolas wrote: Edit: Destroying an entoty like from ur mod, doesnt work correctly, the hydratation pool and aquifier pump the leaves "dummy" entities behind, and the reactor crashes the game.
Updated with fix. Also fixed a smelting recipe that was set to crafting by mistake, and an item with no group set.

Edit:
ficolas wrote: But dont really know why you used c++, I guess that for perfomance
It's to do things that Factorio doesn't provide a way to do.

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by FreeER »

immibis wrote:If you disable binary module loading (btw, was that because of this, or something else?) I'll just have to find another way to load arbitrary code :P
Probably the same reason they disabled the io library a while back, mostly pre-emptive security reasons. Though I could be wrong. Honestly I can understand why they wouldn't want it to be available by default, but...there's quite a bit of good that can be done (obviously) using binary modules (if people know how, I unfortunately don't really lol).

@devs (mostly), I'd rather have an option to enable binary loading and io with a warning that you (the devs) are not responsible for any possible damage, or even a separately downloaded 'patch', assuming some more mods are created (if there are none then it doesn't make a huge difference I suppose). I recompiled Factorio to allow the io library when getting the listing of data.raw (for the wiki), it makes it so much easier to simply dump it to a file and use some regular expressions in Notepad++ :) rather than looking through the files and copy/pasting the info (or maybe I'm just really lazy...probably that)

edit: hm, maybe I should actually comment on the mod as well? I like it, almost :) Just from looking at it, it seems too cheap, at least without nuclear meltdowns or something...I had issues getting the temperature of the aquifer supplied water up to a usable level as well, but that might just be me not knowing how to use it properly :lol:

sliderpro
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Feb 03, 2014 7:30 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by sliderpro »

ru
great to see one of the greatest and most famous modders here, immibis :lol:
I d really like to start playing with your new mod, however at launch game says "cannot load lua script...expected to close at line 495 near enaibled"
need a screenshot or is it just me doing smth wrong?

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by immibis »

FreeER wrote:I recompiled Factorio to allow the io library when getting the listing of data.raw (for the wiki)
Where'd you get the source code? You don't have a "Factorio staff" tag on the forums.
FreeER wrote: edit: hm, maybe I should actually comment on the mod as well? I like it, almost :) Just from looking at it, it seems too cheap, at least without nuclear meltdowns or something...I had issues getting the temperature of the aquifer supplied water up to a usable level as well, but that might just be me not knowing how to use it properly :lol:
-100 is probably too extreme, but it shows off the water manipulation. It means you need about 2.5x as much fuel. 0 or -10 might be better?

I'm not sure how balanced anything is, since I don't really want to start a new game and play through a new game with the mod, because it would take a while.
sliderpro wrote:I d really like to start playing with your new mod, however at launch game says "cannot load lua script...expected to close at line 495 near enaibled"
need a screenshot or is it just me doing smth wrong?
Fixed... and actually made sure it worked this time. It's because I fixed one recipe by adding one line and didn't bother to test it because it's just one line. Oops! :P

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by cube »

immibis wrote:The DLL contains just enough of Lua's code to allow it to create functions that can be called from Lua - it's the most reasonable way to interact with Lua (the interpreter itself, not Lua code), and it only works because you're using an unmodified version of Lua (otherwise the code in iflib wouldn't match the code in the game's Lua interpreter).
Nice :)
FreeEr wrote:Probably the same reason they disabled the io library a while back, mostly pre-emptive security reasons. Though I could be wrong. Honestly I can understand why they wouldn't want it to be available by default, but...there's quite a bit of good that can be done (obviously) using binary modules (if people know how, I unfortunately don't really lol).
Well, partially this. Being sure that installing a mod won't break your computer is a nice thing and this puts us closer to this goal.
But mostly the limitation appeared as a result of the new package infratstructure. I had to rewrite Lua's require function and the increased security was a nice bonus.
immibis wrote:If you disable binary module loading (btw, was that because of this, or something else?) I'll just have to find another way to load arbitrary code :P
There will always be some way to do that, probably not as elegant, though :-)
I have no idea what I'm talking about.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by ssilk »

immibis wrote: If you disable binary module loading (btw, was that because of this, or something else?) I'll just have to find another way to load arbitrary code :P
The devs said this since January, so it's quite sure, that is it not because of this.

And sorry for naive question: When I hear dll, then this means for me, that it doesn't work only under windows?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by SilverWarior »

ssilk wrote:And sorry for naive question: When I hear dll, then this means for me, that it doesn't work only under windows?
DLL is short for Dynamic Link Library.
Dynamic Link Libraries are used on wondows to extend existing programs with aditional functionality but these programs have to be make in such was so that they can import/interface with these dynamic link libraries to make use of them.
Becouse Dynamic Link Libraries contain compiled code they have limitation of not being crosscompatible betwen 32 bit and 64 bit versions. This means that you need to have 32 bit version of DLL for 32 bit version of your application and 64 bit version of DLL for 64 bit version of your application.

So since immibis compiled 64 bit version of DLL it is only compatible with 64 bit version of Factorio.

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by FreeER »

SilverWarior wrote:So since immibis compiled 64 bit version of DLL it is only compatible with 64 bit version of Factorio.
However he did include the source code, so from my understanding someone could compile a 32bit version their self and voila. Also, and I don't have much C++ experience, but I think there is a little Windows specific code there (but only a little) so I believe people could easily compile it on Mac and Linux and send him the binaries to host on the main topic as well, theoretically.
immibis wrote:
FreeER wrote:I recompiled Factorio to allow the io library when getting the listing of data.raw (for the wiki)
Where'd you get the source code? You don't have a "Factorio staff" tag on the forums.
I thought you'd catch that :) the devs did open the source to a few people (7 or 8 people, i'm too lazy to make certain which right this second lol) obviously we can't pass the source on to whoever we like, modify and resell Factorio, etc. etc. though :) If you haven't already done so send them a PM, they've been more than willing to discuss things from my experience. So, we're not 'staff', and I'm not sure if we even have a different icon tbh..., but I am technically a mod on the forums so I could have changed my tag/icon to that (I just prefer the inserter icon, plus I've only really had one issue where being a mod really mattered so far, fortunately)

immibis
Filter Inserter
Filter Inserter
Posts: 303
Joined: Sun Mar 24, 2013 2:25 am
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by immibis »

FreeER wrote:
SilverWarior wrote:So since immibis compiled 64 bit version of DLL it is only compatible with 64 bit version of Factorio.
However he did include the source code, so from my understanding someone could compile a 32bit version their self and voila. Also, and I don't have much C++ experience, but I think there is a little Windows specific code there (but only a little) so I believe people could easily compile it on Mac and Linux and send him the binaries to host on the main topic as well, theoretically.
The Lua code would need changing as well as the DLL. See this:

Code: Select all

local tblbase = ptrreadptr(ptrreadptr(ptrreadptr(ptradd(ptrreadptr(ptrreadptr(ptradd(ptrreadptr(ptradd(ptrnew(r.__self), 16)), 496))), 8))))
local recipeindex = ptrread2(ptradd(r.__self, 0x1A))
return ptradd(tblbase, recipeindex*0x30 + 0x2A)
and this:

Code: Select all

local pEntData = ptrreadptr(ptradd(ent.__self, 24))
local pLiqAmt = ptradd(pEntData, 224)
local pTemp = ptradd(pEntData, 232)
The structure will be the same, but the numbers will be different, in different versions of Factorio.
ssilk wrote:
And sorry for naive question: When I hear dll, then this means for me, that it doesn't work only under windows?
It does work only on Windows. DLLs are a Windows thing. Linux's equivalent are called SOs (or Shared Objects).

Dr0ppy
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Feb 14, 2014 2:46 pm
Contact:

Re: [MOD 0.8.8] iMod - Nuclear power! (64-bit Windows on

Post by Dr0ppy »

WHY but seriously WHY 64bit only? do you only thinb yout 64 bit cause you ahve 64 bit? if so...... i dont even know factorio would turnly support this on 32 bit and i dojt know srsly wahts the difference between 32 and 64 bit? microsoft.. i hate you too

Post Reply

Return to “Mods”