Victory/defeatEventsUnit-AnyUnittakesFatalorNon-FatalAnydamage(fromAnyeffects)LocalVariablesConditionsOrConditions(Triggeringunit)==CommandBio-Dome[10.00,94.00](Triggeringunit)==CommandBio-Dome[94.00,10.00]((Triggeringunit)Life(Current))<=8.0ActionsTrigger-Turn(Currenttrigger)OffPlayerGroup-Pickeachplayerin(Allplayers)anddo(Actions)ActionsUnit-PauseHeroes[(Pickedplayer)]Camera-Savethecurrentcamerasettingsforplayer(Pickedplayer)Camera-Lockcamerainputforplayer(Pickedplayer)General-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringunit)==CommandBio-Dome[10.00,94.00]ThenCamera-ApplyCamera001forplayer(Pickedplayer)over2.0secondswithExistingVelocity%initialvelocity,10.0%deceleration,andIncludeTarget// This one worksVisibility-Changevisibilityforplayer(Pickedplayer)toExploredwithinBase1andDoNotcheckclifflevel// And this doesn't :(ElseCamera-ApplyCamera002forplayer(Pickedplayer)over2.0secondswithExistingVelocity%initialvelocity,10.0%deceleration,andIncludeTargetVisibility-Changevisibilityforplayer(Pickedplayer)toExploredwithinBase2andDoNotcheckclifflevelGeneral-Wait5.0GameTimesecondsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringunit)==CommandBio-Dome[10.00,94.00]ThenPlayerGroup-PickeachplayerinPlayersbyteams[2]anddo(Actions)ActionsGame-EndgameinVictoryforplayer(Pickedplayer)(Showdialogs,Showscorescreen)Bank-Storeinteger((Load"wins"ofsection"stats"frombankBank[(Pickedplayer)]asintegervalue)+1)as"wins"ofsection"stats"inbankBank[(Pickedplayer)]AddXP((Pickedplayer),100)PlayerGroup-PickeachplayerinPlayersbyteams[1]anddo(Actions)ActionsGame-EndgameinDefeatforplayer(Pickedplayer)(Showdialogs,Showscorescreen)Bank-Storeinteger((Load"loses"ofsection"stats"frombankBank[(Pickedplayer)]asintegervalue)+1)as"loses"ofsection"stats"inbankBank[(Pickedplayer)]ElsePlayerGroup-PickeachplayerinPlayersbyteams[1]anddo(Actions)ActionsGame-EndgameinVictoryforplayer(Pickedplayer)(Showdialogs,Showscorescreen)Bank-Storeinteger((Load"wins"ofsection"stats"frombankBank[(Pickedplayer)]asintegervalue)+1)as"wins"ofsection"stats"inbankBank[(Pickedplayer)]AddXP((Pickedplayer),100)PlayerGroup-PickeachplayerinPlayersbyteams[2]anddo(Actions)ActionsGame-EndgameinDefeatforplayer(Pickedplayer)(Showdialogs,Showscorescreen)Bank-Storeinteger((Load"loses"ofsection"stats"frombankBank[(Pickedplayer)]asintegervalue)+1)as"loses"ofsection"stats"inbankBank[(Pickedplayer)]PlayerGroup-Pickeachplayerin(Allplayers)anddo(Actions)ActionsCamera-Unlockcamerainputforplayer(Pickedplayer)Camera-Restorethesavedcamerasettingsforplayer(Pickedplayer)over2.0secondswithExistingVelocity%initialvelocityand10.0%decelerationUnit-UnpauseHeroes[(Pickedplayer)]Bank-SavebankBank[(Pickedplayer)]
Sorry for such a useless wall of code, i don't have an idea what to remove.
Classic victory/defeat trigger here. When a base is destroyed, it stops the game (at least it stops whatever players can command) and forces their cameras to turn to the destroyed base, and then goes the victory/defeat screen... which doesn't show up. I've made some debugging and marked where exactly the trigger stops working, but dunno why it does.
Before you ask: "Players by teams[]" is an array and has a "Player group" type, "Banks[]" are just banks, that strange event and waiting action is meant to show the last projectiles hitting the unit before its death, that unit type has death time -1 so its data shouldn't be removed, and no errors are popping up. Absolutely no idea what's wrong.
Are you sure there are players in each player group of "Players by teams[]"?
Yep, double checked it. Lots of triggers use this variable before the endgame, and they all work correctly.
You said you marked exactly where the trigger stops working... where was that?
There is a comment at the end of the line. Scroll it to the right.
BTW, don't you need to modify and save the banks BEFORE ending the game for all players?
Dunno, i very much doubt players can leave so rapidly that their banks won't be saved. Unless the player is deleted from game by this action, but as far as i know he isn't.
There is a comment at the end of the line. Scroll it to the right.
Oops missed it :)
So if you disable the "Visibility - Change visibility" actions, does that make the rest of the trigger work?
Did you try displaying a text message after the 5s wait to see if the trigger reaches that point? Or putting a breakpoint in and watching the trigger run in the trigger debugging window? (Type 'TrigDebug' in chat in-game)
Dunno, i very much doubt players can leave so rapidly that their banks won't be saved. Unless the player is deleted from game by this action, but as far as i know he isn't.
Hmm yeah I'm not sure either actually (haven't tested it) but I assumed that as soon as you end the game for a player you can't do anything else for that player.
So if you disable the "Visibility - Change visibility" actions, does that make the rest of the trigger work?
No :'(
Did you try displaying a text message after the 5s wait to see if the trigger reaches that point? Or putting a breakpoint in and watching the trigger run in the trigger debugging window? (Type 'TrigDebug' in chat in-game)
I was thinking it could be something to do with the "Trigger - Turn (Current trigger) Off" but that's unlikely because it should only stop the event from firing.
Does it work if you disable everything before the 5s wait?
Edit: Hold on I think I may see the problem. Edit2: Nvm was nothing. Thought that you might not be able to check what the triggering unit was 5s after it's death.
The only other thing I can think of right now is that your code could be out of sync with your GUI trigger (Ctrl+f11 to check the actual code). I've heard of this happening to someone before.
The only other thing I can think of right now is that your code could be out of sync with your GUI trigger (Ctrl+f11 to check the actual code). I've heard of this happening to someone before.
Even if so, i don't have an idea how the right script would look like. Damn. Will try to learn something about galaxy scripting, but this all is extremely weird.
Edit: tried removing everything before 5m... so, the winners get the endgame screen, the losers don't 0_o
Because
1). Function will also include AI players which i don't need;
2). Idk how will the function work in case if host desides to use autobalance.
Anyway, i tried the fuction too - didn't work either.
This only affects the fog of war and is not the same thing as using a Revealer over a region. I assume your intention is to reveal the area where the building is dying so everyone can see it. If so, create a Revealer over the dying building or Reveal the region for each player. There are a number of functions related to this.
It appears as if your trigger may be having problems as a result of the Wait function. Try disabling this function to see if it's the cause.
Another problem may be that the game might be unable to store the unit's identifier after its death and after the Wait time. To get around this, set a variable to something that indicates which team has won before your Wait function. For example, WinningTeam (local integer) = 1 for team 1's victory. Then reference that variable later when deciding what to do with each team at the end of the game.
Also, I'm not really sure what the purpose of restoring and unlocking the camera is since, by that point, all players should have been given either victory or defeat messages. O.o
This only affects the fog of war and is not the same thing as using a Revealer over a region.
And it does just what I need. Well, in my case it doesn't. But i don't need a full revealer here, the main building is visible by default. Really, i know what i'm doing.
It appears as if your trigger may be having problems as a result of the Wait function. Try disabling this function to see if it's the cause.
Debug shows the trigger gets stuck before this.
Another problem may be that the game might be unable to store the unit's identifier after its death and after the Wait time. To get around this, set a variable to something that indicates which team has won before your Wait function. For example, WinningTeam (local integer) = 1 for team 1's victory. Then reference that variable later when deciding what to do with each team at the end of the game.
Very much doubt this. As i said, the unit's death time is -1. But will try this as well.
Also, I'm not really sure what the purpose of restoring and unlocking the camera is since, by that point, all players should have been given either victory or defeat messages. O.o
Because some people enjoy resuming the game after their victory. Maybe they'll want to look for eastereggs or whatever.
Sorry for such a useless wall of code, i don't have an idea what to remove.
Classic victory/defeat trigger here. When a base is destroyed, it stops the game (at least it stops whatever players can command) and forces their cameras to turn to the destroyed base, and then goes the victory/defeat screen... which doesn't show up. I've made some debugging and marked where exactly the trigger stops working, but dunno why it does.
Before you ask: "Players by teams[]" is an array and has a "Player group" type, "Banks[]" are just banks, that strange event and waiting action is meant to show the last projectiles hitting the unit before its death, that unit type has death time -1 so its data shouldn't be removed, and no errors are popping up. Absolutely no idea what's wrong.
@FunBotan: Go
Are you sure there are players in each player group of "Players by teams[]"?
You said you marked exactly where the trigger stops working... where was that?
BTW, don't you need to modify and save the banks BEFORE ending the game for all players?
@DeltaV: Go
Are you sure there are players in each player group of "Players by teams[]"?
Yep, double checked it. Lots of triggers use this variable before the endgame, and they all work correctly.
You said you marked exactly where the trigger stops working... where was that?
There is a comment at the end of the line. Scroll it to the right.
BTW, don't you need to modify and save the banks BEFORE ending the game for all players?
Dunno, i very much doubt players can leave so rapidly that their banks won't be saved. Unless the player is deleted from game by this action, but as far as i know he isn't.
Oops missed it :)
So if you disable the "Visibility - Change visibility" actions, does that make the rest of the trigger work?
Did you try displaying a text message after the 5s wait to see if the trigger reaches that point? Or putting a breakpoint in and watching the trigger run in the trigger debugging window? (Type 'TrigDebug' in chat in-game)
Hmm yeah I'm not sure either actually (haven't tested it) but I assumed that as soon as you end the game for a player you can't do anything else for that player.
@DeltaV: Go
So if you disable the "Visibility - Change visibility" actions, does that make the rest of the trigger work?
No :'(
Did you try displaying a text message after the 5s wait to see if the trigger reaches that point? Or putting a breakpoint in and watching the trigger run in the trigger debugging window? (Type 'TrigDebug' in chat in-game)
Yep, and it doesn't reach that point.
Now you confused me... lol.
I was thinking it could be something to do with the "Trigger - Turn (Current trigger) Off" but that's unlikely because it should only stop the event from firing.
Does it work if you disable everything before the 5s wait?
Edit: Hold on I think I may see the problem.
Edit2: Nvm was nothing. Thought that you might not be able to check what the triggering unit was 5s after it's death.
The only other thing I can think of right now is that your code could be out of sync with your GUI trigger (Ctrl+f11 to check the actual code). I've heard of this happening to someone before.
@DeltaV: Go
The only other thing I can think of right now is that your code could be out of sync with your GUI trigger (Ctrl+f11 to check the actual code). I've heard of this happening to someone before.
Even if so, i don't have an idea how the right script would look like. Damn. Will try to learn something about galaxy scripting, but this all is extremely weird.
Edit: tried removing everything before 5m... so, the winners get the endgame screen, the losers don't 0_o
@FunBotan: Go
Out of curiousity why are you using arrays for teams instead of using the lobby team function?
@hobbidude: Go
Because 1). Function will also include AI players which i don't need; 2). Idk how will the function work in case if host desides to use autobalance. Anyway, i tried the fuction too - didn't work either.
Buuuuump? Seriously, does anyone have an idea what's going on?
First, this function:
This only affects the fog of war and is not the same thing as using a Revealer over a region. I assume your intention is to reveal the area where the building is dying so everyone can see it. If so, create a Revealer over the dying building or Reveal the region for each player. There are a number of functions related to this.
It appears as if your trigger may be having problems as a result of the Wait function. Try disabling this function to see if it's the cause.
Another problem may be that the game might be unable to store the unit's identifier after its death and after the Wait time. To get around this, set a variable to something that indicates which team has won before your Wait function. For example, WinningTeam (local integer) = 1 for team 1's victory. Then reference that variable later when deciding what to do with each team at the end of the game.
Also, I'm not really sure what the purpose of restoring and unlocking the camera is since, by that point, all players should have been given either victory or defeat messages. O.o
@BasharTeg: Go
This only affects the fog of war and is not the same thing as using a Revealer over a region.
And it does just what I need. Well, in my case it doesn't. But i don't need a full revealer here, the main building is visible by default. Really, i know what i'm doing.
It appears as if your trigger may be having problems as a result of the Wait function. Try disabling this function to see if it's the cause.
Debug shows the trigger gets stuck before this.
Another problem may be that the game might be unable to store the unit's identifier after its death and after the Wait time. To get around this, set a variable to something that indicates which team has won before your Wait function. For example, WinningTeam (local integer) = 1 for team 1's victory. Then reference that variable later when deciding what to do with each team at the end of the game.
Very much doubt this. As i said, the unit's death time is -1. But will try this as well.
Also, I'm not really sure what the purpose of restoring and unlocking the camera is since, by that point, all players should have been given either victory or defeat messages. O.o
Because some people enjoy resuming the game after their victory. Maybe they'll want to look for eastereggs or whatever.
@FunBotan: Go
Can you post a screenshot or copy the text from the debugger? That might help get to the bottom of the issue.
UPD.
I have no idea how, but it began to work. 0____o Not sure what change exactly did the trick, though.