Detecting a units attack damage?

Jesus4Lyf

Good Idea™
Reaction score
397
Unit properties is a bad idea (out of the box) because of this.
JASS:
    function GetUnitId takes unit u returns integer
        return GetHandleId(u)-0x100000
    endfunction

It is unstable.
You can use Status instead to be safe.

And that function:
JASS:
function GetBiggestAttribute takes unit hero returns integer
    local integer stat=GetHeroStr(hero,true)
    local integer newStat=GetHeroAgi(hero,true)
    if newStat>stat then
        stat=newStat
    endif
    newStat=GetHeroInt(hero,true)
    if newStat>stat then
        return newStat
    endif
    return stat
endfunction
 

Viikuna

No Marlo no game.
Reaction score
265
Jesus4Lyf is kinda right. Using attribute would probably do it about 95 percently. Thats more a designing question. Im just answering how to do stuff. Whether you should be doing that stuff in the first place, is another story, though.


Unit properties is a bad idea (out of the box) because of this.

Not true. Read the documentation.


edit. Actually, this problem doesnt necessarily have to exist in the first place. You can just fine design your map so that spells dont become too weak in any part of the game.

Hell, one could just fine make a nice arena map with object editor spells only, that is perfectly balanced, and where spells dont loose power in the lategame. ( Actually, Ive been wanting to do that for a while, just to improve some of most basic designing and balancing skills I have. )

You dont neccesarily need any of this shit. You just use it because its cool.
 

shiFt

Member
Reaction score
8
ah thanks, status seems more my kinda thing to go for will fit in with the other jesus systems. I wish I could be as proficient with these codes as you, im more of the ideas effects guy , but if I could be both :D....
 

Jesus4Lyf

Good Idea™
Reaction score
397
Not true. Read the documentation.
It is perfectly true. I said "out of the box".
Furthermore, who reads through the code to find each piece of documentation? It's a real risk, in my opinion.
status seems more my kinda thing to go for will fit in with the other jesus systems.
Like Pokemon, gotta catch 'em all... :p
 

Viikuna

No Marlo no game.
Reaction score
265
UnitProperties just exist to give you an unit object with power to manipulate some of units existing properties and power to add more scripted properties.

It doesnt really matter whatkind of unit indexing you use. That method can work perfectly for some maps, although most would prefer AutoIndex. This stuff doesnt affect the UnitProperties system itself, though.

Also Jesus4Lyf, since you are the only guy of these bonus system makers, whos still updating stuff, you should at least add that "automatically writes initial values for you" thingy for Status.
 

shiFt

Member
Reaction score
8
I thought of using this mainly because most players usually just gun for the largest damage item available and eventhough they would be casters their spells become useless as they deal more damage in a shorter amount of time with less skill etc. with just attack.

Also it would be nice to add more power to skills based off of attack damage , or attributes so you can build heroes that can be specialised in damage or spells etc. That way Items play a larger role in developing the hero, rather than just simply adding atatck damage, the spells power would increase also.

Edit: Jesus are you currently making any maps?
 

Jesus4Lyf

Good Idea™
Reaction score
397
It doesnt really matter whatkind of unit indexing you use. That method can work perfectly for some maps, although most would prefer AutoIndex. This stuff doesnt affect the UnitProperties system itself, though.
Whilst I agree, it still breaks (in an obvious way) out of the box.
Also Jesus4Lyf, since you are the only guy of these bonus system makers, whos still updating stuff, you should at least add that "automatically writes initial values for you" thingy for Status.
What's that thingie? And could it be achieved with just an AIDS struct? :)
Edit:
Edit: Jesus are you currently making any maps?
Not at the moment, no. I work, so I don't have time. :(
 

Viikuna

No Marlo no game.
Reaction score
265
Thats a one way. If you want items to have a big role like that, doing this kind of attack damage stuff is indeed a good idea.


It requires some work, yes, but is really worth of it in the long run, because it makes coding some more complicated stuff damn easy.

What's that thingie? And could it be achieved with just an AIDS struct?

Just that when you create an unit, its [lJASS]Status[unit]getHealthBonus[/lJASS] returns the health unit has set in object editor. That Status has each unit types initial Status values ready. So that its not just a bonus system, but more like an unit object.
 

shiFt

Member
Reaction score
8
And taking out all damage items would maybe work, but then you would end up with example insane armor stats and attack speeds, which can be modified yes, but would take alot of balancing, but then it would be solely attribute based and no systems would be needed.

Edit
Ive got my uni holidays coming up, so i wanna revamp some stuff, hence all the questions etc.
 
General chit-chat
Help Users

      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