Page 1 of 1

Not sure why my trigger doesn't work anymore

Posted: Wed Jul 06, 2011 11:28 pm
by BugMeNot
Okay so the map I have been working on is called Lines of War. There are 5 lanes where 2 players battle each other at the same time. (10 player game) When a player defeats another player, the victorious player is supposed to advance up the ladder and play another winner from another lane. (this continues until last 2 players duel) The triggers (referring to changing positions after a win) i have in place have recently stopped working correctly and the map is unfortunately unplayable now:( I would very much appreciate it if someone can spend the time opening the map/testing themselves and see why my trigger(s) have stopped working. Better yet, if you can recreate the system i am using in your own way with triggers that would be Amazing!!! and 3ice, this is the map where the dumb bug changes the armor/attack types but i found a solution. I would absolutely love whoever can help me out on this, since the map is ready to be released after this bug is fixed. And if its ok..., i would like to promote this site with my map since you guys have been very helpful so far. I will attach map and if u have questions, please ask.

Re: Not sure why my trigger doesn't work anymore

Posted: Thu Jul 07, 2011 11:45 am
by 3ICE
Hi,

Could have at least told us where to look. Oh well at least this way I look through most of your map before finding it :)

First, lets turn 30 triggers into 3 by using the player number of triggering player logic.
for Build/Cancel/Done:
Building Building
ImageImage Events ImageImageImage Unit - A unit owned by Player 1 (Red) Begins construction ImageImageImage Unit - A unit owned by Player 2 (Blue) Begins construction ImageImageImage ... ImageImageImage Unit - A unit owned by Player 10 (Light Blue) Begins construction ImageImage Conditions ImageImage Actions ImageImageImage Set Building[(Player number of (Triggering player))] = true ImageImageImage Set CurrentBuild[(Player number of (Triggering player))] = (Constructing structure)
And lets not use integers (1) where booleans (true) are sufficient.

Image Create Recruits has a serious amount of memory leaks. Consider using a unit group (that you update every time a building is killed/completed) instead of Image Units in (Entire map)

In the Image Swap Control trigger (and many others) Last-Chance is cleaning up after variables that do not leak. Looks like someone needs to re-read a memory leak tutorial.

The Image Castle Destroyed trigger is relying on undefined behavior. First you remove the (Dying unit) and then look for it in various regions. You shouldn't find something that was removed just a moment ago. (Even if it works now, it might get fixed later and break your map.)
Also, this actually gets you the Killed player 50% of the time and not the Killer:
Image Unit Group - Pick every unit in (Units in layer1 <gen>) and do(
Image If ((Unit-type of (Picked unit)) Equal to (==) Castle) then do(
Image Set Killer = (Owner of (Picked unit)))
because the removed castle is still there.
And you should use the more efficient
Image Unit Group - Pick every unit in (Units of type Castle) and do (
Image If ((layer1 <gen> contains (Picked unit))) then do (
Image Set Killer = (Owner of (Picked unit))
which is also shorter. (Pick the 10 castles and then find the one in layer1 vs. Pick about 600 units in layer1 and then find the castle. Looking through just 10 units is better than all 600.)


Image Building Bug is not actually a bug. The Image Unit dies event is supposed to fire for canceled buildings too. Good job catching and handling it properly though.

Image Critical Strike Autocast actually autocasts Cripple and I have no idea what it is supposed to do. Why create a dummy when the necromancer already began casting cripple? This will either imbalance the game letting one necromancer cast cripple on every enemy or just create entirely useless dummy units as cripple has already been cast on the target once. (Critical Strike is not a spell, but a passive ability anyway)

The correct spelling of the prophet's name is Medivh, not Midivh.

Thats all for now. Sorry I couldn't find which trigger you wanted me to fix. Though I did find a lot of other fixable triggers ;)
Keep us posted.

--3ICE

Re: Not sure why my trigger doesn't work anymore

Posted: Sun Jul 10, 2011 11:51 am
by LastChance
The "Critical Strike Autocast" is my trigger. I know my triggers should be fine and pretty much completely leakless, I do sometimes make mistakes.

Before you say that trigger is useless you need to get some facts.
There is no AI script for the computer so all spells must be set into an auto cast. Spells that are not auto-castable must be triggered to do so. To trigger and auto cast cripple I took the Slow Spell for the Tooltip Spell and the Dummy Spell is obviously cripple, when the Warlock casts it's "Slow" the slow debuff is immediately cancelled and the "Critical Strike Autocast" trigger fires making the slow spell have a Cripple effect.

I misnamed it for god knows why. But it doesn't hurt anyone, so I didn't go back and rename it when I noticed I had misnamed it.

As far as clearing all of my variables goes; it doesn't hurt the trigger. And I have my own organization. If you don't want to clear those variables in your triggers then it's your trigger. But in my triggers I will clear all variables... except for the Swap Control. Though it's not easy to fix and make the triggers with you and kent rushing me through it, Boss.

As for the idea to replace 30 triggers the "Swap Control" was used to replace a ton of triggers too. Originally he had a trigger to switch control for every player.

Re: Not sure why my trigger doesn't work anymore

Posted: Sun Jul 10, 2011 12:24 pm
by 3ICE
Hi,
LastChance wrote:I took the Slow Spell for the Tooltip Spell and the Dummy Spell
That is very smart. And now I understand what that trigger does :) If you want you can rename the spell to Slow (Cripple Dummy) to avoid confusion, it wouldn't affect the ingame tooltip.
LastChance wrote:Originally he had a trigger to switch control for every player.
Ouch. Good job fixing that for him.

--3ICE

p.s.:
LastChance wrote:As far as clearing all of my variables goes; it doesn't hurt the trigger. And I have my own organization. If you don't want to clear those variables in your triggers then it's your trigger. But in my triggers I will clear all variables...
It hurts the trigger by making it unnecessarily big and the players' computers have to do extra work every time the trigger is executed. Focus your energy on what matters; real memory leaks.
Integers don't leak. Handles do. (units, points, etc)

Re: Not sure why my trigger doesn't work anymore

Posted: Fri Nov 25, 2016 11:50 am
by 3ICE
The "Critical Strike Autocast" is my trigger. I know my triggers should be fine and pretty much completely leakles, I do sometimes make mistakes.

Before you say this is useless you need to get some facts.
There is no AI script for the computer so all spells must be set into an auto cast. Spells that are not auto-castable must be triggered to do so. To trigger and auto cast cripple I took the Slow Spell for the Tooltip Spell and the Dummy Spell is obviously cripple, when the Warlock casts it's "Slow" the slow debuff is immediately cancelled and the "Critical Strike Autocast" trigger fires making the slow spell have a Cripple effect.

It is misnamed because it was late when I made the trigger and I was thinking about my Crippling Strike spell from my Warchasers when I was doing it so for some reason I wrote Critical Strike


The great draft takeover! Originally drafted on 2011/07/10 17:51:04 by LastChance(953) Never posted. Until now. :)