Display Message on Casting
Display Message on Casting
I have successfully blocked the Light spell, but I'd like to produce a little message when casting so the player knows it's been blocked intentionally. I gather I should use hudPrint() to do this (maybe not?) in the onCast section of the new spell definition, but I'm not sure where to insert it. I've tried a few times and got error messages ("nil value") when trying to load up my dungeon. Suggestions?
Re: Display Message on Casting
if casting light is always going to fail, you can just add another line before your return false with hudPrint("spell failed") or whatever you want
Finished Dungeons - complete mods to play
Re: Display Message on Casting
I haven't used a return false, but just changed the spell effect to darkness and made it cost 0 energy. I still seem to be getting a "nil value" error when I put a hudPrint("fail") into the "onCast" section, so I'm guessing that's not where it goes?
Re: Display Message on Casting
Hi Duncan_B,
Post your whole code, we'll probably be able to point the problem!
Post your whole code, we'll probably be able to point the problem!
Re: Display Message on Casting
Ah, see my message in your other thread, better to use the party onCast hook instead of messing with the spell itself, I think
Finished Dungeons - complete mods to play
