Hashtables & Leap/Knockback/Slide

Jinxx

New Member
Reaction score
4
If I understand it correctly, with the new patch we don't need helpers like CSCache and Katana's Variable system anymore, since we have hashtables which can store position, right?

I've tried messing around with them, but I can't get my spells to work. Try as I might, I can't find a good, indepth tutorial since most of them assume the reader already has a large amount of prior knowledge about vJASS.

If someone could link a finished JASS (not vJASS, just regular JASS!) spell with Leap/Slide/Knockback, or a tutorial explaining step by step how to make such a spell, I'd be really grateful! :thup:
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
There's not much written for regular JASS, but if you can follow this tutorial about using hashtables for knockback in GUI, you should be able to apply the principles in JASS.
 

G00dG4m3

New Member
Reaction score
1
Try this as an example. It is quite messy, but I made it by learning GUI-MUI spells with Hashtables. I think this is much easier than using Indexing.
 

Curo

Why am I still playing this game...?
Reaction score
109
Try the JASS forum. I know how to do it in GUI, but not JASS.
 

Jinxx

New Member
Reaction score
4
There's not much written for regular JASS, but if you can follow this tutorial about using hashtables for knockback in GUI, you should be able to apply the principles in JASS.

Thanks Weep, this will come in handy! :thup:


Try this as an example. It is quite messy, but I made it by learning GUI-MUI spells with Hashtables. I think this is much easier than using Indexing.

Still trying to make heads and tails of it, but you're right, some useful info there, thx for posting it.


Try the JASS forum. I know how to do it in GUI, but not JASS.

Well, could you post a sample leap spell in GUI? Since I'm working with regular JASS, converting it to custom script is easy and fast.
 

Curo

Why am I still playing this game...?
Reaction score
109
I won't make the triggers for you, but I'll tell you how. It requires 3 triggers. Also if I didn't go in depth enough for you, here is the page I learned hashtables from. It gives a detailed explanation of how to create a knockback.

First off, at map initialization, create a hashtable and assign it to a variable.

The basic concept is to have your leap/knockback spell add the target unit to a unitgroup when the spell is cast. Additionally, you want to save to your hashtable some values such as the duration and angle of the knockback.

The third element is a periodic trigger (such as every 0.04 sec of game time). What this trigger does is pick all units in the unitgroup and applies the leap/knockback actions to them. Such actions include finding the position of each unit, setting a new destination position with polar offset (angle loaded from the hashtable), moving each unit to their new destination point, and updating the remaining leap/knockback time (duration - 0.04). Save the new duration, and once the duration = 0, you remove the unit from the unitgroup so it will no longer be moved via the trigger.

Of course for leaping you will need to also add/remove crow form and change the flying height. I'm just assuming you already know about knockbacks and leaps, and are just looking for how to apply them to hashtables. Slide would probably be done the same way, just without the duration variable.

The link I gave you does a better job of explaining exactly how to save/load values using handles than I ever could, so just check it out. Good luck :)
 
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