| 06-03-2008, 10:48 PM | #1 |
I am trying to create a trigger to damage units around destructibles that die (Usually by being knocked into them by knockbacks), but it does not seem to be working. For some reason I cannot select any variable other than 'No destructible'. I can easily add destructibles to variables however. Trigger: ![]() Events
![]() Destructible - No Destructible dies
![]() Conditions
![]() (Destructible-type of (Dying Destructible)) Equal to Summer Tree Wall
![]() Actions
![]() Unit- Create 1 TreeDamage for Neutral Passive at (Position of (Dying Destructible)) facing default building degrees
![]() Unit- Cause (Last Created unit) to damage circular area after 0.00 seconds of radius 500 at (Position of Last Created unit)), Dealing 100 damage of attack type normal and damage type normal.I can easily get the effect I want using 'Destructible within region' but that would force me to make at least 80 regions as it only selects the first 64 destructiblesin the region. I am just wondering if there is a way to check the whole map for dying destructibles at it would make this whole thing a lot eaiser. Any help would be gretly appreciated. Also, if you are wondering about the high damage and radius, it was for testing, and I plan to have different destructibles do different damage for different radius' (trees 50, rocks 80, explosive crates 200, ect) |
| 06-04-2008, 12:00 AM | #2 |
Never use "damage circular area" It desyncs mac users. And if you want knockback, why not use the great knockback system created by dusk? |
| 06-04-2008, 12:16 AM | #3 |
make a dummy invisible/uniselctable unit with permanent inmoalton and spawn him at the poin where the destructible dies wat for x seconds and then erase it. Code:
Create Dummy unit Wait X seconds Destroy Dummy unit ggL&HF! i hope these helps, i know these is not what u where searching for but it will also work. Else i hope someone can tell you how to deal with that trigger^^ cya. |
| 06-04-2008, 12:48 AM | #4 |
I am using Rising Dusks knockback trigger. However, the problem is actually the 'events' part. I Could easily make this work using 'Destructible within region X dies' but that would result in me creating about 80 (Ok, thats a bit of an overstatement but still.) regions as only the first 64 destructables in the region are selected. the 'No Destructable' is apparantly a 'null' value, and the only way to actually select something is to select a Doodad. I was just wondering if there was a way to detect id any kind of destructable on the map dies for the 'events' |
| 06-04-2008, 02:59 AM | #5 |
Just a quick note, but I was using a variation of the 'kaboom' that the clockwork goblins had for the damage. I probably will not use immolation. |
| 06-04-2008, 04:35 AM | #6 |
What I PMed you might be done doing this: JASS:constant function Destructable_TYPEID takes nothing returns integer return 'H000' //This should be replaced by whatever tree type you want it to register for endfunction function Destructable_DamageCheck takes nothing returns nothing return true //This should be changed to discern who to damage endfunction function Destructable_Actions takes nothing returns nothing //Do actions in here, AKA damage endfunction function Destructable_EnumActions takes nothing returns nothing if GetDestructableTypeId(GetEnumDestructable()) == Destructable_TYPEID() then call TriggerRegisterDeathEvent(gg_trg_DestructableDamage, GetEnumDestructable()) endif endfunction function InitTrig_DestructableDamage takes nothing returns nothing local rect r = GetWorldBounds() set gg_trg_DestructableDamage = CreateTrigger() call EnumDestructablesInRect(r, null, function Destructable_EnumActions) call TriggerAddAction(gg_trg_DestructableDamage, function Destructable_Actions) call RemoveRect(r) set r = null endfunction |
| 06-04-2008, 05:45 AM | #7 |
Make a new trigger that runs at map initialization: Pick every destructable of type (tree) in map trigger - add new event to (Your trigger) (picked destructable) is destroyed Might leak a bunch, so if it's not too much of a hassle use Rising_Dusk's code. |
| 06-04-2008, 06:15 AM | #8 |
I am not sure why you think there is a 64 limit. Perhaps there is in GUI but in jass there is not. Here is some code from my Risk Devo map that i use to remove hundreds of trees. Code:
function RemoveTree takes nothing returns nothing if GetDestructableMaxLife( GetEnumDestructable()) < 9999.0 and GetDestructableTypeId( GetEnumDestructable()) != 'B00E' then call RemoveDestructable( GetEnumDestructable()) endif endfunction call EnumDestructablesInRectAll( GetPlayableMapRect(), function RemoveTree ) i do another test for other destructables by type and HP but other than that you could use something like this. Cant remember if this leaks but i only do it one time in my map so i dont care. Have fun! |
| 06-04-2008, 09:01 AM | #9 |
The reference to the 'first 64 destructables' is regarding the fact that this event: Trigger: Destructible - Destructible in <Region> dies |
| 06-04-2008, 03:43 PM | #10 |
Being it was late last night i missed he wanted to detect the dest dying. When i had a need to use this however i would have used the specific dest dying which MIGHT cause lag if you registered 2000 events because that is what you would have to do if you dont use the regions. In either case I then looked at the blizzard code and found something VERY interesting..... Code:
//===========================================================================
function RegisterDestDeathInRegionEnum takes nothing returns nothing
set bj_destInRegionDiesCount = bj_destInRegionDiesCount + 1
if (bj_destInRegionDiesCount <= bj_MAX_DEST_IN_REGION_EVENTS) then
call TriggerRegisterDeathEvent(bj_destInRegionDiesTrig, GetEnumDestructable())
endif
endfunction
//===========================================================================
function TriggerRegisterDestDeathInRegionEvent takes trigger trig, rect r returns event
set bj_destInRegionDiesTrig = trig
set bj_destInRegionDiesCount = 0
call EnumDestructablesInRect(r, null, function RegisterDestDeathInRegionEnum)
return trig
endfunctionThey limit it ON PURPOSE why other than potentional lag i dont know. You could however easily USE this code and then change the # restriction. Hope this helps! |
| 06-04-2008, 05:26 PM | #11 |
Yeh, I tried the 'all units in region using playable map area and it it was only 64 so thats why I said it was that way. Anyways, thanks for your help guys. My map is nearing the 'open beta stage'. All I really need now are some more tier tech types, items, recipes, and some creeps and bosses. I should be done by the end of the week at this rate. |
| 06-04-2008, 08:44 PM | #12 |
The reason i posted the code is to get you to try using the same code but remove the limiting 64..... |
| 06-04-2008, 10:13 PM | #13 |
Sorry RodOfNod, I could not figure out what to change. I'm still in the learning thing for jass. I can read enough to generally know what to modify to suit something and what some of the stuff does, but I did not know what I needed to change for that or what kind of segment it was. Would I just put that in a single trigger to remove the cap or was it something to put in an actual trigger, and if so, where? |
