| 08-21-2006, 11:57 AM | #1 |
How can i make a tree respawn trigger that waits 10 seconds then respawns trees? it must be in GUI because im no Jass expert. ive already tried many things that would seemingly work but they dont..... somewon plz help me! |
| 08-21-2006, 01:52 PM | #2 |
I don't think it's possible in gui, the trigger register destructable death region is capped at 64 destructables. create a trigger called Restore Trees and paste this, it will revive all destructables after 10 secs JASS:function RestoreTrees takes nothing returns nothing local destructable d = GetDyingDestructable() call TriggerSleepAction(10) call DestructableRestoreLife(d, GetDestructableMaxLife(d), true) set d = null endfunction //=========================================================================== function RestoreTreesAddEvent takes nothing returns nothing call TriggerRegisterDeathEvent(gg_trg_Restore_Trees, GetEnumDestructable()) endfunction function InitTrig_Restore_Trees takes nothing returns nothing set gg_trg_Restore_Trees = CreateTrigger() call EnumDestructablesInRect(bj_mapInitialPlayableArea, null, function RestoreTreesAddEvent) call TriggerAddAction(gg_trg_Restore_Trees, function RestoreTrees) endfunction |
| 08-21-2006, 02:36 PM | #4 |
aquilla your version is going in my map and you going in my credits! because zeros version is (dying distructible) its not multi instancable (sorry) |
| 08-21-2006, 02:44 PM | #5 | |
Quote:
|
| 08-21-2006, 02:55 PM | #6 |
hmmmmm ok illl test it.... if its multi instancable your going in my map creds. |
| 08-21-2006, 03:06 PM | #7 |
mmmmm the respawn trigger only respawns 64 destructibles....ah well... its good until i get a better one in |
| 08-21-2006, 03:16 PM | #8 |
Thank you for using my trigger. |
| 08-21-2006, 04:46 PM | #9 |
JASS: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 endfunction JASS:constant integer bj_MAX_DEST_IN_REGION_EVENTS = 64 The GUI trigger will work great if you have 64 trees in your map, otherwise it will only regrow the first 64 trees it encountered. aquilla's trigger fixes this issue. |
| 08-21-2006, 06:53 PM | #10 |
Hmmm. You are right, it dont handle that much trees at once, tested it with 500 trees and destroyed all of them. Thanks for enlightening me. |
| 08-21-2006, 07:07 PM | #11 |
There's no way to go beyond the 64 destructable limit? |
| 08-21-2006, 07:29 PM | #12 |
look up* |
| 08-21-2006, 09:52 PM | #13 |
you might also be able to do this on map init and use gui-triggers Trigger: Custom script: set bj_MAX_DEST_IN_REGION_EVENTS = 10000 |
| 08-22-2006, 02:25 AM | #14 | |
Quote:
Ah, what I meant was: "Is there no possible way to exceed the 64 destructable limit in GUI?" |
| 08-22-2006, 06:06 PM | #15 |
the custom script code makes an error when saving.... O.o and i cant get the jass to work!!!!! aquilla please make a map on world editor with the jass on it and attach it to one of your posts. |
