Quote from: Snarky on Sun 06/11/2016 06:59:28
Yeah, that shouldn't be too hard, at least if the animation is blocking, which I assume it is. Let's just add another method to the SpellHandler module:Code: ags static bool SpellHandler::ChantIncantation() { // if(SpellHandler.GetSpell() == eSpellInvalid) return false; // If you uncomment this line, only successful spells will be chanted int i=0; while(i<incantation.Length) { if(incantation.Chars[i] == SIGIL_SUN) { // TODO: Play the audio for this sigil syllable // TODO: Play the animation for this sigil gesture, blocking } else if(incantation.Chars[i] == SIGIL_AIR) { // TODO: Play the audio for this sigil syllable // TODO: Play the animation for this sigil gesture, blocking } // ... and so on i++; } return (SpellHandler.GetSpell() != eSpellInvalid); }
You also need to add an import statement to the header; if you compare the other methods, I'm sure you can see how to do that.
And now you just call this method when the player clicks on the "Invoke" button!
I'm just now getting a chance to experiment with this, and I'm not sure how to add the import statement or where exactly it goes. My best guess was this:
struct SpellHandler {
import static void ClickSigil(GUIControl* bSigil, MouseButton button);
import static void ClearIncantation();
import static Spell GetSpell();
import static void ChantIncantation ();
};
Then I added the code into not the header script section, but the module section of the SpellBook you wrote. When I run the game I get this error which I don't understand:
Spell Book.asc(67): Error (line 67): Size of identifier does not match prototype
Maybe dumb question or I am missing something totally obvious to others, but wondering if there's a specific place in header/module and specific syntax I have to use in order to integrate this last chanting the incantations bit into the SpellBook module?