• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Libraries and Systems

Status
Not open for further replies.
Level 7
Joined
Feb 9, 2021
Messages
301
Disclaimer: I build for War3 1.26a

Hi, I am making a MOBA map with interesting and complex mechanics. As I just started learning about Jass (and soon vJass), I wanted to ask experts for advice on libraries and some other topics. While learning from examples, I noticed that many spells use various libraries, however, many libraries do not have a good description. Therefore, I wanted to ask for some explanation on libraries and maybe some recommendations.

Libraries that I do not understand (what are they used for? why do people need them?):
1. [System] Dummy
2. [Snippet] List
3. [Snippet] Constant Timer Loop 32
4. [Snippet] SpellEffectEvent
5. [Snippet] RegisterEvent pack
6. [System] MissileRecycler
7. nestharus/JASS

Other questions:
1. Hashtable vs UnitIndexer
2. In my map, I want to have items that reduce certain negative effects durations, such as stuns, slow, root and etc (but not all negative effects). What systems can I use for this?
3. I want to have armor, magic armor and armor penetration and magic armor penetration (flat and in %). Any systems for that?
4. I also want to have a custom stats system with attack damage and ability power instead of str/agi/int. However, I need to add units health per level and other stats per level. What is the best way to approach this?
5. Spell vamp?
6. Colodwn reduction in an efficient way (without hundred of similar spells). Here is an example:
7. What are good Buff Systems? Buff system vs creating a dummy and casting a buff?
8. Bushes like in League of Legends? I saw some old posts, but maybe some people came up with more efficient ways. Brush
9. Complex DDS vs other systems? Any good examples of how DDS can be used?
10. Any must-read materials on Jass/vJass for beginners/average
11. System for slow that can change the duration and effectiveness of slow through triggers.
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
1. Hashtable vs UnitIndexer

Both are good, depending on what you want to use them for, I recommend learning both.

4. I also want to have a custom stats system with attack damage and ability power instead of str/agi/int. However, I need to add units health per level and other stats per level. What is the best way to approach this?
In 1.26a the new native functions are not yet introtruced so item abilites is what people generally used back in the day. Ability power is pretty simple to make. You want either save an integer/real into hashtable or integer/real with array into a custom value of unit or into player number. Then we need to add the used variable into the damage formula of the ability.

I want to have armour, magic armour and armour penetration and magic armor penetration (flat and in %). Any systems for that?
You might want to look for older versions of bribes damage engine.

5. Spell vamp?

Can be done with DDS. (If old enough versions exist.)
 
Level 7
Joined
Feb 9, 2021
Messages
301
Both are good, depending on what you want to use them for, I recommend learning both.


In 1.26a the new native functions are not yet introtruced so item abilites is what people generally used back in the day. Ability power is pretty simple to make. You want either save an integer/real into hashtable or integer/real with array into a custom value of unit or into player number. Then we need to add the used variable into the damage formula of the ability.


You might want to look for older versions of bribes damage engine.



Can be done with DDS. (If old enough versions exist.)
I already installed the last available version of DDS for 1.26a. Thanks, will try to see how to use it for these purposes.

I use hashtables now. When is it better to use UnitIndexers?

I thought about making attack damage and ability power as a stat instead of agi and int. Then just disable benefits from these attributes. On other stats such as Health, Heath Regen, Armor, Magic Resist, Mana, Mana Regen and Attack Speed, I need to add them through items for each unit per level? Will it be problematic for performance?
 
Level 12
Joined
Feb 5, 2018
Messages
521
I use hashtables now. When is it better to use UnitIndexers?

This totally depends on what you want to do. Hashtable saves the unit HandleID and unitindexer saves the unit custom value. I think custom value is more bulletproof than hashtables.

If you for example load units from a unit group using hashtable it loads the units in an order. Loading the last added unit in last spot. This might cause issues in some rare cases.

I thought about making attack damage and ability power as a stat instead of agi and int. Then just disable benefits from these attributes. On other stats such as Health, Heath Regen, Armor, Magic Resist, Mana, Mana Regen and Attack Speed, I need to add them through items for each unit per level? Will it be problematic for performance?

No problem for perfomance. You can make a simple item ability called "attack damage" and add 100 levels to it. If you need to have more levels you can make another one called "attack damage 2" and add 100 levels to it. You add the item ability to the unit and increase it's level as you please. The item ability is also good in this scenario since it is hidden by default so it does not make icon for the unit.

You can use this same method for all the other attributes too.

It's basically just an hidden ability that gives stats.

Then again I forgot if 1.26a has access to things like BLZsetunitarmor and other stuff so you might be able to JASS it instead of messing around with item abilities. :D
 
Level 7
Joined
Feb 9, 2021
Messages
301
This totally depends on what you want to do. Hashtable saves the unit HandleID and unitindexer saves the unit custom value. I think custom value is more bulletproof than hashtables.

If you for example load units from a unit group using hashtable it loads the units in an order. Loading the last added unit in last spot. This might cause issues in some rare cases.



