[Trigger] Weird unit hashtable save/load

Status
Not open for further replies.
Level 2
Joined
May 17, 2015
Messages
10
Hello,
I'm having a bit of a trouble with a specific part of a charge trigger.

Let me explain the issue here.

In trigger "Rush cast" I'm saving this:
Hashtable - Save Handle Of(Target unit of ability being cast) as 0 of (Key (Casting unit)) in ht_charge

And in trigger "Rush loop" I'm loading this:
Set charge_target_unit = (Load 0 of (Key (Picked unit)) in ht_charge)

Casting unit (First line) and Picked unit (Second line) are definitely the same unit, because...
I'm saving the casting unit to a charge group and it's being iterated and moved.

But the position it's moving towards is the center of the map, meaning it cannot load the position of charge_target_unit, which I understand would be a null.

But I'm not sure why would it not load the proper unit handle when the keys should be the same.

Rush Cast
rush cast.png


Rush loop
rush loop.png


Not sure if you guys could help me figure this out?

Thanks.
 
Level 18
Joined
Oct 17, 2012
Messages
839
Target unit of ability cast = null would explain the issue. Can you provide the specs of your custom ability? Is it single target or target point? How are you casting the ability?

Show the trigger where you create the hashtable.
 
Last edited:
Level 2
Joined
May 17, 2015
Messages
10
Target unit of ability cast = null would explain the issue. Can you provide the specs of your custom ability? Is it single target or target point? How are you casting the ability?

Show the trigger where you create the hashtable.

I only create it in the variable manager, did not create it in a trigger.

It has no initial value.

variables.png


EDIT: Ok, I just did this. I created a Hashtable in map init now, and asigned the variable to it.

I had assumed that the variable was initialized empty, but it seems it is created pointing to a null value. Initializing the variable worked.

Thanks for your help.

upload_2020-8-11_15-51-42.png
 

Attachments

  • upload_2020-8-11_15-51-19.png
    upload_2020-8-11_15-51-19.png
    62 KB · Views: 24
  • upload_2020-8-11_15-51-32.png
    upload_2020-8-11_15-51-32.png
    329.6 KB · Views: 22
Status
Not open for further replies.
Top