• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spellbook Ability System questions :D

Status
Not open for further replies.
Level 6
Joined
May 20, 2010
Messages
274
ok so I'm planning on using a Spellbook for spells in my map because it can store more spells than the normal 7-only-spells....and i got two questions:


1.Is it possible to save all of the abilities in the spellbook using a save system? (to be specific Nestharus' Encoder since i want to use it :ogre_haosis:) and if yes, how?


2.Is it also possible to..... for example: you bought an ability from a skillshop then it will be in your spellbook..i need it like everytime you buy an ability, it will be in a spellbook but it will have a specific shorcut key according to its position in the spellbook...something like if you buy this "skill 1" first before "skill 2" then "skill 1" will have a shorcut key "Q" while "skill 2" will have shorcut key "W" BUT if you bought "skill 2" FIRST, then its shorcut key will be "Q" while "Skill 1" will be "W"..you got me right? Is That possible? and if it is..HOw?


Thanks for reading this and answering me...i mean pls answer me :ogre_haosis::ogre_haosis::ogre_haosis:
 
Level 6
Joined
Jul 22, 2009
Messages
214
1) Just a fact like this, 80% players hate spell book, for my opinion using more than one spell book may ruin the map. It's probably possible to save the spell, there is already done in Gaia Reteliation.

2) The only solution for this is to create a version of each spell with each shurcut. It's mean you have your spell with Q as Shorcut, another with W, a third with E... if you want to use for example 8 spell in each spellbook, it's mean you will have to create 8 time the same spell with different shortcut, after add the one you need via trigger. You will have to track how many spell you already have bought.
 
1) possible

2) possible, but you can't do the hotkey thing

edit
if you have a spellbook B that is disabled and a spellbook A that is enabled and you add spellbook B to a hero, the spells inside of it will be added to spellbook A. Try it out for yourself.

Spells, like anything else, can be saved. You make a catalog and figure out which spells are on a hero. As you add spells to a hero, you need to store them in some sort of list so that you know which abilities need to be saved later on. I actually suggest a stack since it doesn't sound like you'll ever be removing them.
 
Level 6
Joined
May 20, 2010
Messages
274
because if a spellbook is opened, you cannot use the command hotkeys... you can still use smart commands (right-click) but for things like patrol or for people who likes using "A" for attack, you need to close the book first...

oh so that's their problem ...i already got a solution :ogre_hurrhurr:

EDIT: and thanks Nestharus i'll read that

ANOTHER EDIT: oh i got another question pls answer me...i saw the abilities catalog in the save system and i found out that the catalog is arrange by the heroes.... but is it possible to make a catalog like for example...in my map every hero can have different classes even hybrids so i dont have a specific class for each hero SO anyone can learn the abilities of each and every classes as long as its 11 abilities ....is that possible to be saved??
 
Last edited:
Yea... the abilities were only arranged by heroes in that case because I wanted to show how to do hero specific abilities.

If the range of abilities is 0-11 abilities, then the best way to do it is to link them up (if an ability exists, it connects to the next ability). This way only the abilities that actually exist will be saved into the code, the rest will be ignored =).
 
JASS:
//rather than connecting abilities to abilities while they exist or adding ability 11 times, let's
//string 11 together so that only a max of 11 are saved and a min of 1 are saved
//call ability.link(1,AbilityCatalog.count,ability,1) would link all abilities while they exist
//but it would save a min of 1 and max of 12 (max abils + 1)
local CodeRange ability = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability2 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability3 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability4 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability5 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability6 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability7 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability8 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability9 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability10 = CodeRange.create(0, AbilityCatalog.count)
local CodeRange ability11 = CodeRange.create(0, AbilityCatalog.count)
call ability.link(1,AbilityCatalog.count,ability2,1)
call ability.link2(1,AbilityCatalog.count,ability3,1)
call ability.link3(1,AbilityCatalog.count,ability4,1)
call ability.link4(1,AbilityCatalog.count,ability5,1)
call ability.link5(1,AbilityCatalog.count,ability6,1)
call ability.link6(1,AbilityCatalog.count,ability7,1)
call ability.link7(1,AbilityCatalog.count,ability8,1)
call ability.link8(1,AbilityCatalog.count,ability9,1)
call ability.link9(1,AbilityCatalog.count,ability10,1)
call ability.link10(1,AbilityCatalog.count,ability11,1)
call encoder.add(ability)

From here, loop through abillities until you are out. Terminate with a 0 if you didn't write all 11.

Read abilities until you've read a 0 or you read all 11.

But yes, this would also work, although it wouldn't be as good
call ability.link(1,AbilityCatalog.count,ability,1)

What that would do is continue to write in/read out abilities until it encounters a 0. Useful for saving armies or w/e, but since you have a def known number of abilities, you don't want to use this =P.
 
Level 6
Joined
May 20, 2010
Messages
274
huh? i dont really get it....yeah i don't what do you mean? linking them? which means what? uhhm... ok in case we didn't understand each other clearly i say that my map is an orpg and you have no definite class So you can have your own combinations of skills..its like there is some mage guild fighter guild or whatsoever...so you can be straight fighter and get all 11 abilities of a fighter so lets say your a pure fighter npw..BUT you can also lets say..be a Hybrid Fighter so you can have a mixture of.. maybe 6 fighter abilities and some 5 more mage abilities..so you're either a mage or a fighter...so uhm.. i don't understand the "link" thing..i don't really understand what you've just sampled and explained T_T help me pls T_T
 
Status
Not open for further replies.
Top