No problem for perfomance. You can make a simple item ability called "attack damage" and add 100 levels to it. If you need to have more levels you can make another one called "attack damage 2" and add 100 levels to it. You add the item ability to the unit and increase it's level as you please. The item ability is also good in this scenario since it is hidden by default so it does not make icon for the unit.

You can use this same method for all the other attributes too.

It's basically just an hidden ability that gives stats.

Then again I forgot if 1.26a has access to things like BLZsetunitarmor and other stuff so you might be able to JASS it instead of messing around with item abilities. :D
I see what you mean. Thank you for your help with some of the questions. I will probably use this then: [JASS] Custom Stat System (CSS) v1.5g
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
For cooldowns, there are a couple techniques. They do require spamming abilities, but you can minimize the impact.
Basically, when the spell is cast you can still change the level of the spell. If you change it to a level that has a different cooldown, it will use that.
Since this would result in many levels for every single ability, you'd have to use another technique:
The technique is to use engineering upgrade to swap out the actual ability for one that has many levels.
I don't know if it works properly when the base abilities are different, but basically how I would do it:

One ability with many levels, each level with a different cooldown. Let's call it the cooldown ability.
For each ability that you want to make, also make an engineering upgrade ability that would swap it with the cooldown ability.
Whenever you want to change the cooldown of something, add the right engineering upgrade, change level of cooldown ability, then after a 0-timer change the level back and remove engineering upgrade.
I admit it's complex, but I know of no better way for 1.26.

Note: This only works if you change the cooldown at the moment of ability cast every time.
 
Last edited:
Level 7
Joined
Feb 9, 2021
Messages
301
For cooldowns, there are a couple techniques. They do require spamming abilities, but you can minimize the impact.
Basically, when the spell is cast you can still change the level of the spell. If you change it to a level that has a different cooldown, it will use that.
Since this would result in many levels for every single ability, you'd have to use another technique:
The technique is to use engineering upgrade to swap out the actual ability for one that has many levels.
I don't know if it works properly when the base abilities are different, but basically how I would do it:

One ability with many levels, each level with a different cooldown. Let's call it the cooldown ability.
For each ability that you want to make, also make an engineering upgrade ability that would swap it with the cooldown ability.
Whenever you want to change the cooldown of something, add the right engineering upgrade, change level of cooldown ability, then after a 0-timer change the level back and remove engineering upgrade.
I admit it's complex, but I know of no better way for 1.26.

Note: This only works if you change the cooldown at the moment of ability cast every time.
Thanks for this. I read somewhere that you can you this: Memory hack -> I am not sure what are the implications of using it though
Another option I found is this: System - Custom Cooldown System

I also saw a system for cooldown reduction some time ago, but I can't find it anymore.
 
Last edited:
Level 7
Joined
Feb 9, 2021
Messages
301
Memory hack is too complicated for me. It basically works by changing memory directly.
Cooldown system seems to work like I described. It's the only good way, so not very surprising.
Are you by any chance familiar with any of the libraries like [System] Dummy and [Snippet] List ? I am making a spell similar to hook at the moment, and I think they can be a life saver.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
These ones tend to be very small. I write stuff like that myself.
Dummy basically just handles dummy units, which is useful because if you remove too many units the game starts to lag. Better dummy systems can give you more, but that's the basic functionality. This specific one for example can give you dummies with a specific facing, which is useful for projectiles because you can't rotate units instantly.
As an alternative you could ofc create a new dummy every time, but again, if you do that thousands of times it might become a problem.
About lists, I'd say this specific collection is more for when you already know very well what you need. Learning to use anything from Nestharus can be harder than implementing your own, because he works on a different level from the rest of us.

Hook is a simple spell, you can do it without any libraries. I'd say you're still better off using a dummy recycler, but don't bother with learning this specific list resource unless you think it'll be easier than just making your own.
Remember, most systems waste your time initially to save it in the long term. The less complex your map is, the less sense there is in doing everything the right way.
 
Level 7
Joined
Feb 9, 2021
Messages
301
These ones tend to be very small. I write stuff like that myself.
Dummy basically just handles dummy units, which is useful because if you remove too many units the game starts to lag. Better dummy systems can give you more, but that's the basic functionality. This specific one for example can give you dummies with a specific facing, which is useful for projectiles because you can't rotate units instantly.
As an alternative you could ofc create a new dummy every time, but again, if you do that thousands of times it might become a problem.
About lists, I'd say this specific collection is more for when you already know very well what you need. Learning to use anything from Nestharus can be harder than implementing your own, because he works on a different level from the rest of us.

Hook is a simple spell, you can do it without any libraries. I'd say you're still better off using a dummy recycler, but don't bother with learning this specific list resource unless you think it'll be easier than just making your own.
Remember, most systems waste your time initially to save it in the long term. The less complex your map is, the less sense there is in doing everything the right way.
Thank you very much.
 
Status
Not open for further replies.
Top