Staredit Network > Forums > SC2 Assistance > Topic: +damage% / kill
+damage% / kill
May 29 2010, 10:09 pm
By: Ahli  

May 29 2010, 10:09 pm Ahli Post #1

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

I would like to have the effect that a unit gains e.g. 10% more damage per kill.

I guess I should do that with an behavior, but I don't know how to do that.

btw, what's scaled and what's unscaled damage?

Ideas?




May 30 2010, 12:10 am 13Stallion Post #2



Set his normal attack damage to 0
Make a variable that you will use to control his damage via triggers
on the event - unit is attacked, when your unit is the attacking unit, deal damage to the targeted unit via your variable
if your units damage would kill the target(same trigger as above), multiply your variable by 1.1(increase by 10%)

Thor's 6 +8 damage vs light is a "scaled" damage of 14, so his "unscaled" damage is 6.



None.

May 30 2010, 2:50 pm Ahli Post #3

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from 13Stallion
Set his normal attack damage to 0
Make a variable that you will use to control his damage via triggers
on the event - unit is attacked, when your unit is the attacking unit, deal damage to the targeted unit via your variable
if your units damage would kill the target(same trigger as above), multiply your variable by 1.1(increase by 10%)
I'm trying this. But I can't read a unit's armor with triggers, I think...
at least it's not a unit's property and not a unit's type property...




May 30 2010, 7:33 pm 13Stallion Post #4



There's a function in the trigger editor called "catalog". It allows you to retrieve ANY value from the data editor and use it in your triggers as a variable or whatever else you need it for. Im going to post an example/tutorial as soon as I can.

CatalogFieldValueGet("int" catalog, "string entry", "string" field, "int" player) - this is your function
-int: catalog, this value ranges from 0-50, there is a different catalog for every different category(50 is weapons, 46 is unit data, etc...)
-string:entry, this value is the unit ID that you wish to find a value for(NOT the name, in order to view this, you must select "view raw data")
-string:field, this is the field value you are searching for(range, damage, lifearmor, period, etc.....)
-int:player, not sure what this means, because every player shares the same data atm...

-=Examples=-
1) CatalogFieldValueGet("50" catalog, "marine" entry, "range" field, "1" player) - Should return a value of 5, which is the range of a marine.

2) CatalogFieldValueGet("46" catalog, "marine" entry, "lifearmor" field, "1" player) - Should return a value of 0, which is the armor of a marine, if infantry armor has been researched then it will be higher of course.

http://www.sc2mapster.com/api-docs/functions/catalog-field-value-get/
- this is a list of all 50 catalog values

Post has been edited 2 time(s), last time on May 30 2010, 7:52 pm by 13Stallion.



None.

May 30 2010, 9:34 pm Ahli Post #5

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

thx a lot




Jun 3 2010, 7:51 pm Swampfox Post #6



Holy hell stallion! Thanks so much! I really never knew how to work directly with the data editor through triggers.

EDIT: I've been messing around with "Catalog Field Value Get" and "Catalog Field Value Set" and I noticed something very important. When you get the value, it will get the value of the field AS IT IS SET IN THE DATA EDITOR, whether it's default, or you changed it in the data editor. This means that when you use the "Set" function, the "Get" function will NOT get the value that you changed it to, it will continue to return the DEFAULT VALUE!

Someone please verify!

Post has been edited 1 time(s), last time on Jun 3 2010, 9:35 pm by Swampfox.



None.

Jun 10 2010, 11:23 pm Temp Post #7



Yes it seems that is true. Also a much cleaner way of doing this would be applying a stackable behaviour for each kill instead of using catalog functions.



None.

Jun 18 2010, 6:33 pm Ahli Post #8

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

I finally was motivated to tinker with the catalog to make this work.


Easiest way is to directly edit the value in the data table like shown.
I don't have the getValue error I think. (will test later. have to help out in an official match right now)

This trigger is tested in single player only. :S

edit:
trigger works. I'm not having swampfox's bug

Post has been edited 1 time(s), last time on Jun 18 2010, 8:21 pm by Ahli.




Jun 18 2010, 11:19 pm Swampfox Post #9



If that's all your trigger is, then you don't understand my problem. It's the GET catalog value function that doesn't work. If you're setting the catalog value to a variable, then you SHOULD have no problem.

Perhaps I should restate: If you set the catalog value sometime during the course of your map, what you get from that same exact catalog field won't be what you set it to. It will get what the value was before it was changed.

EDIT: Ya know what, hold on a sec. I suppose I haven't tested this in a while. Maybe a recent patch fixed it?
EDIT: Nope. I recreated the bug in this little demonstration map. Just run your rine around, and look for the text message. The message should display the rine's current speed, but fails.

Attachments:
Demonstration2.SC2Map
Hits: 1 Size: 22.72kb

Post has been edited 1 time(s), last time on Jun 18 2010, 11:27 pm by Swampfox.



None.

Jun 19 2010, 1:06 pm Ahli Post #10

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from Swampfox
If that's all your trigger is, then you don't understand my problem. It's the GET catalog value function that doesn't work. If you're setting the catalog value to a variable, then you SHOULD have no problem.

Perhaps I should restate: If you set the catalog value sometime during the course of your map, what you get from that same exact catalog field won't be what you set it to. It will get what the value was before it was changed.

EDIT: Ya know what, hold on a sec. I suppose I haven't tested this in a while. Maybe a recent patch fixed it?
EDIT: Nope. I recreated the bug in this little demonstration map. Just run your rine around, and look for the text message. The message should display the rine's current speed, but fails.
It doesn't give you player1's values because you used "any player" while getting the catalog.

Each player has its own catalog. You modified the value in p1's catalog, so you have to make sure that you read the value out of p1's catalog, too.
I guess with "Any Player" it is using the first catalog (player 0) the default value (I've modified p0-p15's {p16 gives error} catalog and it still shows 2.25 [default]).

Post has been edited 1 time(s), last time on Jun 19 2010, 1:13 pm by Ahli.




Jun 19 2010, 2:22 pm Swampfox Post #11



Ahh ok thanks. I thought designating a player had no effect, seeing as there aren't different player values in the data editor.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[05:24 pm]
lil-Inferno -- poopoo
[05:14 pm]
UndeadStar -- I wonder if that's what happened to me. A returned product (screen) was "officially lost" for a while before being found and refunded. Maybe it would have remained "lost" if I didn't communicate?
[03:36 pm]
NudeRaider -- :lol:
[03:02 am]
Ultraviolet -- I'm gonna send inf to have sex with their moms
[03:02 am]
Ultraviolet -- fuck those motherfuckers
[11:02 pm]
NudeRaider -- PSA: ASUS apparently decided their RMA department needs to "become profitable" and for a while now outright tries to scam customers. They were called out on it a year ago, promised to change, but didn't. https://www.youtube.com/watch?v=7pMrssIrKcY so my recommendation: Stop buying ASUS, and if you already have and need something RMA'd, make sure to not let them bully you into paying.
[2024-5-15. : 3:08 pm]
Oh_Man -- example of wat u mean?
[2024-5-15. : 5:59 am]
NudeRaider -- *is
[2024-5-15. : 5:17 am]
NudeRaider -- despite all its flaws the sound design its fantastic
Please log in to shout.


Members Online: 8lydiac8385rM9, NudeRaider, Ultraviolet