Are there any hidden problems with this?

Weep

Godspeed to the sound of the pounding
Reaction score
400
The freez is most likely because of the first add of each ability (preload), but be happy, it won't freez later in game if you plan to add these abilities during the game :thup:

Also you shouldn't notice the freez if you use the 'event' map initialization , right ?
No, I mean, the game hangs fatally and requires termination. This is during init (the progress bar)...

It only happened if I attempted to find rawcodes from 'A000' to 'A000'+X, as in, it froze when trying 150 rawcodes, but not 50... I guess somewhere in the first 150 or so rawcodes there is a hidden game ability it doesn't want you to add to a unit, like 'Amov'?

But i've just realized that if you don't care about this preload thing, and don't use custom rawcode, the first solution is just better.
I think I'll stay with that, then. :D Thanks for the feedback.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
No, I mean, the game hangs fatally and requires termination. This is during init (the progress bar)...
Man it's a crash, not a freez, call a cat, a cat, not a dog :D

It only happened if I attempted to find rawcodes from 'A000' to 'A000'+X, as in, it froze when trying 150 rawcodes, but not 50... I guess somewhere in the first 150 or so rawcodes there is a hidden game ability it doesn't want you to add to a unit, like 'Amov'?

If you don't use custom rawcodes there is no way you have a such case.
I've tried many times to scan all abilities owned by an unit, and all the the abilities follow the rule 'xxxx' where x is a letter.

[del]I can also certify that UnitAddability is perfectly safe, so i suppose if your code is valid , then it's because UnitRemoveAbility.[/del]
EDIT : Hmm no, i don't remember if i checked the level of an ability instead, which is a better way anyway.
Indeed you try to remove the ability even if the unit hasn't, which i had never try.
Since you have already the code, it would be cool if you do the improvement that i have suggested before, then if the map doesn't crash anymore, you have your answer.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
[del]I can also certify that UnitAddability is perfectly safe, so i suppose if your code is valid , then it's because UnitRemoveAbility.[/del]
Well, I have narrowed it down.

This code crashes the game in my map:
JASS:
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
	local integer index = 'A00b'
	local unit u = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'hfoo', 0, 0, 0)
	call UnitAddAbility(u, index)
	call RemoveUnit(u)
	set u = null
endfunction

There is no ability with the rawcode 'A00b' in the map, and adding any rawcode from 'A000' to 'A00a' does not crash. [lJASS]GetObjectName('A00b')[/lJASS] is null. What's strange is that it does not crash in other maps.

[edit] 'A00c' also crashes. 'A00d' does not. 'A00e' does. 'A00f' through 'A00i' do not, and I stopped testing. None of those are rawcodes of any ability, unit, or buff.

'A00b' does not crash after deleting a particular ability, 'A00B' which is a hero ability based on Item Anti-Magic Shield. Adding 'A00B' itself does not crash.
'A00c' does not crash after deleting 'A00C', a hero ability based on Channel. Adding 'A00C' itself does not crash.

I don't see a pattern indicating what abilities cause their lowercase "equivalents" to crash the game.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top