• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Setting Unit's Properties to a formula

Status
Not open for further replies.
Level 9
Joined
Oct 17, 2007
Messages
547
Basically I'm making custom spells and i need a way to detect these properties from a hero unit with bonus from items and passives/auras:

Current Attack Damage
Current Attack Speed
Current Movespeed
Current Armor

And if i wanna make a trigger that checks all the skills that the hero currently has and add each of them to a different variable variable how can i do that?
 
Level 12
Joined
Aug 20, 2007
Messages
866
JassCraft

First off, get JassCraft

Second, those are already change-able via the object editor
They can only change using spells, so make sure you variable all of the changes, and you will be able to keep track

I don't think there are functons for getting those values (especially attack dmg, because it is random between the dice) so you will probably need to do what I afore mentioned
 
Level 9
Joined
Oct 17, 2007
Messages
547
What i mean is basically get all those current number on a hero unit at any point during a fight. For the damage it can be average of the 2 numbers or detect both numbers.

Its hard to keep track if the player has more than 1 heroes... and as the game progesses the hero will learn more abil, so thats why i want a function that checks what abil the hero has at the moment and set them each to a variable so the player can modify the combo of diff abils.

If i actually know the language (JASS) i wouldn't have ask. And even if i start learning it now, it will take a long while until i get to the point where i need to write these kind of functions, these aren't exactly beginer's knowledge.
 
Level 22
Joined
Feb 26, 2008
Messages
891
As far as I know, it is impossible to detect these things, JASS or no JASS.

Though, I think you can get the movement speed somewhere....
Should be able to find it under Unit - Integer when looking at integer functions.
 
Level 12
Joined
Aug 20, 2007
Messages
866
Un-Detectable

Yes, they are un-detecable, not untrackable

You must store all the changes within variables to keep track of it all, and yes this would be very complicated, and not something for a beginner to do

(Btw, you can keep track, because the starting values are created by you in the object editor)
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
Would not work, the only way to do this would be to trigger all the items in your map, and take these in relation, for example a simple sword would need to be triggered, so that it adds 2 damage through a ability to your unit (you get the sword, sword has no effect, then through a trigger you add 2 damage, it stacks, so no worry for multiple swords), the downside is you need to detect when all the items are dropped or sold, so you would need to remove the added abilities, you could certainly use a spellbook for all those abilities which have a icon shown, would you add them, and simply disable the spell book.

Now, each trigger fired adds a number related to the bonus to the variable of your hero, for example a sword, you get it, 2 damage added, so to your heroes variable "Item added Damage" is a 2 added.

And you need of course to calculate every 2 or 1 second the current damage of your hero, formula would look like this: Current Attack Damage(max) = Basic Damage + ( dice 1 x dice 2) + "main attribute" (difficult to detect, maybe the highest attribute?) + Item added Damage.

But this would only calculate the max damage, and not the min damage.

Min damage would be (not entirely sure) Current Attack Damage(min) = Basic Damage + main attribute + Item added Damage.

PROBLEM: You cannot detect the damage done by 100% beside through damage taken. Because of the random between Max - Min. The Damage is randomly choosen.
 
Level 9
Joined
Oct 17, 2007
Messages
547
I thought i saw a system somewhere that shows the amount of damage a unit deals as it attack so it is possible?

What happens if each unt has a diff amount of starting armor, how do we detect the starting amount.
 
Level 12
Joined
Aug 20, 2007
Messages
866
Whoops

Sorry, I feel kinda stupid didn't see this was in the GUI section

You just look in the object editor for the starting values.... you set them yourself....
 
Level 9
Joined
Oct 17, 2007
Messages
547
if theres about 200 hero units and each of them have a diff amount of armor, making the triggers to set the starting values for each of them is too much.
 
Level 12
Joined
Aug 20, 2007
Messages
866
Arrays

Arrays can hold up to 8192 different values, so a system would have no problem with it

At the same time, what map has 200 heros???
 
Level 9
Joined
Mar 25, 2005
Messages
252
There is a native GetUnitMoveSpeed. Doesn't it work?

Here is a system for getting armor.

You can detect when a unit picks up an item that adds dmg or ias and you can check what dmg or ias modifying buffs he has and you can define the unit type's base attack damage and attack speed. Those combined give you all the info you need.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Need to detect the armor ?
one hard idea from me
You need to create illusion of that unit and make someone do weapon damage to illision and calculate life it lost
 
Level 9
Joined
Oct 17, 2007
Messages
547
My best option right now, at least before JASS is familiar to me is, make all the armors the same then increase armor amount gain per agil point, easier to detect.
 
Status
Not open for further replies.
Top