• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Spellbook problems

Status
Not open for further replies.
Level 5
Joined
Jul 12, 2013
Messages
128
Hi I have a few questions and one problem.
Questions:
1. Is it possible to add or remove ability from spellbook by triggers ?
2. How to create Blessing of kings ability wich will increase all stats by X %?

I created a spellbook called Blessing spellbook wich contains 3 blessings(auras that affect only hero who learned that blessing). Player can switch between these 3 blessings so only one blessing can be activated in time.

I figured out mechanism that should do the trick. I created 3 dummy spells wich will be in Blessing spellbook. The 3 dummy spells represent blessings. When a dummy spell is activated it will add a spellbook to hero wich contains passive ability(we will call it real blessing) that does the effect of blessing described by dummy spell in Blessing Spellbook. Then the spellbook will be disabled for player so that i can use button slots for other spells and the effect still lasts. When different dummy ability is activated it will at first remove spellbook containing real blessing and then add different spellbook containg different real blessing and then disabling the spellbook.

Here's the trigger:
  • Learn blessing
    • Events
      • Unit - Paladin 0001 <gen> Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Blessing Spellbook (learn dummy)
    • Actions
      • Unit - Remove Blessing Spellbook (learn dummy) from (Triggering unit)
      • Unit - Add Blessing Spellbook (real) to (Triggering unit)
I also figured out the mechanism for leveling up blessings but haven't tried yet because of problem I will describe below. The mechanism for leveling will be when a unit learns a skill equal to Blessing spellbook and the level is 2 it will increment level for all blessings in blessing spellbook.

And you wouldn't expect that but I have problem that dummy spells representing blessings doesn't show up in my blessing spellbook. I don't know how to fix that.

I want to ask you if my thoughts would work. Because of complexity of my system i will upload a map for you if you didn't understand.
 

Attachments

  • spellbook problem.w3x
    13.7 KB · Views: 62
Level 13
Joined
Jul 16, 2012
Messages
679
why you remove the Spell Book in a Dummy?

I have some good way

First Step

  • Untitled Trigger 002
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer TempLoop) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Disable Spell Book for (Player(TempLoop))
Second Step
  • Untitled Trigger 001
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Avatar
    • Actions
      • Set TempUnit = (Triggering unit)
      • Unit - Add Spell Book to TempUnit
If you want to hide Spellbook in TempUnit, You should first disabled the Spellbook first before you add SpellBook in TempUnit
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Adding spells to a spellbook can not be done directly.
However, there is a way.

Spellbooks with the same base order IDs "collide", meaning that they share spells.
Also, if you disable a spellbook through triggers (Player - Disable ability), then the abilities inside it do not get disabled.
Thus, you can combine those 2 bugs to "add" spells to a spellbook.
Just make dummy spellbooks that are disabled through triggers and contain one ability each. The Order ID of the dummy spellbook must be the same that you're adding to.

Check my tutorial for more information. It's all written there.

Second part:
Increasing stats by X% is technically impossible. However, you have some workarounds.
Command aura gives a % increase to damage.
Endurance and unholy aura give a % increase to move speed.
The rest will have to be triggered. For stats, you'll want to use a bonusmod. I found the public bonusmods to not be good enough, so I coded my own. (vJASS)
Note that this code is in vJASS and thus, requires the JNGPE editor to save.

tl;dr - You can't directly make a % increase to stats, but you can trigger it if you're experienced or persistent.
 
Level 5
Joined
Jul 12, 2013
Messages
128
I written above I'll add that spellbooks with one ability and then disable it but it wasn't the real problem. It wasn't the real problem because i didn't even get to that point because of the real problem wich is that i can't see dummy abilities inside Blessing spellbook and I don't know why.
 
Level 5
Joined
Jul 12, 2013
Messages
128
well I changed the minimum to 11 and maximu to 11 but still no result. I will explain it again. I have an ability Blessing spellbook(learn, dummy) wich isn't in fact spellbook it is a custom ability based on channel. I triggered that when my hero learns the Blessing spellbook(dummy, learn) it will remove it from him and give him instead a real blessing spellbook containing dummy abilities representing each blessing. But that dummy abilities representing blessings doesn't show up in real Blessing Spellbook and I don't know why.
 
