• 🏆 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!

Weird bug with the Trigger Editor...

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hello! I have a problem making an action in GUI. However, the problem is not in me but in the WE. :xxd:
After i click this action :
Hashtable - Save Handle Of Ability as Value of Value in (Last created hashtable)
if i click on "Ability" the Trigger Editor crashes (clicking on the other red stuff doesn't crash) and i can't do anything in it anymore. However, other Editors, pallets and the WE it's self don't crash. How do i fix this? I don't have this problem when saving something else, not Abilities.
I also tried closing my map and opening a brand new. The problem occured again.

Is there a Jass script i can replace this action with?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,208
This is because the ability type was never implemented properly. It is only a loose reference to the internal structures used to represent an ability with no useful functions. As GUI never had components for interacting with abiliites it will crash the editor due to an invalid refererence.

This was because the makers of WarCraft III were stupid and did not explain what they did. When the patch team (who did not make WarCraft III) added hashtables they added to GUI one for interacting with abilities when GUI never had the ability type supported. The ability type that GUI presents users with is actually a subtype of integer (it compiles directly to integer), not the actual jass ability type which is where the confusion started.

Thus what you want to do is save an integer. You will need to save the ability raw type as the integer.

The first custom ability is usually refered to as the integer 'A000' for example. When you choose Strom Bolt as an ability type in GUI it simply puts such a integer for that parameter. The actual JASS ability type is virtually usless, and the GUI hashtable action trys to refer to that.
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hm.. can you give me an example of how to save an ability and then load it?

EDIT : I wanted to store an ability so that i can use it in a condition which is not possible. So... this thread can be closed. Thanks for the help! :)
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • Set Ability = Animate Dead
  • Custom script: udg_Integer = udg_Ability
Then save that integer to a hashtable.
To load, simply load the integer.

Example;
  • Save
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_Hashtable = InitHashtable()
      • Set Ability = Flame Strike
      • Custom script: set udg_Integer = udg_Ability
      • Set Value = 100
      • Hashtable - Save Value as 0 of Integer in Hashtable
      • Set Ability = Banish
      • Custom script: set udg_Integer = udg_Ability
      • Set Value = 200
      • Hashtable - Save Value as 0 of Integer in Hashtable
      • Set Ability = Siphon Mana
      • Custom script: set udg_Integer = udg_Ability
      • Set Value = 300
      • Hashtable - Save Value as 0 of Integer in Hashtable
  • Load
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Ability = (Ability being cast)
      • Custom script: set udg_Integer = udg_Ability
      • Set Value = (Load 0 of Integer from Hashtable)
      • Game - Display to (All players) the text: (String(Value))
What I did there is saving an Integer value to the respected abilities.
And upon cast, it loads the value and show it as Game Message to see if it actually works, and it is.
 
Last edited:
Status
Not open for further replies.
Top