• 🏆 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!

Stacking Units

Status
Not open for further replies.
Level 3
Joined
Jan 9, 2008
Messages
24
I need some guidance on how to "stack" units.
When I say stack I mean that it will be only one unit in wc3, but its actually many units of the same type.
Every unit will have an ability to add 1/10/100/1000 units of that type to the existing unit.
For every unit 100% HP is added, 25% damage and 75% attack speed is also added.
Is there already a passive ability that can do all this? Or do I need to use several abilities?
I also want to hide the ability from the 3x4 command view if that is possible.
Any tips or tricks are welcomed, or if you think it should be done any other way.
Links to other similar threads may be helpful as well.
I will use JASS when I make it, but all GUI is understandable =)
 
Level 36
Joined
Jul 1, 2007
Messages
6,677
I believe you can change their hp and stuff with jass, and without abilities, using structs.
Feel free to check out some jass tutorials for further information...

You also might want new gen, just google it ;)

However, I don't know entirely what the hell you're talking about, so you might have more luck looking at the tutorials and figuring the rest out for yourself. Sorry I can't help you more... not really a jass expert here :p
 
Level 11
Joined
Aug 25, 2006
Messages
971
You can set a unit's custom value to the number of stacked units, you can increase 'their' HP via triggers but i'm not sure if you can alter their base attack speed and damage using triggers. Spells would be tricky cuz it would be hard to make their effects stack.

You didn't read his whole post.


Anyway, back on-topic.

This can be done using three or four passive abilities. (You level them up to 'stack' another unit) You can level them up through triggers.

To hide them from view, first put the spells in a spell book. Disable the spell book. This hides the spells, but allows you to benefit from them anyway.
 
Level 3
Joined
Jan 9, 2008
Messages
24
Thanks for all the comments

I think I will try what wd40bomber7 said.
HP can be set without using spells, so I need to find the passive ability to increase damage and attack speed.
It will be possible to stack many units, so stacking 2000 grunts should be possible.
I have been thinking about how this can be done, and I will add abilities for
x1, x2, x4, x8, x16, x32, x64 etc.
Now I can add x32 + x8 + x2 to the spell book if it is 43 units stacked,
but I cant add the same ability with different levels, right?
So I need to add several different abilities.

I havent been reading about spell books before.
Could someone tell me what this is, or give link to any good tutorial?
I will also search for it here on this forum when Im done posting.

Does this sound like a a good approach?

btw I already use new gen
If I should use structs to change damage and attack speed, how is this done?
Im not very experienced with structs, but have used structs/classes in other languages,
does it work in the same way?

+ rep to all :D
 
Level 15
Joined
Jan 16, 2008
Messages
1,244
Honestly, i doubt you'll be able to make the spell effects stack but if you do make the same spell stack over and over again, your problem will be solved completely. Binary system numbering, i must say it's a great idea. Why would you wanna stack units anyway? Me and my friend are working on a heroes of might and magic rts, we thought about stacking units but gave it up :p If you figure it out, please, inform me cuz we're out of ideas.
 
Level 3
Joined
Jan 9, 2008
Messages
24
Hello again =)

The reason I want to stack units is because the cheapest unit will be so much worse than the most expencive, so then you will need alot of the cheapest to kill an expensive one.
If you have played games like www.planetarion.com, my game is inspired by those.

About the stacking of attack speed, that is true, I didnt think about that :p
Maybe I should have 1% increase or none at all, but then more increase to damage.

Everytime a unit is attacked, it will lose abilities again depending on how much HP is lost.
I hope that wont slow down the game.
 
Level 3
Joined
Jan 9, 2008
Messages
24
It should be % since every unit type will have different base damage, and they should all use the same abilities.
Dont think its possible with values, but maybe I dont understand you correctly.

So if a unit with 3-3 base damage with added 50 units (51 units total), It should have like 5100% added damage.

And a unit with 250-250 base damage with 1 added unit should have 200% total damage (500-500).

Im not asking you to do it for me, but if you could, or just make the basic, so i could finish it myself, it would be AWESOME :thumbs_up:

I was thinking about critical damage as well.
Is there a way to show the "new" damage for the unit? (Not a big problem if its not)

I really appreciate all the help I get.
 
Level 15
Joined
Jan 16, 2008
Messages
1,244
Well if you can jass-change unit's damage, there is no need for critical and the new damage will be displayed right away. IMO you shouldn't change the attack speed, just add damage of all units( if a unit has 3-5 damage and you have 5 units stacked it would be 15-25 damage). Because if you change the attack speed by 100%, it's like you multiplied the damage by 2.
 
Level 3
Joined
Jan 9, 2008
Messages
24
I didnt think it was possible to change base damage in JASS,
but if it is possible, How is this done? structs?
 
Level 11
Joined
Aug 25, 2006
Messages
971
I didnt think it was possible to change base damage in JASS,
but if it is possible, How is this done? structs?
Sorry, I'm not laughing at you, I'm laughing at your ignorance. (j/k)

Structs are a method of storing data and have nothing to do with changing unit stats.

If you want to be able to set damage you need two things.
First you need to know how much damage the unit does to begin with.
Second you need BonusMod, perferbly the one from Vexorian. However this adds/subtracts damage using the 'temporary' bonus modifier. It doesn't change the root stat.
 
Level 3
Joined
Jan 9, 2008
Messages
24
no offence taken :p

I was thinking of storing data like damage and how many units were stacked in the struct, then use that struct in methods called when units attack, but I will see if i understand BonusMod
thx for the tip
 
Level 3
Joined
Jan 9, 2008
Messages
24
Well I have started using BonusMod, and it works... almost
It seems that the lowest ability does not work, so i cant add 1 damage, i have to add 2
Has anyone experienced this problem before?
 
Status
Not open for further replies.
Top