|
|
|
|
| JASS Resources Find JASS code snippets and functions here or write your own and post it on the Submissions sub-forum. |
 |
|
06-09-2012, 05:32 AM
|
#46 (permalink)
|
|
\m/
Join Date: May 2006
Posts: 1,985
|
Quote:
Originally Posted by Bribe
To get it approved? Someone has to move the thread to the JASS Resources forum.
|
Thanks for the sarcasm. Let me try again. What constitutes a submission worthy of the JASS Resources forum?
Quote:
|
To get it reviewed is something different. I could approve this but it is still "another damage detection system" to join the ranks of far too many to keep track of.
|
Instead of explaining why this is different/better than other public resources, I'm just going to say that it's not your job to keep track of these systems. The question is "Is the resource useful?"
Quote:
|
Also, to respond to the Unitalive/IsUnitType thing, they both return the same when a unit is resurrecting.
|
Thanks, but I was more curious about which one is less computationally expensive.
|
|
|
06-09-2012, 05:46 AM
|
#47 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,904
|
I already stated why this resource might be used. It allows users to pick their own libraries and allows users to register groups of units. However, with this, it is harder to use. Furthermore, it could use improvement (see DamageEvent).
That is all.
|
|
|
06-13-2012, 08:49 AM
|
#48 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
This is another approach to the complex situation of damage detection. Approved.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
06-14-2012, 11:03 AM
|
#49 (permalink)
|
|
Where's Teddy?
Join Date: Feb 2011
Posts: 1,593
|
Hi. I'm not great with damage detection stuff, but is there a way to detect only physical attacks with this system?
EDIT: I tried it with a Paladin casting Holy Light on an Acoltye. The result messages:
Paladin dealt 0.000 damage to: Acolyte
Paladin dealt 100.000 damage to: Acolyte
|
|
|
06-14-2012, 04:07 PM
|
#50 (permalink)
|
|
\m/
Join Date: May 2006
Posts: 1,985
|
Quote:
Originally Posted by Mr_Bean987
Hi. I'm not great with damage detection stuff, but is there a way to detect only physical attacks with this system?
|
Not that I know of :D Sorry I'm sure that wasn't the answer you were hoping for.
Quote:
EDIT: I tried it with a Paladin casting Holy Light on an Acoltye. The result messages:
Paladin dealt 0.000 damage to: Acolyte
Paladin dealt 100.000 damage to: Acolyte
|
That's pretty weird, you used the test scope with ADD_ALL_UNITS = true and didn't make another trigger for adding units? Regardless, if you didn't it would just display the same line twice. This looks more like something specific to holy light, maybe due to the allied/enemy duality involved with the spell.
|
|
|
06-14-2012, 04:16 PM
|
#51 (permalink)
|
|
Where's Teddy?
Join Date: Feb 2011
Posts: 1,593
|
Quote:
|
Not that I know of :D Sorry I'm sure that wasn't the answer you were hoping for.
|
:O nooooo!
Quote:
|
That's pretty weird, you used the test scope with ADD_ALL_UNITS = true and didn't make another trigger for adding units? Regardless, if you didn't it would just display the same line twice. This looks more like something specific to holy light, maybe due to the allied/enemy duality involved with the spell.
|
Yes, I used your test scope and only the test scope. I will try it with another spell and see what happens.
|
|
|
08-23-2012, 12:58 AM
|
#52 (permalink)
|
|
User
Join Date: Apr 2009
Posts: 20
|
Alright, this is just beautiful! I've got it to work on my map without any issues (I've haven't got any spells to test but I'll let you know how those turn out). I'm just wondering, will these events still fire if a UnitDamageTarget or similar event? and just out of curiosity, is there anyway to get the damage type of the damage dealt?
|
|
|
08-24-2012, 06:04 AM
|
#53 (permalink)
|
|
\m/
Join Date: May 2006
Posts: 1,985
|
Hi wiredbomb0, I'm glad you've found use for this!
I don't have a wc3 developing environment on my active machine so I can't test/recall these answers for you, however:
- UnitDamageTarget should be detected
- Damage Dealt type is not possible to detect with wc3's natives, but you might consider looking for a system that attempts to do it!
Good luck
|
|
|
08-24-2012, 11:33 AM
|
#54 (permalink)
|
|
MORE CONTESTS PLS
Join Date: Nov 2008
Posts: 3,554
|
Quote:
Originally Posted by Mr_Bean987
Hi. I'm not great with damage detection stuff, but is there a way to detect only physical attacks with this system?
EDIT: I tried it with a Paladin casting Holy Light on an Acoltye. The result messages:
Paladin dealt 0.000 damage to: Acolyte
Paladin dealt 100.000 damage to: Acolyte
|
Cause holy light does damage to undeads...
__________________
Nobody dies a virgin, life fucks us all. - Master Arena is alive! v4.0 in construction. - Dr Super Good for president! - Sorry derps but I do not do requests unless they prove themselves worthy of my time.
My Resources! - Help me out with my project! - How To Import vJASS spells tutorial! - Practice makes perf... improves you.
Quote:
Originally Posted by Marc Mamales
Hey guys, please fix my spells, cz i dont know how to make it GUI.
|
|
|
|
08-24-2012, 12:14 PM
|
#55 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
That makes sense. There are often times in the game where units receive 0.000 damage (for example when the Faerie Fire spell is cast).
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
08-24-2012, 01:21 PM
|
#56 (permalink)
|
|
MORE CONTESTS PLS
Join Date: Nov 2008
Posts: 3,554
|
Quote:
Originally Posted by Bribe
That makes sense. There are often times in the game where units receive 0.000 damage (for example when the Faerie Fire spell is cast).
|
Exactly so I bet it first triggers healing and if it is undead then it does damage instead. Yet the check itself 0. damage I do wonder why
__________________
Nobody dies a virgin, life fucks us all. - Master Arena is alive! v4.0 in construction. - Dr Super Good for president! - Sorry derps but I do not do requests unless they prove themselves worthy of my time.
My Resources! - Help me out with my project! - How To Import vJASS spells tutorial! - Practice makes perf... improves you.
Quote:
Originally Posted by Marc Mamales
Hey guys, please fix my spells, cz i dont know how to make it GUI.
|
|
|
|
08-24-2012, 06:05 PM
|
#57 (permalink)
|
|
JESUS MAN
Resource Moderator
Join Date: Dec 2008
Posts: 5,693
|
I think it's because they just call a "deal damage" function and lookup the damage using a function that determines how much needs to be done given the type.
That function would return 0, and hence, 0 damage is dealt, and it fires an event.
|
|
|
08-30-2012, 11:24 PM
|
#58 (permalink)
|
|
still using waits
Join Date: Jul 2011
Posts: 934
|
Quote:
Originally Posted by wiredbomb0
... and just out of curiosity, is there anyway to get the damage type of the damage dealt?
|
it is more efficient to have every unit's damage type preset into a variable and to trigger the rest of the damage, if you think about it most of the time there are several different groups of units. for example you can have 20 footmen or 10 archers there is no point getting every unit's damage type and even if you get the damage type of a group of units there is still no need to make a system which detects something as constant as damage type as for triggered damage, that can easily be detected what type it is by using integer comparisons so since there is no native to get the damage type you will have to set it manually, if there was a system it will only save you about 4-5 minutes of work
|
|
|
01-18-2013, 08:45 AM
|
#59 (permalink)
|
|
\m/
Join Date: May 2006
Posts: 1,985
|
I've updated this system with a big improvement to the code including:
- No more support for useless things like DEAD_UNITS_ARE_NULL. If you need that kind of optimization, you can remove dead units yourself in a separate trigger.
- Improved and shortened the API substantially.
- Improved code commenting with document style explanations for each function.
- Fixed a massive bug in the add function.
- Paved the way for a coming DamageType extension.
I am curious if anyone is interested in extended support for things like:
- Deallocating handlers
- Registering special buckets for units that are never removed (eg heroes)
- Included "safe" damage target by code functions (will be included regardless in the DamageType extension)
- Introducing priority handlers that will occur sooner than others
Cheers,
Last edited by Cokemonkey11; 01-18-2013 at 11:27 AM.
|
|
|
01-19-2013, 07:25 PM
|
#60 (permalink)
|
|
User
Join Date: Apr 2012
Posts: 978
|
deallocating handlers sounds good, sometimes I want to detect something only for certain time but I still can lock the function with boolean(it will not prevent it from running tho)
priority handler hm...I dont care really but there are situations where you want something to happen before something else
the rest I dont really care, I wouldnt find use to those but maybe there are people that would
by the way, I have one question, since you mentioned it detects UnitDamageTarget, will this cause infinite loop?
Jass:
scope a initializer init
private function handler takes nothing returns nothing
call UnitDamageTarget(GetTriggerUnit(), GetEventDamageSource(), ...)
endfunction
private function init takes nothing returns nothing
call StructuredDD_ddbucket.addHandler(function handler) //or how :D(too lazy to chcek correct syntax)
endfunction
endscope
?
__________________
[22-00-51] Geries: edo494, no
[22-00-57] Geries: edo494, but I'm gay
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 08:57 PM.
|