• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Spellbook disables ability to update tooltips?

Status
Not open for further replies.
Level 3
Joined
Mar 12, 2010
Messages
8
Hello guys!

I'm pretty sure there are some who already had the same problem establishing a similar system.
I want to make a system of buildings that sell abilities that can be learnt and skilled by heroes without any other unit.

For this purpose I use spellbooks. Each contains one upgrade-skill that upgrades itself and the ability it has to upgrade.

Here is the problem I have: If I increase the level of an ability which is inside a spellbook by setting its level to [its level + 1], the tooltips of the abilities that are inside a spellbook don't update.
(How) is it possible to update these tooltips?

As I use the ability "charge gold and lumber" to make the player pay for each skill, I have to detect what order-string the ability causes to make it work.
(How) Is it possible to detect which of these abilities is cast in an easier way?

Thanks for your help!
 
Level 3
Joined
Jul 16, 2014
Messages
63
I'm a bit confused.. Just to see if I understood this right.. you have an upgrade ability for every other ability? like this
Spell1 has UpgradeSpell1
Spell 2 has UpgradeSpell2
Spell3 has UpgradeSpell3?

Is it just the tooltip that doesn't change, or does the ability that is supposed to level up, stay at the same level?

As I use the ability "charge gold and lumber" to make the player pay for each skill, I have to detect what order-string the ability causes to make it work.
(How) Is it possible to detect which of these abilities is cast in an easier way?

I don't quite understand what you mean by this. But you should post the code or the triggers you're using for this.
 
Level 3
Joined
Mar 12, 2010
Messages
8
I'm a bit confused.. Just to see if I understood this right.. you have an upgrade ability for every other ability? like this
Spell1 has UpgradeSpell1
Spell 2 has UpgradeSpell2
Spell3 has UpgradeSpell3?
That's right. The Spell itself shall be added directly to the hero (when the first level of the upgrade spell is cast) and the upgrade spell shall be contained by a spellbook.

Is it just the tooltip that doesn't change, or does the ability that is supposed to level up, stay at the same level?
It tried to make this with the ability "attribute-bonus" and it seems the upgrade ability upgrades both abilities correctly. It' really just the tooltip that doesn't change.

I don't quite understand what you mean by this. But you should post the code or the triggers you're using for this.
The upgrade ability is the ability "charge gold and lumber". That means every time the ability is cast it takes away x gold and y lumber from the player. This makes it possible to use lumber as skill points and to make a level of an ability cost more or less "skill points" (=lumber). (I only use lumber as skill points that's why I don't mention gold for that purpose anymore.)
So, if I cast this spell from such a spellbook (which I in fact use as a skillbook), this casting process won't be detected by "Unit - Unit starts to cast" (I'm sorry, I installed the WE in another language so I have to translate some parts from triggers) so I replaced it by "Unit - A unit receives an order without a target" and checked in the condition for the order-string.

Here is what it looks like:
  • Upgrade Strength
    • Events
      • Unit - A unit receives an order without a target
    • Conditions
      • (String((Issued order))) Equals nagabuild
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • (Level of Strength-Bonus [train] for (Triggering unit)) Equals 100
        • 'THEN'-Actions
          • Unit - Set level of Strength-Bonus [hold] for (Triggering unit) to 100
          • Unit - Remove Strength-Bonus [train] from (Triggering unit)
        • 'ELSE'-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (Level of Strength-Bonus [train] for (Triggering unit)) Equal 1
            • 'THEN'-Actions
              • Unit - Add Bonus-Attributes [hold str] to (Triggering unit)
              • Player - Deactivate Bonus-Attributes [hold str] for (Owner of (Triggering unit))
              • Unit - Set level of Strength-Bonus [train] for (Triggering unit) to 2
            • 'ELSE'-Actions
              • Unit - Set level of Strength-Bonus [hold] for (Triggering unit) to (Level of Strength-Bonus [train] for (Triggering unit))
              • Unit - Set level of Strength-Bonus [train] for (Triggering unit) to ((Level of Strength-Bonus [train] for (Triggering unit)) + 1)
Note A: I skipped the part where the hero gets the item which gives him/her the upgrade ability because every hero in this map shall have this opportunity to increase hies/her stats with "skill-lumber" ;) . Just think of it as if the spellbook-ability that contains the upgrade ability has been given to the hero by the object editor.
Note B: Here is a short explanation of the variables used:
Strength-Bonus [train] - This is the upgrade ability.
Strength-Bonus [hold] - This is the actual ability.
(In this case it's like "attribute-bonus")
Bonus-Attributes [train str] - This is the spellbook that contains Strength-Bonus [train]*
Bonus-Attributes [hold str] - This is the spellbook that contains Strength-Bonus [hold]**

* This ability doesn't appear in the trigger because it's given by the object editor.
** This ability is added because I wanted to have the button for the passive ability beeing seen in the spellbook where you can train the attributes. For the other abilities that the hero will learn I won't make spellbooks because these abilities will be accessable in the same menu in which "attack" and the other buttons are.
 
Level 3
Joined
Jul 16, 2014
Messages
63
Hmm..

Can you upload the map somewhere and send the DL link to me as PM, then I'll take a deeper look at it and hopefully find what is causing this :)
 
Level 3
Joined
Mar 12, 2010
Messages
8
Additional information-source: the map

Thanks for helping me solving this problem!

To this post I attached the map that contains the system. Don't wonder what the "Huntsman Salvation" ability is used for it currently has no functionality but shall soon be able to work. I'll do this after this problem is solved. ;)
 

Attachments

  • SkillSystem Testmap.w3x
    169.6 KB · Views: 40
Status
Not open for further replies.
Top