Not sure why my trigger doesn't work anymore

Do you need World Editor help? Ask here!
Before making a new topic:
First, check if your question has already been answered in the Tutorials section.
If you didn't find a solution, use the search function.
If searching didn't help either, you can make a new topic.

Topic title & content:
You must use a descriptive title. (Help plz is not good) (Need help with Dialog buttons is good)
Go into much detail when posting. You should post attachments. Like screenshots of the problem, the map you are making, replays of the error. Or you could even make a screencast (video) of your problem and upload it here.

Spelling:
Grammar seems to be a serious problem amongst teenagers, so use a spell checker or you will get no love.
Read your posts twice, before pressing the reply button.
And do not use profanity. Chatspeak (y r u nub) and Leetspeak (1 C4N S33 H4X) are not welcome here either.

Only World Editor related questions are allowed here!
(Click for Battle.net help) (Click for World Editor help)

Not sure why my trigger doesn't work anymore

New postby BugMeNot on Wed Jul 06, 2011 11:28 pm

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.
Attachments
LoW v1.3.01.w3x
(924.87 KiB) Downloaded 402 times
This is a guest account intended for use by people who wish to remain anonymous or hate registering.
(Please don't forget to sign your posts with your name if you want us to know who you are.)
http://www.bugmenot.com/view/3ice.hu
User avatar
BugMeNot
 
Posts: 98
Joined: Wed Jan 21, 2009 12:46 pm

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

New postby 3ICE on Thu Jul 07, 2011 11:45 am

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
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2126
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

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

New postby LastChance on Sun Jul 10, 2011 11:51 am

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.
LastChance
 
Posts: 1
Joined: Sun Jul 10, 2011 5:13 am
Realm: US East
Account: Last-Chance
Clan: TsF

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

New postby 3ICE on Sun Jul 10, 2011 12:24 pm

Hi,
LastChanceI 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.
LastChanceOriginally he had a trigger to switch control for every player.
Ouch. Good job fixing that for him.

--3ICE

p.s.:
LastChanceAs 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)
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2126
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE

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

New postby 3ICE on Fri Nov 25, 2016 11:50 am

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. :)
ImageImageImageImageImage
Image
ImageImage
User avatar
3ICE
Admin
 
Posts: 2126
Joined: Sat Mar 01, 2008 11:34 pm
Location: Hungary
Realm: US East
Account: 3ICE
Clan: 3ICE


Return to HELP



Who is online

Users browsing this forum: No registered users and 4 guests

cron