Last edited:
Level 5
Joined
Jul 12, 2013
Messages
128
Well, I don't see any property in object editor called Visible, I eve created new spell based on channel and still haven't found it.
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
If not channel, what is your ability based on originally then?

To toggle "Visible" in the channel spell, Double click the Options (it should look like "Data - Options None" By default) and you'll see a box with Visible, Targeting Image, Physical Spell, Universal, Unique Cast. Check the Visible option then try if your can see your spell ingame.

EDIT: Yea, what Xonok said.
 
Level 5
Joined
Jul 12, 2013
Messages
128
So I did what you said and now i can see the dummy abilities inside Blessing spellbook but now I have a new problem. When I cast the Blessing of Wisdom(dummy) or Blessing of Might(dummy) The game freezes and after a few seconds crashes. When I cast Blessing of Kings the came doesn't freeze but my hero do spell animation over and over and also I can't control him anymore, maybe it doesn't crashes because I haven't added any abilities to Blessing of Kings(Spellbook).
I also changed the triggers because i've read in this tutorial http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/theory-behind-spellbooks-228604/ that when a spellbook is removed all other spellbooks with same base order ID are removed so I remove only one blessing of [whatever](spellbook) and other should dissappear aswell.

Trigger:
  • Cast Wisdom
    • Events
      • Unit - Paladin 0001 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Blessing of Wisdom (dummy)
    • Actions
      • Unit - Remove Blessing of Kings (spellbook) from (Triggering unit)
      • Unit - Add Blessing of Wisdom (spellbook) to (Triggering unit)
      • Player - Disable Blessing of Wisdom (spellbook) for Player 1 (Red)
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
So I did what you said and now i can see the dummy abilities inside Blessing spellbook but now I have a new problem. When I cast the Blessing of Wisdom(dummy) or Blessing of Might(dummy) The game freezes and after a few seconds crashes. When I cast Blessing of Kings the came doesn't freeze but my hero do spell animation over and over and also I can't control him anymore, maybe it doesn't crashes because I haven't added any abilities to Blessing of Kings(Spellbook).
I also changed the triggers because i've read in this tutorial http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/theory-behind-spellbooks-228604/ that when a spellbook is removed all other spellbooks with same base order ID are removed so I remove only one blessing of [whatever](spellbook) and other should dissappear aswell.

Trigger:
  • Cast Wisdom
    • Events
      • Unit - Paladin 0001 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Blessing of Wisdom (dummy)
    • Actions
      • Unit - Remove Blessing of Kings (spellbook) from (Triggering unit)
      • Unit - Add Blessing of Wisdom (spellbook) to (Triggering unit)
      • Player - Disable Blessing of Wisdom (spellbook) for Player 1 (Red)

What are your abilities based on? If channel, then you should probably set follow through time to 0 and disable other abilities to false.

Also, I have not actually confirmed if all spellbooks with the same ID get removed. It's also a possibility that all abilities inside those spellbooks are removed and the spellbooks themselves are not. In any case, it would be nice if you could confirm.

Abilities should run off of the "Starts the effect of an ability" event, because otherwise you can avoid cooldowns and mana costs.
 
Level 5
Joined
Jul 12, 2013
Messages
128
I can't confirm that if I remove a spellbook by triggers all spellbooks with same base order ID are going to be removed too.
I finally fixed dummy abilities. They are shown ingame now and I'm using this trigger to switch between all 3 blessings and it seems working.

  • Cast Wisdom
    • Events
      • Unit - Paladin 0001 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Blessing of Wisdom (dummy)
    • Actions
      • Unit - Remove Blessing of Might (spellbook) from (Triggering unit)
      • Unit - Remove Blessing of Kings (spellbook) from (Triggering unit)
      • Unit - Add Blessing of Wisdom (spellbook) to (Triggering unit)
      • Player - Disable Blessing of Wisdom (spellbook) for Player 1 (Red)
