Page 1 of 1

Help combining two mods

Posted: Wed Jun 24, 2015 2:24 am
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!

Re: Help combining two mods

Posted: Wed Jun 24, 2015 3:09 am
by semvoz
You might want provide us with the error you are getting too :)

Re: Help combining two mods

Posted: Wed Jun 24, 2015 3:28 am
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 :)

Re: Help combining two mods

Posted: Wed Jun 24, 2015 5:17 am
by TheSAguy
Thanks semvoz,
After changing what you said and removing some other "event"'s I think I have it working.

Re: Help combining two mods

Posted: Wed Jun 24, 2015 5:21 am
by semvoz
:)