I have a lot of experience programming a campaign, but I am now working on my first BattleNet game; a dog-fighting game set in the star wars universe.
I have a bug that I just discovered playing on a LAN.
When my hero dies (Player 1), a trigger revives him after 20 seconds at his spawn point. When that happens, Player 2 (my friend sitting next to me) disconnects. Here is the death trigger (I've added explanations after // )
As far as I can tell, the trigger works fine. The hero dies. Twenty seconds later he respawns at the appropriate point (HeroSpawnPointRebel). My camera zooms to my hero and I can keep playing, but player 2 is disconnected.
I've never done a Bnet map before, so I have no idea what could cause a disconnect!
I have a bug that I just discovered playing on a LAN.
When my hero dies (Player 1), a trigger revives him after 20 seconds at his spawn point. When that happens, Player 2 (my friend sitting next to me) disconnects. Here is the death trigger (I've added explanations after // )
-
Hero Repawn
-
Events
- Unit - A unit Dies
-
Conditions
- ((Triggering unit) is A Hero) Equal to True
- ((Owner of (Triggering unit)) controller) Equal to User
-
Actions
- Unit - Kill Fliers[(Player number of (Owner of (Triggering unit)))]
-
Events
-
//blows up the hero's ship
- -------- -----------Kill shuttle --------
-
//Fixes a bug where a shuttle would be going to pick up the hero who died
-
For each (Integer FlareHeroDeathCounter) from 1 to 11, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Triggering unit) Equal to FlareHero[FlareHeroDeathCounter]
-
Then - Actions
- Unit - Kill FlareShuttle[FlareHeroDeathCounter]
- Set FlareHero[FlareHeroDeathCounter] = No unit
- Set FlareShuttle[FlareHeroDeathCounter] = No unit
- Set HeroInSomething[FlareHeroDeathCounter] = False
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- -------- ------------------ --------
- -------- --------fix Aimed shot----------- --------
- -------- ------------------ --------
-
For each (Integer FlareHeroDeathCounter) from 1 to 11, do (Actions)
-
//fixes bugs if an enemy sniper is using aimed shot on him when he dies
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Triggering unit) Equal to aimedShotShooter[1]
-
Then - Actions
- Trigger - Run Aimed Shot Cancel <gen> (ignoring conditions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Triggering unit) Equal to aimedShotShooter[2]
-
Then - Actions
- Trigger - Run Aimed Shot Cancel 2 <gen> (ignoring conditions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Triggering unit) Equal to aimedShotShooter[3]
-
Then - Actions
- Trigger - Run Aimed Shot Cancel 3 <gen> (ignoring conditions)
- Else - Actions
-
If - Conditions
- -------- ------------------ --------
- Camera - Reset camera for (Owner of (Triggering unit)) to standard game-view over 0.00 seconds
- Camera - Set (Owner of (Triggering unit))'s camera Distance to target to 3800.00 over 0.00 seconds
- Camera - Set (Owner of (Triggering unit))'s camera Far Z to 9500.00 over 0.00 seconds
- Set tempPlayerGroup = (Player group((Owner of (Triggering unit))))
- Game - Display to tempPlayerGroup the text: |c0066ff66HINT|r - ...
- Custom script: call DestroyForce(udg_tempPlayerGroup)
- Wait 20.00 game-time seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
//if the game is over this trigger is turned off for ending cinematic
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((This trigger) is on) Equal to False
-
Then - Actions
- Skip remaining actions
- Else - Actions
-
If - Conditions
- Camera - Reset camera for (Owner of (Triggering unit)) to standard game-view over 0.00 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
-
Then - Actions
- Camera - Pan camera as necessary for (Owner of (Triggering unit)) to HeroSpawnPointRebel over 2.50 seconds
- Hero - Instantly revive (Triggering unit) at HeroSpawnPointRebel, Hide revival graphics
-
Else - Actions
- Camera - Pan camera as necessary for (Owner of (Triggering unit)) to HeroSpawnPointEmpire over 2.50 seconds
- Hero - Instantly revive (Triggering unit) at HeroSpawnPointEmpire, Hide revival graphics
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
As far as I can tell, the trigger works fine. The hero dies. Twenty seconds later he respawns at the appropriate point (HeroSpawnPointRebel). My camera zooms to my hero and I can keep playing, but player 2 is disconnected.
I've never done a Bnet map before, so I have no idea what could cause a disconnect!