Magic Dead Zone

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
strangely
Posts: 25
Joined: Mon Oct 29, 2012 2:28 am
Location: Tucson, AZ

Re: Magic Dead Zone

Post by strangely »

Oooh, thank you so much!
hyteria
Posts: 266
Joined: Sat Dec 29, 2012 8:22 pm

Re: Magic Dead Zone

Post by hyteria »

hello ,

dont understand where i m suposed to put this

-- Add the onCastSpell hook and have it run a script called antimagic inside a Lua script entity called checkAntiMagic
cloneObject{
name = "party",
baseObject = "party",

onCastSpell = function(self, spell)
local returnValue = checkAntiMagic.antimagic()
return returnValue
end,
}

i made a party.lua to add it with an entry on init.lua who load it , create the antimagic zone object and add the script lua in game , but game crash when i cast a spell (
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Magic Dead Zone

Post by Komag »

You can just add the cloneObject of the party in your objects.lua

Then in the editor you make a script entity called checkAntiMagic with a function called antimagic() and add whatever code in there you want to check for, such as the party being on a certain level, the party holding a certain item or not, etc, and have it return false whenever you want the party to not cast magic
Finished Dungeons - complete mods to play
hyteria
Posts: 266
Joined: Sat Dec 29, 2012 8:22 pm

Re: Magic Dead Zone

Post by hyteria »

thx komag this work if i put

cloneObject{
name = "party",
baseObject = "party",

onCastSpell = function(self, spell)
local returnValue = checkAntiMagic.antimagic()
return returnValue
end,
}

in the object.lua and remove what i have done in a party.lua :)
Post Reply