• 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.

Crashes when Putting Ability into Hashtable

Status
Not open for further replies.
Hello, I've been having a problem regarding hashtables and that Every Time I try to Save an Ability in the hashtable the World Editor Crashes, I have also had this problem with Unit & Item Pools (Im ok with that as I do not know what a pool is!).

The Problem Occurs when I click the red Text saying Abilities <---Like that. And before I can do anything it just crashes.

So, I'am wondering if anybody else has said problem and if their is a way to fix it.

Thank you.
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
Not each one of the types Blizzard made hashtable functions for are known in GUI. The ability meant there is not the same as the ones in object editor. In fact, object editor objects are represented by an integer id. This was separated in GUI to distinguish their use, so you won't see abilities eg. in the integer dialog and vice-versa. To pseudo-typecast and to not completly change into jass, you can create two variables: one integer, one GUI-ability and do:

  • Set AbilityVar = <yourAbility>
  • Custom script: set udg_IntegerVar = udg_AbilityVar
  • Hashtabelle - Save IntegerVar as <key> of <missionKey> in <table>
"udg_" is the prefix that variables get (in jass form) which you create via the GUI variable window.

  • Set IntegerVar = (Load <key> of <missionKey> from <table>)
  • Custom script: set udg_AbilityVar = udg_IntegerVar
  • Game - Display to (All players) the text: (loaded + (Name of AbilityVar))
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
It crashes because blizzard's GUI designer was retarded (or for some reason was forced into making a poor system) and obviously made poorly maintainable codes/systems. When the patch team came to add the natives, the did what they thought logical and added the ability 1 to GUI.

GUI abilities however are a subset of integers. JASS abilities are some incomplete type blizzard had intended to impliment in some form but did not fully meaning only limited support exists. The GUI references the JASS ability native, which takes an undifined GUI type and causes a fatal error when clicked (cause it trys to load something that does not exist and the code was not made robustly).

The only way around this is like the above poster mentioned, using JASS in some form to manipulate the GUI abilities as the integers they truely are and storing those.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
That is cause abilities and all objects in Warcraft III are identified within the game engine as a 32bit signed (with twos compliment) numbers. This is often shortened to 4 ASCII characters (8 bits each) when being entered which makes up the 4 character raw data value of the ability (view object editor in raw data view to see this code).

GUI obscures this layer from you usually. However, when you save GUI it actually converts it down into integers when you reference object types ('XXXX' where XXXX is the 4 character raw data value of the object).

Because it compiles into JASS which uses integers to represent object types, you can type cast with jass statements to and from GUI abilities and GUI unit types (and all object types). The crash is caused by that action taking the actual ability type rather than the integer ability type GUI means when it says ability.
 
Status
Not open for further replies.
Top