System Bonus (unit state modification)

Cohadar

master of fugue
Reaction score
209
set Damage = BinaryBonus.create('A8T0', 12, 5)

(0,1,2,...11) = 12 total
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
set Damage = BinaryBonus.create('A8T0', 12, 5)

(0,1,2,...11) = 12 total

I know, I forgot to edit that part, it goes to 11 or 12 in my test map :p



Solved: I did like this:
JASS:
//! external ObjectMerger w3a AItg A8T8 anam "Bonus Damage" Iatt 1 1280 ansf "(binary 8)"
//! external ObjectMerger w3a AItg A8T9 anam "Bonus Damage" Iatt 1 2560 ansf "(binary 9)"
//! external ObjectMerger w3a AItg A8T: anam &quot;Bonus Damage&quot; Iatt 1 5120 ansf &quot;(binary <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />&quot;
//! external ObjectMerger w3a AItg A8T; anam &quot;Bonus Damage&quot; Iatt 1 10240 ansf &quot;(binary <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink    ;)" loading="lazy" data-shortname=";)" />&quot;
//! external ObjectMerger w3a AItg A8T&lt; anam &quot;Bonus Damage&quot; Iatt 1 20480 ansf &quot;(binary &lt;)&quot;
JASS:
set Damage = BinaryBonus.create(&#039;A8T0&#039;, 13, 5)


and now it works up to 40955 extra damage :)


I think this works because now I only continue on the Latin_1 codes instead of jumping ~40 "slots" to come to 'a'.
 

lucifekit

New Member
Reaction score
2
Maybe it's not good enough to make a increase max life aura.>.<

Can you teach me how to make a increase max life aura :)
 

Kenny

Back for now.
Reaction score
202
Maybe it's not good enough to make a increase max life aura.>.<

Can you teach me how to make a increase max life aura

I havent read through it all, but this definately seems capable of making such an aura.

Base it off an already existing aura (maybe brilliance aura), then every every X seconds check for units with that aura, or unit within X distance of the aura unit, if the units have the buff or are in range, then add the max life ability to them, else remove the ability.
 

Romek

Super Moderator
Reaction score
963
Base it off an already existing aura (maybe brilliance aura), then every every X seconds check for units with that aura, or unit within X distance of the aura unit, if the units have the buff or are in range, then add the max life ability to them, else remove the ability.
Or you could just use UAC (see my sig), and add the bonus in the UnitEnter method, and remove it in the UnitLeave method. :)
 

waaaks!

Zinctified
Reaction score
255
is there any built in function that removes bonuses?
or if there is none, then how could i remove these bonuses?
 

Romek

Super Moderator
Reaction score
963
I'd guess doing "set Bonus_Blah = 0" would remove all the bonuses from that unit.
 

Faust

You can change this now in User CP.
Reaction score
123
Hmm... Could this also be used to add attack range in-game? Just asking...

The method of that is to give your unit in the object editor some wicked long range, then in the editor or in the game, set Acquisition Range to your liking.

This is the closest you can get.

As for the system... looks badass at first sight of the comments. I'll definitely look into it deeper, later.
 

Cohadar

master of fugue
Reaction score
209
Do abilities with 100 levels really take up that much memory/cause lag/load slowly?

Yes.
Ability with 100 levels is like 100 1-level abilities.
And I mean this literally, wc3 does not do any optimization for multilevel abilities, they are basically a 1-level abilities stored in the record one after another.

TRY:
make an empty map,
put one unit in the middle,
make some 100-level ability,
give that ability to the preplaced unit,
see how long it takes for map to load.
 

TwoHeadedBoy

New Member
Reaction score
6
Well you certainly have me convinced. The map without took 5 seconds to load, the map with 4, 100 lv abilities: armor, damage, life and mana, took 20 seconds to load.

