Changeable damage?

tratolak

New Member
Reaction score
0
Can you change someones damage throught triggers? for example change damage of summoned pet by 50% of your intellect.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
You mean attack damage? Do you want to give a summoned unit 50% of the caster's INT upon summoning?

One solution I can think of: Give the summoned pet 1-1 damage, and give it an ability that increases attack damage. That ability would have many levels and each gives different bonus attack damage. Then when the unit is summoned, set that ability level to 50% of the INT.

For example, the INT was 40. Then you want the unit's attack damage to be 20. The unit starts with 1-1 damage, so you'll want to give 19 bonus damage to the unit.

Are you familiar with setting a unit's ability level to a certain integer value?
 

tratolak

New Member
Reaction score
0
this is quite good idea but wouldnt an abbility with so much lvls somewhat cause problems in game?
 

dracolich

TH.net Regular
Reaction score
15
use Custom damage system.
try to find in snippets and systems, it whould be somewhere.
or use unit with 1-1, register his attacks and apply damage once projectile hits
 

tratolak

New Member
Reaction score
0
i only know how to start a trigger when units begins to attack. Is there any event that detects when unit cause damage?
 

dracolich

TH.net Regular
Reaction score
15
well, you need 2 trigger.
1st one - unit attack, where unit - is your monster, probably you also need trigger to store him once spawn/summon/whatever.
second one - will be created when 1st trigger is called

so, its like
trigger - unit start attack
create trigger register unit event (attack target, death event)
also add to this 2nd trigger another event - timer (1-2 sec), in case of using stop.

second trigger will check - if it was called because timer out, then destroy triggered trigger
else - call damage triggering unit for yourdamage
regardless condition, destroy triggered trigger.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
tratolak, actually, I'm still curious whether you want:

(1) Summon a pet. The pet's attack damage is 50% of the caster's INT when the pet is attacking. This takes into account if the caster's INT changes after the pet is summoned.

or

(2) Summon a pet with attack damage equal to 50% of the caster's INT, and after this point on, any changes to the caster's INT will not affect the pet's attack damage.

If you want (1), you'll need a damage detection system as described above by dracolich.

If you want (2), ability with several levels can work. How much INT is the caster going to have? 100? 1000? More INTs require more levels of ability, naturally. However:

tratolak, are you familiar with this kind of thing:
You have an ability that gives +1, +2, +4, +8, +16, +32 etc. attack damage. If you can transform that "50% of INT" from decimal to binary representation, you can give the pet some of those abilities. In the end, you'll have fewer ability levels than having 100 levels to represent 100 different attack damage, for example.

(For comparison, you can give up to 255 attack damage with just 8 of such abilities.)
 

thorhunter

You can change this now in User CP.
Reaction score
32
You need to be more specific about it since there are several methods, each has its pros and cons.

1. You can create ability/abilities based on claws of attack that will be added/set (if summoned unit starts with it). As forementioned, you can use multiple abilities, since editor limits you to 1000 levels, so first would scale like +0/1/2.../999 damage, the other +0/1000/2000.../999000 and by using combination of these two you can get any value between 0 and 999999. Theres one general disadvantage of this solution: any % damage skills affecting the unit (eg. command aura) will be completely nullified.

2. You can use some sort of damage dealing system, but i don't recommend it for newbies.

3. You can use damage upgrades. This one works quite well, under certain conditions: intelligence of character can only increase (any items that grant intelligence shouldn't affect this ability, unless items are permanently on hero); only one hero with this skill is permitted per player (otherwise it won't work due to highest intelligence sharing over to all users).
 

vypur85

Hibernate
Reaction score
803
I believe darkRae method 2 is what is wanted. Check out the Set Damage snippet in my signature. Only 5 abilities with 10 levels each. It gives you 0-99999 damage. Should be more than what you need.

Copy the snippet triggers into your map. Then when you summon your pet, just follow the instructions in the snippet (set your unit to certain variable and set your damage value * int of your hero, and run the snippet trigger) and you're done. If you want the damage to be dynamic, then you'd need periodic trigger to periodically set the pet's damage throughout the game.


> Can you change someones damage throught triggers?
And to answer your question, no you can't.
 

thorhunter

You can change this now in User CP.
Reaction score
32
Only 5 abilities with 10 levels each. It gives you 0-99999 damage.
There's really no reason to use 5 abilties instead of two (i think even one would suffice, unless its some sort of oldschool rpg that gets to thousands of stats and damage). With auto fill feature you can config ability with 1000 levels in an instant (you probably are not aware of it, I recommend it greatly, just right click on one of the fields and select 'auto fill' :))
 

vypur85

Hibernate
Reaction score
803
1000 levels... not recommendable. 5 abilities only require 50 levels in total. More efficient.

It's not about the autofill issue, really.
 

vypur85

Hibernate
Reaction score
803
An ability with 1000 levels is more taxing than 5 abilities with 50 levels, that's all. It takes more time to load 1000 worth of data than 50.

It's like... a trigger with 1000 if then else, and 5 triggers with 10 if then else, each. Though not entirely right to use this comparison, but I guess it's just something relative.

Edit:
1000 levels, really? Haven't tried it before. I thought it was 100. Then again, even at 100, the brief lag moment seems quite bad.


Edit (for bottom):
I rest my case. :) Let the TS decide, since this is getting much offtopic anyways.
 

thorhunter

You can change this now in User CP.
Reaction score
32
You actually meant the setting level of an ability function which kinda goes as you described (I'm not sure whether condtioning 'Level of ability for unit' follows same pattern), but considering there are other issues with this function that reflect on the gameplay, it shouldn't be run frequently (there's not even a need for high precision), therefore its efficiency is negligible. You have to remember that 5 abilities literally take much space in object data and making 5 of them to match the needs of possibly one or few abilities is rather overexerting.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
Before we go on more about efficiency, we need to know how big of a damage we are going to deal with here :p

I mean, if the biggest possible INT in the game is, say, 150, you can just work with a system that deals with 75 or so bonus damage. No need to go to 99999.
 

thorhunter

You can change this now in User CP.
Reaction score
32
I put back what I said before, after some testing I found out the 'Set Ability Level' actually takes alot of processing power, same 'Level of ability for unit' condition check so it's best to reduce it by splitting the ability itself into atleast 2.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top