Difference between revisions of "Scripting Tutorial: Spell Tome"

no edit summary
imported>Grosie
m (spelling correction)
imported>Vladimort
Line 118: Line 118:


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.
==Book==
If you want the book to open so you can read it, it's simple enough just type Activate after the OnActivate
<pre>
begin onActivate
  Activate
  if doonce == 0 ;has the player already learnt the spell?
      ;ask the player if they would like the spell
      MessageBox "Would you like to learn the Spell of Frost Damage?", "Yes please", "No way, maybe later"
      set doonce to 1 ;Don't ask them again
      set buttonpressed to 1 ;tell the script to check what the player answered
  else
      ;Tell the player that they have got the spell already.
      Message "You have already learned what you can from this Tome"
  endif
end
</pre>
Now you will be able to read the book.


===Homework===
===Homework===
Anonymous user