• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Best SetUnitMaxState type system right now?

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 41
Joined
Jun 9, 2011
Messages
13,239
BonusMod gotta be the first one that comes to mind and thus the most common one.

Nest tried to make his version but I don't think it was appealing to the general crowd. It's highly possible that it's better performance wise though.

edit:

Ap0colypse sent me a GUI version which I assume he made himself, this was a few years back but I still have it. Hardly the best one performance wise since it's GUI but if you prefer GUI I can send it to you.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
The one by earthen fury (or something like that) has got two flaws which I must mention.
1. The main function (the one that does the work) and the redirecting function (the one that redirects to the main function as a wrapper for easy usage) are flipped.
The systems method is to increase/decrease he or mp.
However, the main function seems to be "SetUnitMaxState ()"
2. When you are changing a lot of hp/mp, the system will either crash or come to the op limit because the abilities that are used do not get to high enough.

Iirc, he did create the abilities with the preprocessor functions, but if not, that wouldoesn't also be a must.

Nestharus' one will probably be the best performance wise cause he uses based numbers.
But apart from that, changing the one in BonusMod by the two changes above would do fine.
 
Dat-C3 came up with a pretty cool method if you only need to set max hit points:
JASS:
function SetUnitMaxLife takes unit u, real newLife returns nothing
    local player p = GetOwningPlayer(u)
    call SetUnitOwner(u, Player(14), false)
    call SetPlayerHandicap(Player(14), GetUnitState(u, UNIT_STATE_MAX_LIFE) / newLife)
    call SetUnitOwner(u, p, false)
    call SetPlayerHandicap(Player(14), 1)
endfunction

Player 14 is Neutral extra. But it is usually nice to have the other features of BonusMod, so I just end up using that instead. I just figured I'd throw this out there as an option.
 
Status
Not open for further replies.
Top