Help combining two mods

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Help combining two mods

Post by TheSAguy »

Hi,

I'm trying to combine my mod with FreeER's mind control mod.
I'm getting an error on line 72 of my control file and can't seem to get it resolved.

I've attached both my mod and a working version of the Mind Control mod.
Could someone please take a look at this and let me know what I'm missing?

EDIT: Files removed.

Thanks!
Last edited by TheSAguy on Wed Jun 24, 2015 4:52 pm, edited 1 time in total.
User avatar
semvoz
Inserter
Inserter
Posts: 30
Joined: Wed Jun 17, 2015 12:03 pm
Contact:

Re: Help combining two mods

Post by semvoz »

You might want provide us with the error you are getting too :)
User avatar
semvoz
Inserter
Inserter
Posts: 30
Joined: Wed Jun 17, 2015 12:03 pm
Contact:

Re: Help combining two mods

Post by semvoz »

semvoz wrote:You might want provide us with the error you are getting too :)
Actually, no need for it, just checking you code I think I got it:

Code: Select all

function OnBuilt(entity)
   -- Temple has been built
   if entity.name == "templev2" then
      glob.numTemples = glob.numTemples + 1
      
      glob.factormultiplier = GetFactorPerTemple(glob.numTemples)
	  game.player.print("The the number of temples currently: " .. glob.numTemples) -- Debug
   end
   --- Mind Control Built
    if event.createdentity.name == "MBeacon" then
		table.insert(glob.beacons, event.createdentity)
	end
   
end
You are passing to your onBuild function an entity object (I guess?), but at line 72:

Code: Select all

if event.createdentity.name == "MBeacon" then
You are checking a condition against an event which you don't have.
So, I am guessing you are getting something related to a call to 'nil' or something similar.

If you change line 72 into:

Code: Select all

if entity.name == "MBeacon" then
It should work better.
We you might still get an error, but it should be different :)
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Help combining two mods

Post by TheSAguy »

Thanks semvoz,
After changing what you said and removing some other "event"'s I think I have it working.
Last edited by TheSAguy on Wed Jun 24, 2015 4:52 pm, edited 1 time in total.
User avatar
semvoz
Inserter
Inserter
Posts: 30
Joined: Wed Jun 17, 2015 12:03 pm
Contact:

Re: Help combining two mods

Post by semvoz »

:)
Post Reply

Return to “Modding help”