Need Help With Setting Unit Damage

Blood_Wraith

New Member
Reaction score
2
I was wondering how you set a unit's damage, I couldn't find any obvious trigger actions for that, so I'm fairly lost here. I need to know how to set a units damage to something like this:

Unit - A unit Starts the effect of an ability

(Ability being cast) Equal to Summon Chocobo

Unit - Set damage of (Last created unit) to (Hero Level of Casting Unit + Hero Intelligence of Casting Unit X 6) X 1

Basically I'm going for a dynamic summon system with the summons damage, any help would be appreciated.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
Trigger:
  • Trigger
    • Events
      • Unit - A unit spawns a summoned unit
    • Conditions
      • Unit Type - Spawned unit type is equal to X
    • Actions
      • For Integer A from 1 to (Hero Level of Summoning Unit + Hero Intelligence of Summoning Unit X 6)
        • Loop - Actions
          • Item - Give Summoned Unit a Tome of Damage + 1

this should work but they will need to have a hero type inventory, so that they can use tomes
 

Blood_Wraith

New Member
Reaction score
2
Well it works, technically, but two problems; One: It spawns a bunch of TEENY tome effects which NEVER go away, thus taking up resources (I changed the tome model to a custom bag model, while it appears to leave no effects behind, the area of where they were spawned/used LAGS), and Two: When the Hero has a lot of Intelligence, it spawns SO MUCH TOMES, it super lags me for several seconds, and I also experienced a bunch of random doodads teleporting to the position of the summoned unit TWITCHING with screwed up vertexes, or whatever. I'm probably gonna need custom script to modify the unit's damage, which is what I wanted in the first place (even know I know pretty much nothing about it). Maybe I did the trigger wrong, take a look.

Trigger:
  • Events
    • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Chocobo (Summon)
    • Actions
      • For each (Integer A) from 1 to ((((Hero level of (Summoning unit)) + (Intelligence of (Summoning unit) (Include bonuses))) x 6) x 1), do (Actions)
        • Loop - Actions
          • Hero - Create Summon Damage Tome and give it to (Summoned unit)


Sorry I didn't know how to use the wc3 forum code before, I learned that from your post in my other thread, thanks. Still need help though.
 

merlinds

Member
Reaction score
15
You already solved the first problen. Just remove all the SE of the tomes.
For the second problem, just create diferent types of tomes, for example
TOme +1
Tome +2
Tome +3
Tome +4
Then after the loop you set a variable to:
Lvl of casting hero X inteligence of the hero X 6.
Then you manually set an if/then/else to check the amount, for example:
If the result is 25 you give the unit 25 Tomes +1 or 5 Tomes +5
If the result is 50 you give the unit 10 Tomes +5
In this way you reduce the amount of tomes, and the lag. I hope you understand the idea.
 

BloodySkullz

Active Member
Reaction score
10
What's the ability that the tomes should use?

I don't recall seeing a Powerup ability adding permanent damage, only stats such as Agility or Strength.
 

Iwan_Krissov

New Member
Reaction score
18
I was wondering how you set a unit's damage, I couldn't find any obvious trigger actions for that, so I'm fairly lost here. I need to know how to set a units damage to something like this:

If it does not matter to you, that the extra damage is displayed in green, you could create an ability based on the "Item - Damage Bonus +1". Switch off "Item-Ability", give it several levels, where each level will have another amount of damage added. (Level 1: +1 Damage, Level 2: +2 Damage etc...).
Add this ability to your units and than you can switch the level to the one you want via trigger functions...

Edit:
Can also be done similar with tech-levels. This would remove the green damage-numbers but there would be the numbers for techlevels at the attack-display...
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
It's possible to add an Item Damage Bonus ability to the unit and increase the damage that way, or have several different ones of 10 levels each to manipulate the value of the ones, tens, hundreds and so on. Since the ability has no icon, you can give it directly to the unit and increase its level to a certain integer value.
 

vypur85

Hibernate
Reaction score
803
If you don't mind the green values then you can check out 'Set Damage' located in my signature below. It's a system that allows you to set damage of a unit with just 5 abilities with 10 levels each. As suggested by the post above.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you could split it up into bulks, i could do this easily with jass and a couple of extra items (+1, +5, +25, +100, +500, +2500, +10k, etc) that way it increases it 1 time for a MUCH larger number to reach that number with way less items

like this:
JASS:
function StatIncrease takes integer Max, unit u returns nothing
    local integer i = Max
    loop
        exitwhen (i == 0)
        if (i >= 10000) then
            call UnitAddItem(u, 10kItem)
            set i = i - 10000
        elseif (i >= 2500) then
            call UnitAddItem(u, 2.5kItem)
            set i = i - 2500
        elseif (i >= 500) the
            call UnitAddItem(u, 500Item)
            set i = i - 500
        elseif (i >= 100) then
            call UnitAddItem(u, 100Item)
            set i = i - 100
        elseif (i >= 25) then
            call UnitAddItem(u, 25Item)
            set i = i - 25
        elseif (i >= 5) then
            call UnitAddItem(u, 5Item)
            set i = i - 5
        else
            call UnitAddItem(u, 1Item)
            set i = i - 1
        endif
    endloop
