I am facing a problem with some triggers. Basically, I am making an income system where you build a building and it increases your income, and then if you salvage that building, your income will decrease.
It works fine for increasing the income, but for decreasing the income it only works for some buildings but not for others - Even though they are all under 1 trigger, which is baffling.
These are my triggers for increase income (which works fine):
I dunno it seems to work for (some or all, not sure) terran and some zerg buildings - not even all of them and no protoss buildings. Its weird. And yes all these buildings have the salvage ability - not another ability. Even if I take out the condition that has to be a salvage - I get the same result. If you can locate the problem or know a better method of doing this please let me know and it is very much appreciated
Wouldn't it be easier to add a behavior to the structure itself that gave you resources over time? That way when the structure isn't there ... behavior just goes away, and you stop getting income. I haven't tested it or done anything like this, but i'm ... 90% sure this could be done.
i assume the death type of your non working buildings is wrong, can you test it without the condition?
also nice to add some text output inside the trigger to see which code gets executed and which not, sooo:
does the trigger fire at all?
How often does it fire?
does the trigger get into the If-Statement?
Though it's fairly easy both ways, I think using behaviors is better for this sort of thing. Be sure to click the flag that disables it for under construction buildings.
Hello everyone
I am facing a problem with some triggers. Basically, I am making an income system where you build a building and it increases your income, and then if you salvage that building, your income will decrease.
It works fine for increasing the income, but for decreasing the income it only works for some buildings but not for others - Even though they are all under 1 trigger, which is baffling.
These are my triggers for increase income (which works fine):
http://gyazo.com/4cac2397bec0f104a39cc728859dfc0a
These are my triggers for decrease income (which is not working properly):
These buildings work: http://gyazo.com/6fca1f8ee982c5df77bdbd19c9191729
These dont: http://gyazo.com/a2223d4c224c83ec4df754a8bdf58246
They are all under 1 trigger (for the decrease income)
Here is my whole decrease income trigger:
I dunno it seems to work for (some or all, not sure) terran and some zerg buildings - not even all of them and no protoss buildings. Its weird. And yes all these buildings have the salvage ability - not another ability. Even if I take out the condition that has to be a salvage - I get the same result. If you can locate the problem or know a better method of doing this please let me know and it is very much appreciated
Wouldn't it be easier to add a behavior to the structure itself that gave you resources over time? That way when the structure isn't there ... behavior just goes away, and you stop getting income. I haven't tested it or done anything like this, but i'm ... 90% sure this could be done.
i assume the death type of your non working buildings is wrong, can you test it without the condition?
also nice to add some text output inside the trigger to see which code gets executed and which not, sooo:
does the trigger fire at all?
How often does it fire?
does the trigger get into the If-Statement?
http://www.sc2mapster.com/forums/development/data/10894-how-to-make-a-building-generate-minerals/
this has instructions on how to do it via behaviours. (I'm not a trigger guy, I'm a data guy, so I always try and solve problems via data editor ... )
Though it's fairly easy both ways, I think using behaviors is better for this sort of thing. Be sure to click the flag that disables it for under construction buildings.
Thanks for the replies but I am an idiot.
The ones that worked
For the ones that did not work:
Look at the conditions - I cant believe I missed that - the ones with *...
The second one has to be unit type of triggering unit . NOT CREATED UNIT