Difference between revisions of "Scripting Tutorial: Spell Tome"

no edit summary
imported>Grosie
m (→‎Putting it all together: spelling correction)
imported>Grosie
Line 112: Line 112:
==Extra==
==Extra==
===Problems===
===Problems===
The [[GameMode]] block will not execute when the menus are opened. The best way around it would be to automatically give the player the spell (as the [[OnActivate]] block does run in menus), however, I wanted to show how to use a [[MessageBox]] in this context.
The [[GameMode]] block will not execute when the menus are opened. The best way around it would be to automatically give the player the spell (as the [[OnActivate]] block does run in menus), however, I wanted to show how to use a [[MessageBox]] in this context. You could instead use the [[MenuMode]] Blocktype, which does run in menus (hence the name) - simple replace:
begin GameMode
with:
begin MenuMode


The script doesn't take into account whether the player has the spell already or not, this could be changed by instead of using the 'doonce' variable, checking if the player has the spell.
The script doesn't take into account whether the player has the spell already or not, this could be changed by instead of using the 'doonce' variable, checking if the player has the spell.
Anonymous user