Spell Book Array Help

dabum

New Member
Reaction score
0
Alright, what I'm looking for is a way to put the IDs of abilities in a spell book into an ability array. Reason being is that the abilities in the spell book are not in there by default. Instead I have them added into the book through triggers.

Basically I'm trying to find a way to get #3 on the list to work:

1) Spell Book is empty - Done
2) Add Spells into Spell Book Through Trigger (Spells X, Y, & Z) - Done
3) Run some trigger/loop that retrieves ID's (Rawcodes) of Abilities in Spell Book & store them into an array. (Eg. In the array would be Spells X, Y, & Z)

Note that I don't need help on making spell books, so please refrain from spamming me link(s) on such tutorials. However any help pertaining my problem would be appreciated.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
i dont really get what your problem is.
a spellbook can only contain abilities you are putting inside as far as i know that means you know what abilities you haveto check are learned or not.

and i only know of 2 ways of adding abilities to a spellbook, 1). disable the abilities by default and enable them to add or 2). add new disabled spellbooks with the abilities you want to add to the hero.

no matter which way, you should always know which abilities are inside or not by yourself.
 

dabum

New Member
Reaction score
0
Right I add disabled spellbooks to an empty spellbook to get the ability to show up. Now my problem is, and i specifically stated it, to store the abilities IN the spellbook into an array. Meaning I would run some trigger of some sort to grab the abilities FROM the spellbook and into an array. I don't see how I can be more specific seeing as how I gave an example of what I am trying to do in the first post.

Edit: It's similar to storing the Learned abilities of a hero into an array for a save code. But in my case I want it to store the abilities in the spellbook (abilities which are added through triggers/disabled spellbooks) into an array.
 

hgkjfhfdsj

Active Member
Reaction score
55
you could try storing the abilities in a 2d array before/after you enable the spell that you added to the spellbook. for example you can use hashtables, 0 being the total number then 1,2,3 onwards for the spells. storing an ability would look something like
Trigger:
  • Action
    • Enable <Spellbook Ability> for Triggering Player//adding spells to spellbook etc
    • set count = LoadInt(Hashtable, <Spellbook Id>, 0)
    • SaveInt(Hashtable, <Spellbook Id>, 0, count + 1)
    • SaveInt(Hashtable, <Spellbook Id>, <Spellbook Ability Id>, count + 1)//forgot the GUI syntax
    • //retrieving
    • set ability = LoadInt(Hashtable, <Spellbook Id>, count) //top index


or for a nicer number you could use this.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
just show us the trigger in which you add the abilities to the spellbook, you have to store them into an array inside of that trigger of course.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top