But I have other problem I want my blessings to have 4 levels but I won't level up them manually instead I will only learn Blessing Spellbook(dummy learn) and then use triggers to manually increase the level of Blessings (real) I'm using this trigger and it doesn't work

  • Level up
    • Events
      • Unit - Paladin 0001 <gen> Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Blessing Spellbook (learn dummy)
      • (Level of Blessing Spellbook (learn dummy) for (Triggering unit)) Greater than 1
    • Actions
      • Unit - Remove Blessing Spellbook (learn dummy) from (Triggering unit)
      • Unit - Increase level of Blessing of Might (real) for (Triggering unit)
      • Unit - Increase level of Blessing of Wisdom (real) for (Triggering unit)
Maybe that's because the player may not have Blessing active and then the engine have nothing to level up. So is it possible to increase level of ability wich infact isn't on unit but when will be given it will have increased level ? And if there's no solution for that the best way is to create separate abilities named rank1,rank2,rank3 etc. ?
 
Last edited:
Level 21
Joined
Mar 27, 2012
Messages
3,232
You can use engineering upgrade to switch abilities around and thus, disable them. That way you do have to trigger the level increase for twice the amount of abilities (the ability itself and its non-working twin), but you will also achieve that a blessing is on the unit, while still being disabled. This also preservers cooldowns if there are any.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Engineering upgrade is basically an ability that swaps other abilities around. The swapped abilities should be similar or they will bug, but otherwise there is no problem.
You can check the tinker hero for that. (Yes, it's a hero ability, but that can be changed)
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Basically that you have all the blessings all the time (in a spellbook or not, doesn't matter). You also have 1 engineering upgrade ability for each, that replaces with an ability that does nothing. Whenever you add one of those engineering upgrade abilities you disable a blessing. Whenever you remove it, the blessing enables again.
 
Level 5
Joined
Jul 12, 2013
Messages
128
So did I understand you right?

When a Blessing Spellbook (dummy, learn) is learnt it will be removed and then Blessing Spellbook(real) containing Blessing of Might(real), Blessing of Wisdom(real), some passive abilities that will do effects of Blessing of Kings and also 3 dummy abilities for each blessing.

When a Blessing of Might(dummy) is cast then Engineering upgrades for blessing of Wisdom and some passive abilities wich will do effects of Blessing of Kings will be added to hero. The engeneering upgrade for each ability will replace real passive abilities with an ability that does nothing and at the same moment remove engineering upgrade from Blessing of Might(real).

When a unit learns a Blessing Spellbook(dummy, learn) and it's level is greater than 1 then it will increase level of Blessing of Wisdom(real),Blessing of Might(real) and ome passive abilities doing effects of Blessing of Kings.

So the point of engineering upgrade is that you can increase level of an ability with triggers that has been engineering upgraded? You meant it like this? Because it took me some time to figure out this mechanism.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
So did I understand you right?

When a Blessing Spellbook (dummy, learn) is learnt it will be removed and then Blessing Spellbook(real) containing Blessing of Might(real), Blessing of Wisdom(real), some passive abilities that will do effects of Blessing of Kings and also 3 dummy abilities for each blessing.

When a Blessing of Might(dummy) is cast then Engineering upgrades for blessing of Wisdom and some passive abilities wich will do effects of Blessing of Kings will be added to hero. The engeneering upgrade for each ability will replace real passive abilities with an ability that does nothing and at the same moment remove engineering upgrade from Blessing of Might(real).

When a unit learns a Blessing Spellbook(dummy, learn) and it's level is greater than 1 then it will increase level of Blessing of Wisdom(real),Blessing of Might(real) and ome passive abilities doing effects of Blessing of Kings.

So the point of engineering upgrade is that you can increase level of an ability with triggers that has been engineering upgraded? You meant it like this? Because it took me some time to figure out this mechanism.

I'm having trouble with understanding what you said.
Basically engineering upgrade swaps 2 abilities around without interrupting cooldowns and without messing with their levels in case of hero abilities.

The only abilities that you'll have to add/remove through triggers are all based on engineering upgrade.
 
Level 5
Joined
Jul 12, 2013
Messages
128
well, I thought that ingineering upgrade is a passive ability, wich means it can't be cast, just learnt. My system would use dummy abilities wich when cast it will give a hero ingineering upgrade wich will swap real blessing with blank ability that does nothing.
 
Status
Not open for further replies.
Top