endfunction
 

Ayanami

칼리
Reaction score
288
you could split it up into bulks, i could do this easily with jass and a couple of extra items (+1, +5, +25, +100, +500, +2500, +10k, etc) that way it increases it 1 time for a MUCH larger number to reach that number with way less items

like this:
JASS:
function StatIncrease takes integer Max, unit u returns nothing
    local integer i = Max
    loop
        exitwhen (i == 0)
        if (i >= 10000) then
            call UnitAddItem(u, 10kItem)
            set i = i - 10000
        elseif (i >= 2500) then
            call UnitAddItem(u, 2.5kItem)
            set i = i - 2500
        elseif (i >= 500) the
            call UnitAddItem(u, 500Item)
            set i = i - 500
        elseif (i >= 100) then
            call UnitAddItem(u, 100Item)
            set i = i - 100
        elseif (i >= 25) then
            call UnitAddItem(u, 25Item)
            set i = i - 25
        elseif (i >= 5) then
            call UnitAddItem(u, 5Item)
            set i = i - 5
        else
            call UnitAddItem(u, 1Item)
            set i = i - 1
        endif
    endloop
endfunction

Why are you adding items?
 

Blood_Wraith

New Member
Reaction score
2
What's the ability that the tomes should use?

I don't recall seeing a Powerup ability adding permanent damage, only stats such as Agility or Strength.

It's Item Permanent Damage Gain.

If it does not matter to you, that the extra damage is displayed in green, you could create an ability based on the "Item - Damage Bonus +1". Switch off "Item-Ability", give it several levels, where each level will have another amount of damage added. (Level 1: +1 Damage, Level 2: +2 Damage etc...).
Add this ability to your units and than you can switch the level to the one you want via trigger functions...

Edit:
Can also be done similar with tech-levels. This would remove the green damage-numbers but there would be the numbers for techlevels at the attack-display...

Tech-levels? You mean upgrades right? How would I do that? Give me an example please.
If you don't mind the green values then you can check out 'Set Damage' located in my signature below. It's a system that allows you to set damage of a unit with just 5 abilities with 10 levels each. As suggested by the post above.

Well I copied your system into my map and of course modified it a bit to work for my trigger, and it works! But for some reason when I do my -vision chat command (a trigger I put in to reveal the whole map), it lags, which it didn't do that before, oh well. It didn't lag when I do iseedeadpeople, for some reason though. Anyways have some rep, also it would be cool if someone gave me an example of how that upgrade type trigger would work.

Edit: Also it lags for a moment at the beginning of my map, when I do a command to unpause/make vulnerable several units, but like I said: Weird. As long as it only does that ONCE that I'm fine.
 

vypur85

Hibernate
Reaction score
803
Upgrade is not such a good idea for dynamic damage settings because upgrades cannot be degraded.

Lag is common (without preloading) when implementing the simple system because there are 5 abilities with 10 levels each. Technically, this is not much and won't cause much stress to the computer in a long run. I have no idea why the vision trigger lags the game. Perhaps there are too many units localised at certain region which causes this problem.

And the system I made did not include preloading of the 5 abilities. So it's natural to lag a little when the abilities are added for the first time. Try preloading them. It gets better that way, I hope.
Code:
Damage System Init
    Events
        Map initialization
    Conditions
    Actions
        Set Int_DamageSys_DigitCount = 5
        Set Abi_DamageSys_Damage[1] = Damage (1x) 
        Set Abi_DamageSys_Damage[2] = Damage (10x) 
        Set Abi_DamageSys_Damage[3] = Damage (100x) 
        Set Abi_DamageSys_Damage[4] = Damage (1000x) 
        Set Abi_DamageSys_Damage[5] = Damage (10000x)
        [B]Unit - Create 1 AnyUnitAtAll for WhoEverAtAll at AnywhereAtAll facing wherever....
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Unit - Add Abi_DamageSys_Damage[Integer A] to (Last created unit)
        Unit - Remove (Last created unit)[/B]

Just add the bolded stuff.
 

Blood_Wraith

New Member
Reaction score
2
I guess it fixed the lag after I added those lines, thanks again! But a problem (which I can get by I suppose) is that I can't do something like Arithmetic: (Hero Level + Hero Intelligence X 6) X 0.50, it seems to be strict, not allowing me to do point.anything. For summons atleast, I'll bypass that by just modifying the (Hero Level + Hero Intelligence) part and leave the X 0.50 (or whatever comes after hero level + hero intelligence) part. Actually in this case I just left the (X 0.50, or whatever) part to X 1.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
I think you should change the "x 0.50" to "/ 2". Integers and reals don't work well with each other. Better still, convert all your integers into reals and use the real values instead.
 
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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top