| 12-12-2008, 09:45 PM | #1 |
About leaks and performance, Its just a test to see the different damages on armor types, don't need to be perfect. The error is on the "private function DamageType" Specifically after call DisplayTextToForce(GetPlayersAll(), "Casting a 100 damage chain lighting") The message shows, also shows that unit took 0 damage (by FDamage function), the dummy caster is created but it don't cast the ability... Also, the unit don't have the expiration timer, why? I can control him and can cast manually the chain lighting, also, I tried preloading the unit... Nothing worked. Ps: A cookie to anyone that kills me. (The isle in the down / right) Edit: Attach removed, trigger working! |
| 12-13-2008, 12:58 AM | #2 |
Get the Caster System on this site's resources. I had a couple issues with dummy casters myself, and I even figured out some things to fix them, but in the end it was easier to just get it ready made. It requires vJass, tho. If you don't feel like using NewGen (I recommend it), here is a tip I got from the guys here recently: First, dummy caster usually take around 0.4 seconds to cast a spell, even if it's instant. However, if you remove the 'amov' ability from the unit (via JASS), and set its turn speed to whatever (via JASS, too), it becomes an instant caster. You can create this unit on map startup (or more than one) and just keep them around. Second, give the caster unit an invisible model: use Doodads->Elevator Wall. Third, remember to give the caster the ability you want him to cast! This sounds kinda obvious, but still. You don't need to make a custom unit with the spell you want, you can add the ability in gametime, and remove it as soon as it is cast. Fourth: remember mana costs. Either set the ability to cost zero, of give your dummy caster lots of mana. Mana cost zero preferred, as it's less likely you screw up with something. Fifth... first time you use the dummy, it lags. Caster System comes with a preload function, to go on map initialization. Run it for every ability you need a dummy to cast. If you're not using Caster System, at least read it and see how it was done, cause I didn't. I think that is it. Have fun. |
| 12-13-2008, 01:09 AM | #3 |
The caster system is old, though. I'd recommend xe instead. |
| 12-13-2008, 01:26 AM | #4 |
Really? What he said, then. I'll try it myself. |
| 12-13-2008, 07:04 AM | #5 |
Personally id do something like this... JASS:
set u =CreateUnitAtLoc(Player(0), 'n000' GetRectCenter(gg_rct_Region_001), 90)
call UnitApplyTimedLife(u, 'BTLF', 3)
call IssueTargetOrderBJ(u, "chainlightning", tempunit)
I'm sure get last created unit should work, I don't trust it myself though. Try that out and see if it fixes it. |
| 12-13-2008, 07:14 AM | #6 |
It should, as CreateUnitAtLocSaveLast() is the function you should use if you want to use the lastCreatedUnit shit. |
| 12-13-2008, 07:27 AM | #7 |
Ya, only thing id be worried about is if you're making to many units at once it getting overwritten before it is used cause all it does is set the global bjlastcreatedunit variable with the last created variable. It's prob not the problem, but worth checkin out at least. |
| 12-13-2008, 07:32 AM | #8 |
As long as there is no breaks within when you call the function and when you use the variable (breaks consist of waits, thread creation [excute function, trigger execute, trigger evaluate], and actions which cause events [kill a unit, order an issue] that cause a trigger to run which over-rides the las created unit), then you won't have a problem. |
| 12-13-2008, 11:53 AM | #9 |
Thanks everyone! I used savelast and worked >.< +rep?(lol) ---- Lol, come'on, dummy caster system? its just a chain lighting on a damage test map o.o" And don't say to make the caster invisible before you are sure everything is working... |
