| 09-15-2009, 08:25 PM | #1 |
I have a spell in GUI, which goes like this: When the unit begins channeling the spell, it turns on another trigger. In this trigger, every .2 second a locust dummy is created in a random location near the caster, and given a .5 life with a "Damage upon death" ability. In essence, everytime the ability is cast there would be random explosions near him for the duration of the spell. The first trigger sets up the variables such as the ability's level which then dictates the level of damage dealt by the dummies, locations, etc. . The second one is the "every .2 second a dummy is created, given the ability level and life timer" trigger, and the third trigger is "when a unit stops casting spells" trigger which turns off the second trigger. The ability is quite simple and shouldn't give me problems BUT IT DOES. Every time I cast this ability near enemy units (or around them) the game crashes. It's a bloody simple 3 trigger spell for shit's sake I don't know why I am getting these ridiculous crashes. I'm starting to wonder if it's a problem with the trigger or with the Widgetizer/Map Optimizer settings. |
| 09-15-2009, 08:39 PM | #2 |
You could have this in 2 triggers, and I'm not an expert, but I think it'll even be multi-instanceable. First trigger detects the channeling and uses a for loop that will last the duration of the spell, checking everytime if the spell is still channeling (eg, caster unit is alive or not). In this for loop, you will run another trigger that will execute the explosion, and you dont even need a dummy unit for that. Just use unit groups to pick the appropriate units and make the caster unit damage picked unit. Depending on how you want the FX to go, you might need a dummy unit (eg, scaling up or down a special effect). I'd make an example for you, but it's past midnight, so best of luck. But if it's still crashing, i'll give it a shot. Could be fun :) |
| 09-15-2009, 08:42 PM | #3 |
If you post your code here you're much more likely to get some meaningful/proper feedback. |
| 09-15-2009, 09:22 PM | #4 |
Heh, you're in luck Matarael. I can't sleep, so I drafted an example of what I meant. See if this spell works. |
| 09-15-2009, 10:16 PM | #6 |
The thing is, the error is likely in your code, not your concept (since it's simple enough that it's unlikely to be wrong). Therefore, describing the concept doesn't bring us any closer to figuring out your problem. |
| 09-16-2009, 06:14 AM | #7 |
One problem I can see with ur code here Matarael is that if your hero/unit casts this spell, and before the 30 seconds are up some other hero/unit casts this same spell, it's going to stop midway because the timer will not have reset. If you wanna use 'Event - Elapsed Time' i suggest using Array Booleans instead, but then again, this method will only be applicable for 1 unit per player, unless you use another variable for the array (like a Custom Value that you apply to the caster), but it's bond to get convoluted at one point, so keep it simple i suggest. |
| 09-17-2009, 12:57 PM | #8 |
Well, user Spellbound, your script does indeed work and will achieve what I basically sought to do. However I want to avoid using it heheheh simply because I am really curious as to what made mine cause the error. It is really that simple and in a test map with nothing in it (just the hero, dummy, and test creeps) it doesn't give me the error. For some reason I keep thinking that it might be either the Widgetizer or Map Optimizer setting that's causing it. It's always right after I cast it in the middle of enemy units. So something within the second (the every .2 second bit) trigger is causing a memory failure. I'm aware that it's not multi castable, but I'd like to solve this issue before going for a multi castable version hahaha. |
| 09-17-2009, 01:11 PM | #9 |
as you wish. best of luck in hunting down the problem ^^ |
| 09-17-2009, 02:57 PM | #10 |
If I don't manage to, I might alter your script to simplify it and use that instead. Although it will be a lot of work to not only adapt it to my map but also device a way to make it upgradable. Many variables will need to be written and I always like my spells to be simple (i.e. using the dummy unit as the actual special effect itself instead of creating a special effect by using a trigger). |
| 09-17-2009, 05:51 PM | #11 |
The spell should be fairly simple to modify. |
| 09-18-2009, 12:44 AM | #12 |
Well I found the problem. It's indeed in the Optimizer and Widgetizer setting(s) although I've yet to pin point the exact options which causes the error (which is complicated since I use both programs). I know that from the Optimizer I can't turn on "Optimize Script" and "Remove Editor Suffixes", "Remove Editor Only Files" and "Remove as much WE only data as possible", but turning on everything else seem to be ok. As for the Widgetizer, there's another problem. If I turn off the functions there the map takes 10 million years to open in the game. But if I turn on some of the functions the spell crashes AGAIN. Maybe I will start looking at the forum threads/topics accompanying these programs. |
| 09-19-2009, 06:05 PM | #13 |
BREAKING NEWS I finally figured out exactly why this crashes WC. It's not the trigger. It's not the script, and it turns out it's not a problem with the Widgetizer and Optimizer, but with the base ability I used. You see, I used Starfall as the ability base because it channels without target. I 0'd all the variables such as damage and number of waves etc. And for some strange reason this was the cause of the crash. I figure, it has something to do with the target or the numbers but I don't really care enough to try and figure that out now. All I know is that after I changed the base dummy ability it doesn't crash anymore. Ever. Holy shit you won't believe how many variables, saves and retries I did just to finally figure this out ¤%&#¤%#"¤%#&¤% this. Let it be a lesson to everyone else: be careful what variables you put in abilities, it might crash the game and lead you to certain madness. |
| 09-19-2009, 06:14 PM | #14 |
Wow, congratulations then, lol. Just one question, did you also 0 the interval? If you did, the it Must be the problem. 0 interval means infinite waves per second lol. |
| 09-19-2009, 07:32 PM | #15 |
YES I did. So perhaps that's the problem LOL. I thought 0 interval means no intervals. **** me. |
