| 05-12-2009, 03:48 AM | #1 |
I have a bunch of very simple effect-generating functions defined in my map. Yet, somehow, at almost random times, they will seemingly run by themselves for no apparent reason. I've rewritten them many times to use sleeps or polled waits, locations, coordinates, etc. Each time, the problem still happens. One unit will start an action, then on a 1/30 chance (roughly): suddenly BAM, the fire3 (or fire2, ice1, whatever; it's fairly random but biased more toward the functions that are defined first) effect appears out of nowhere. However, the function is not supposed to be called. In fact, looking at the script, by any sane logic it cannot possibly have been called. I checked the map's generated script, and it shouldn't be doing this. I mean, it's kinda hard to miss a function call, especially with the "find" button in text edit. Perhaps someone with a deeper understanding of WarCraft III's horrible coding will be able to explain why the hell these functions seemingly call themselves. |
| 05-12-2009, 04:40 AM | #2 |
Post the code? |
| 05-12-2009, 02:02 PM | #3 |
It possibly has to do with the entire map. |
| 05-12-2009, 02:17 PM | #4 |
Could it be that you're creating and killing the effect somewhere off screen, so its actual animation waits until it is viewed to run? I know dying destructibles sometimes only play their death animation when you finally look at them, even though they are long dead. |
| 05-13-2009, 12:03 AM | #5 |
The camera is always fixed on the battle at all times. It does not move. |
| 05-14-2009, 04:23 AM | #6 |
New problem: In addition to the aforementioned impossibilities, 90% of the units in the map lose/toggle the locust ability after a battle is over (might be during it, dunno). But the function to remove locust appears NOWHERE in the entire map. |
| 05-14-2009, 05:35 AM | #7 |
ShowUnit removes all aspects of locust except for invulnerability |
| 05-14-2009, 01:10 PM | #8 |
That's weird, considering it didn't affect one unit out of all those that were hidden. |
| 05-21-2009, 03:13 AM | #9 |
Well, the locust problem has been resolved. Unfortunately, the random functions calling themselves problem still exists despite numerous iterations of rewrites and preventative measures. Also, another issue has surfaced: After extended play, the camera slowly f*cks up. There's no way to describe it other than the camera slowly moves toward a random rotation, while at the same time becoming vertical while zooming in. This process gets faster as the game goes on. One person with an exceedingly bad computer reports the camera smashing clear into the dirt. The weirdest part about this is during this time, the players' cameras are NOT being modified by triggers in any way, shape, or form. |
| 05-21-2009, 04:03 AM | #10 |
Sounds like you should delete your entire map and start over. |
| 05-21-2009, 05:02 AM | #11 |
I've noticed the camera problem in other maps. I don't think starting over would make a difference at all. Not to mention it would be a massive undertaking considering it took a month to get to this point. My problem here is with WarCraft III bugs, not map bugs. I need ways to work around them. |
| 05-21-2009, 05:37 AM | #12 |
Nobody else has problems with the camera randomly moving around or functions randomly calling themselves. If those problems existed, WC3 modding in general would be pointless, because no one could ever create a working map. The problem is with your code. If the issues are so obscure that you can't figure out what the heck is going on, you're probably using outdated coding practices. |
| 05-21-2009, 05:51 AM | #13 |
The camera bug happens when a camera is applied or reset often. I have no idea why... I could probably work around it by forcing the player's camera to be a certain height, rotation, etc. The random functions, though, are totally weird. The function will call itself if the line that calls it is ANYWHERE in the trigger, even if the conditions make it entirely impossible several times over. It's as if the game randomly skips through a hundred hurdles just to randomly pick one of my functions to run, and it basically runs as I call it in that trigger. Why would WC3 simply ignore all if statements for lines that call user-defined functions? This is not something that could be fixed with a rewrite (unless I rewrote it as an even more convoluted system that used structs and such to completely bypass the purpose of the functions in the first place). A rewrite of this system is much more time consuming than starting a physics system from scratch (yes, I've done it before), so I'd rather revise than blindly start anew. |
| 05-21-2009, 06:01 AM | #14 | |
Quote:
|
| 05-21-2009, 01:11 PM | #15 |
How can the code be flawed if the functions being called are logically impossible to be called? I even did a test at one point by making an If-then statement. If 0 > 1 then blah, and I had a function that calls one of the functions I made. Sure enough, after some duration that function was indeed called once the trigger was run for the umpteenth time. What is handle stack corruption? I do have an extremely large amount of variables (around 140, most of which are arrays, many of which are large arrays), would that make a difference? |