Now the problem is that I dont understand JASS :(
 

Rommel

New Member
Reaction score
13
Yes.
Ability with 100 levels is like 100 1-level abilities.
And I mean this literally, wc3 does not do any optimization for multilevel abilities, they are basically a 1-level abilities stored in the record one after another.

TRY:
make an empty map,
put one unit in the middle,
make some 100-level ability,
give that ability to the preplaced unit,
see how long it takes for map to load.

Wa...so useful information :D ...I've been working with WE over 4 years but i have just known this, How can you know so much, Cohadar ? :D
 

Steel

Software Engineer
Reaction score
109
You need to rework how your system handles Life and Mana because it shouldn't have a limitation based on the abilities you feed into the system.

There is an older system on Wc3c that I've used for a while

JASS:
constant function MaxStateModifierId takes unitstate u returns integer
    if u == UNIT_STATE_MAX_LIFE then
        return &#039;A007&#039; // Rawcode of the Max Life Modifier ability.
    elseif u == UNIT_STATE_MAX_MANA then
        return &#039;A008&#039; // Rawcode of the Max Mana Modifier ability.
    endif
    return 0
endfunction
function SetUnitMaxState takes unit whichUnit, unitstate whichUnitState, integer newVal returns boolean
    local integer c = newVal-R2I(GetUnitState(whichUnit, whichUnitState))
    local integer i = MaxStateModifierId(whichUnitState)
    if i == 0 then
        return false
    endif
    if c &gt; 0 then
        loop
            exitwhen c == 0
            call UnitAddAbility(whichUnit, i)
            if c &gt;= 100 then
                set c = c - 100
                call SetUnitAbilityLevel(whichUnit, i, 4)
            elseif c &gt;= 10 then
                set c = c - 10
                call SetUnitAbilityLevel(whichUnit, i, 3)
            else
                set c = c - 1
                call SetUnitAbilityLevel(whichUnit, i, 2)
            endif
            call UnitRemoveAbility(whichUnit, i)
        endloop
    elseif c &lt; 0 then
        set c = -c
        loop
            exitwhen c == 0
            call UnitAddAbility(whichUnit, i)
            if c &gt;= 100 then
                set c = c - 100
                call SetUnitAbilityLevel(whichUnit, i, 7)
            elseif c &gt;= 10 then
                set c = c - 10
                call SetUnitAbilityLevel(whichUnit, i, 6)
            else
                set c = c - 1
                call SetUnitAbilityLevel(whichUnit, i, 5)
            endif
            call UnitRemoveAbility(whichUnit, i)
        endloop
    endif
    return true
endfunction


With this you can have the system add 100,000 Life or Mana if you wanted to with just 1 ability and 3 levels.

Also, the simple convention of a getter function is nicer than having to use your already existing overload functions, call me old fashion, but I find it more user friendly.

Bonus_Life[<unit>] does return the value, but I like a getBonus("Life", u) better myself.

Finally, I don't like the inability to Bonus_Life[<unit>] - 40 to simply subtract 40 hitpoints. You have to do the round about way of set Bonus_Life[<unit>] = Bonus_Life[<unit>] - 40. This is annoying as hell for something so simple.
 

Cohadar

master of fugue
Reaction score
209
That Life and Mana modification depends on a blizzards bug.
I won't make my system bug dependent because you never know when it might get fixed.

Finally, I don't like the inability to Bonus_Life[<unit>] - 40 to simply subtract 40 hitpoints. You have to do the round about way of set Bonus_Life[<unit>] = Bonus_Life[<unit>] - 40. This is annoying as hell for something so simple.
Simply make some BJ function for yourself:
JASS:

public function AddLife takes unit whichUnit, real lifeDiff returns nothing
    set Bonus_Life[whichUnit] = Bonus_Life[whichUnit] + lifeDiff
endfunction
 

Steel

Software Engineer
Reaction score
109
Simply make some BJ function for yourself:
JASS:

public function AddLife takes unit whichUnit, real lifeDiff returns nothing
    set Bonus_Life[whichUnit] = Bonus_Life[whichUnit] + lifeDiff
endfunction

Don't worry I did, but I will still depend on the "bug" to function properly for Life and Mana adjustments :p
 

prismpirate

New Member
Reaction score
2
Could anyone instruct me on how to implement this in GUI?

Update: This is what I have so far. Jasshelper hangs when I save it, so I know something is wrong. Can anyone tell me where I have gone wrong?
Trigger:
  • Testing
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to (==) Rock Slide (Troll)
    • Actions
      • Set TempInteger = (Learned skill level)
      • Set Temp_Unit = (Triggering unit)
      • Custom script: set Bonus_Life[GetUnitIndex(Temp_Unit)] = TempInteger
 

LilBlueSmurf

New Member
Reaction score
0
This is a great system. I have a couple questions and requests though.

1. (I didn't delve in the code) Is there a limit to 8 tiers, or can more be added?

2. Would mana regen and life regen be possible to affect with this? I have no clue if they would stack or not either.

If the answer to both of those is yes, can someone start me off on the mana and life regen skill lines needed? I can fill all the stuff in, but level 1 (or 0) for each would be appreciated.

I know some jazz, but I'm back after many many years away so I'm quite rusty. That also makes looking up specific abilities that would have the right stat a big chore, while I figure people here probably would know right off hand.

Thanks.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top