Hi I have a problem with a trigger, I'd hope you would help me on this one.
This trigger is called when an "custom achievement" requirements are acquired.
It is supposed to set data and send it to a general trigger with local variables that will show a nice lilttle frame that informs you of the achivement you just won.
Here is the code :
Quote:
Variable - Set CurrentNumber = 1
Variable - Set AchievementNumber = 3
General - If (Conditions) then do (Actions) else do (Actions)
If
AchievementMenuSelectAchievementLocked_Boolean[AchievementNumber][CurrentNumber] == true
Then
General - Wait for (Conditions), checking every 1.0 Game Time seconds
Conditions
(Achievement Notice is on) == true
Trigger - Run Achievement Notice (Check Conditions, Don't Wait until it finishes)
Else
As I don't want several achievements notices to pop at once, I've put a "wait for condition" function waiting for the trigger to be on to run.
Now when tested, the first achivement notice pops normally, but the second just show an error :
It says basically that an error occured when Starcraft 2 was launched, and I need to try again (Now I have no idea why the message is in french, I'm french but never finished an installation of the game in that language.)
Why is this happening ? It seems it's the "wait for condition" function that makes it bug, if I remove it, the two achievements pops at the same time but works correctly.
Any solutions ?
First of all I would create one public dialog and then change images/values of that. I dont know if it makes a difference, but I would do it that way, instead of creating the dialog over and over again.
Second I dont know why you have that turn trigger off and on...one of the bugs could be you turn off the trigger and then try to run it when its OFF?
yea...I think it might be the thing you turn it off. Cant think of anything else right now :/
It could be that I try to run the trigger when it's turned off, then again before the trigger is run, there's a "wait for condition" that check if the trigger is true, so it's unlikely.
Then at first my launching trigger was using a wait for condition checking a bolean, set true at the begining of the achievementnotice trigger, and set false at end.
Still I'll do a test and try to run a turned off trigger !
Then this is the only dialog I chose to create to show : there is multiple players, multiples achievements ; I didn't want to go on creating arrays of dialogs for players and each achievements for it will be rare that many achievements pops at once. So I've got a trigger sending specific data and a general trigger processing it and doing the whole dialog and show to player actions.
If only one achievement pops up at a time, then you definetly can use only one dialog....If you check my youtube videos, I only use one dialog for eveything I need (example I made a dialog spell bar, I can set different images to same dialog for different players).
Depending on your needs...You might need to make one or more dialogs....
There is also condition for checking if dialog is visible for player. That could be usefull if you made only one dialog as global variables (if its visibile dont show another achievement).
@zenx1: Go
Yeah but what if two achievement is earned by 2 players at the same time ? I can't use the same dialog for several players. I don't think all the actions are player specific.
So I've tryed to remove the turn off and turn on trigger and replaced them with a boolean. Still doing the same error. So nothing to do with running a turned off trigger.
So no Ideas anymore. I still think you could do it with 1 dialog, since you can show/hide dialogs to specific player, change texts, images etc...for specific player...but Im not gona mess up your triggers more :D. Gl on fixing it
Just like he said: Use one dialog for each player. You can do really anything concerning a dialog or dialog controls for a single player. (Maybe you need to sometimes convert a singleplayer to a player group)
I currently don't have the time to go through your complete trigger, but you should remember that turning a trigger off only diables the events registered to it, instances currently running will finish running or creating new instances directly will work anyways.
- Okay, he already told me about the dialog. But that's apparently not the issue because in my first five achievements, the triggers can add themselves without a problem and the triggers are run one after another as intended.
- I do know turning off or on a trigger does not act on the way it is run, but it is just a way to check if the trigger is occupied or not. I have prooved that it's not the issue remplacing that with a boolean check.
I hope someone can help, I'm looking into it atm myself.
So as I thought this was not coming from this long-ass general dialog creation trigger but from the trigger providing the data.
Quote:
Variable - Set CurrentNumber = 1
Variable - Set AchievementNumber = 3
General - If (Conditions) then do (Actions) else do (Actions)
If
AchievementMenuSelectAchievementLocked_Boolean[AchievementNumber][CurrentNumber] == true
Then
General - Wait for (Conditions), checking every 1.0 Game Time seconds
Conditions
(Achievement Notice is on) == true
Trigger - Run Achievement Notice (Check Conditions, Don't Wait until it finishes)
Else
Problem was that those integer variables were lost during the "wait for condition" function. So what here's what I've put :
Quote:
Variable - Set CurrentNumber = 1
Variable - Set AchievementNumber = 3
General - If (Conditions) then do (Actions) else do (Actions)
If
AchievementMenuSelectAchievementLocked_Boolean[AchievementNumber][CurrentNumber] == true
Then
General - Wait for (Conditions), checking every 1.0 Game Time seconds
Conditions
(Achievement Notice is on) == true Variable - Set CurrentNumber = 1
Variable - Set AchievementNumber = 3
Trigger - Run Achievement Notice (Check Conditions, Don't Wait until it finishes)
Else
I've put the correct integers for both before the checking and after. Not a very clean trigger but at least it'll work.
Looks to me like there must be some external function interfering with those values between the time you are waiting and the time you are running Achievement Notice. I think a better solution to your issue would be to make sure that those values are not changed, either by storing them in another temporary variable while waiting or ensuring that whatever functions are using them do not access them untill they are done being worked with.
Your current fix may be working at the moment but, because of the multi-threaded nature of triggers, you might stumble upon instances where your CurrentNumber and Achievement Number are still being altered between the moment you set them and the moment you run Achievement Notice.
Thanks for your answer. If the SC2 triggers just works the way W3 did, then there is no wait time between this trigger and the runned trigger so it's fine.
Thing is, integer variables named AchievementNumber and CurrentNumber in the GENERAL trigger instantly are set to match local integer variables called CURRENTAchievementNumber and CURRENTPlayer. Since they are local variables, they are specific to the trigger and are not lost in the process with wait functions - and the global integer variables are never used in this trigger.(you can check it in the attachemed image of my previous post)
Thanks you for your concern though. If you still think my triggers are flawed, please tell me.
Hi I have a problem with a trigger, I'd hope you would help me on this one.
This trigger is called when an "custom achievement" requirements are acquired.
It is supposed to set data and send it to a general trigger with local variables that will show a nice lilttle frame that informs you of the achivement you just won.
Here is the code :
As I don't want several achievements notices to pop at once, I've put a "wait for condition" function waiting for the trigger to be on to run.
Now when tested, the first achivement notice pops normally, but the second just show an error :
It says basically that an error occured when Starcraft 2 was launched, and I need to try again (Now I have no idea why the message is in french, I'm french but never finished an installation of the game in that language.)
Why is this happening ? It seems it's the "wait for condition" function that makes it bug, if I remove it, the two achievements pops at the same time but works correctly.
Any solutions ?
sad bump :(
I bet there are still more triggers involved. What makes you think that the problem is in those specific triggers?
From what we see now, its impossible to tell what the problem is. Post more triggers or the map if you want help....
@zenx1: Go
Like I said
But maybe it's the Achievement Notice Trigger that bug. I'll paste it here
I hope you guys can help me. I know it's a big trigger but only minds what could be the bug maker like loops or something.
First of all I would create one public dialog and then change images/values of that. I dont know if it makes a difference, but I would do it that way, instead of creating the dialog over and over again.
Second I dont know why you have that turn trigger off and on...one of the bugs could be you turn off the trigger and then try to run it when its OFF?
yea...I think it might be the thing you turn it off. Cant think of anything else right now :/
@zenx1: Go
First, thanks for the help.
It could be that I try to run the trigger when it's turned off, then again before the trigger is run, there's a "wait for condition" that check if the trigger is true, so it's unlikely.
Then at first my launching trigger was using a wait for condition checking a bolean, set true at the begining of the achievementnotice trigger, and set false at end.
Still I'll do a test and try to run a turned off trigger !
Then this is the only dialog I chose to create to show : there is multiple players, multiples achievements ; I didn't want to go on creating arrays of dialogs for players and each achievements for it will be rare that many achievements pops at once. So I've got a trigger sending specific data and a general trigger processing it and doing the whole dialog and show to player actions.
If only one achievement pops up at a time, then you definetly can use only one dialog....If you check my youtube videos, I only use one dialog for eveything I need (example I made a dialog spell bar, I can set different images to same dialog for different players).
Depending on your needs...You might need to make one or more dialogs....
There is also condition for checking if dialog is visible for player. That could be usefull if you made only one dialog as global variables (if its visibile dont show another achievement).
@zenx1: Go Yeah but what if two achievement is earned by 2 players at the same time ? I can't use the same dialog for several players. I don't think all the actions are player specific.
So I've tryed to remove the turn off and turn on trigger and replaced them with a boolean. Still doing the same error. So nothing to do with running a turned off trigger.
Any idea ? :(
Quite hard to say whats wrong with it...
So no Ideas anymore. I still think you could do it with 1 dialog, since you can show/hide dialogs to specific player, change texts, images etc...for specific player...but Im not gona mess up your triggers more :D. Gl on fixing it
@zenx1: Go
Thanks anyway.
Any help is welcomed
Just like he said: Use one dialog for each player. You can do really anything concerning a dialog or dialog controls for a single player. (Maybe you need to sometimes convert a singleplayer to a player group)
I currently don't have the time to go through your complete trigger, but you should remember that turning a trigger off only diables the events registered to it, instances currently running will finish running or creating new instances directly will work anyways.
- Okay, he already told me about the dialog. But that's apparently not the issue because in my first five achievements, the triggers can add themselves without a problem and the triggers are run one after another as intended.
- I do know turning off or on a trigger does not act on the way it is run, but it is just a way to check if the trigger is occupied or not. I have prooved that it's not the issue remplacing that with a boolean check.
I hope someone can help, I'm looking into it atm myself.
FINALLY found out.
So as I thought this was not coming from this long-ass general dialog creation trigger but from the trigger providing the data.
Problem was that those integer variables were lost during the "wait for condition" function. So what here's what I've put :
I've put the correct integers for both before the checking and after. Not a very clean trigger but at least it'll work.
Thanks for advising me about my triggers though.
@Yaos01: Go
Looks to me like there must be some external function interfering with those values between the time you are waiting and the time you are running Achievement Notice. I think a better solution to your issue would be to make sure that those values are not changed, either by storing them in another temporary variable while waiting or ensuring that whatever functions are using them do not access them untill they are done being worked with.
Your current fix may be working at the moment but, because of the multi-threaded nature of triggers, you might stumble upon instances where your CurrentNumber and Achievement Number are still being altered between the moment you set them and the moment you run Achievement Notice.
@Kalekin: Go
Thanks for your answer. If the SC2 triggers just works the way W3 did, then there is no wait time between this trigger and the runned trigger so it's fine.
Thing is, integer variables named AchievementNumber and CurrentNumber in the GENERAL trigger instantly are set to match local integer variables called CURRENTAchievementNumber and CURRENTPlayer. Since they are local variables, they are specific to the trigger and are not lost in the process with wait functions - and the global integer variables are never used in this trigger.(you can check it in the attachemed image of my previous post)
Thanks you for your concern though. If you still think my triggers are flawed, please tell me.