Author Topic: Action Cam (?) causes Fight Result + Music to Glitch  (Read 2395 times)

Offline G.K.

  • *
  • Posts: 12156
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Action Cam (?) causes Fight Result + Music to Glitch
« on: July 25, 2015, 08:48:59 PM »
Hey,

Sometimes when I view a fight through Trov's Action Cam the post-fight gets all glitched up. Firstly, the camera will not spin around the winning bot, and then the bassy tune that gets played at the conclusion continues indefinitely - when I leave the battle and go back to the selection screen and there's other music playing as well, and if I go into another battle, or even the botlab.

I've mostly only had this problem in the Twiiiiisted Arena when filming BTTB V - yet by and large the tournament's had no problems with this. While I'm retiring this arena at the conclusion of this tourney I am planning on building a new one for future tournaments out of the same source material - Clickbeetle's Low Lag Arena so I'm concerned that I'll continue to be plagued by the issue.

I'm hoping I just messed something up when installing it into a different copy of RA2 where I've been doing some more recent filming - most of the filming was in an old copy of Inf AI and I don't recall any trouble there. I think the only major difference between the two is the resolution I'm running it in, but I guess as I was copying a bunch of stuff about when compiling the RA2 folder for the new game I could have re-written over something important?

Thanks in advance

EDIT: I only seem to be getting the problem in the twiisted arena at the moment. In case it is of any help, I include its .py below as I recognise not everyone may have it.

Code: [Select]
from __future__ import generators
import plus
import Arenas
import random
import Hazards
import math

from random import randint
import time
import HazardsBlueRay
import string
import Gooey


class Twisted_Loser(Arenas.SuperArena):
    "Twiiiiiiiiiiiiiiiisted"
    name = "Twiiiiiiiiiiiiiisted Arena"
    preview = "twisted/twi_preview.bmp"
    game_types = ['DEATHMATCH', 'BATTLE ROYAL', 'TEAM MATCH']
    extent = (-15, 15, 15, -15)



    def __init__(self):
        Arenas.SuperArena.__init__(self, "Arenas/twisted/twisted_L.gmf")
        #plus.Arena.__init__(self, "")
        plus.setBackColor(0, 0, 0)
       
        degrad = 0.01745
        self.AddStaticCamera("Main View", (0, 30, -20), (68*degrad,0), 55*degrad)
        self.AddStaticCamera("Battle View", (19.5, 25, 19.5), (56*degrad,225*degrad), 40*degrad)
        self.AddStaticCamera("High Flipper View", (-19.5, 45, -19.5), (48*degrad,45*degrad), 84*degrad)
        self.AddStaticCamera("Birds Eye View", (0, 45, 0), (90*degrad,0), 50*degrad)

        self.AddWatchCamera("Combat Cam", (-12, 8, 12), (16, 36, 65*degrad, 30*degrad))
        self.AddWatchCamera("Aerial Cam", (-19.5, 35, -19.5), (50, 60, 45*degrad, 60*degrad))
        self.AddWatchCamera("Ground Cam", (8, -5, -8), (15, 40, 75*degrad, 35*degrad))
        self.AddWatchCamera("Spectator Cam", (13, 15, 13), (6, 18, 45*degrad, 45*degrad))
   
        self.players = ()

        ##################  Bot Flames + Smoke  ##################-------------
        self.RI_1 = 0
        self.RI_2 = 0
        self.RI_3 = 0
        self.RI_4 = 0
        self.RI_5 = 0
        self.RI_6 = 0
        self.RI_7 = 0
        self.RI_8 = 0
        self.RI_9 = 0
        self.RI_D = 0
        self.RI_Y = 0
        self.RI_SandF_0 = random.randint(-4, 4)   ### Random Smoke and Flames
        self.RI_SandF_1 = random.randint(-4, 4)   ### Random Smoke and Flames
        self.RI_SandF_2 = random.randint(-4, 4)   ### Random Smoke and Flames
        self.RI_SandF_3 = random.randint(-4, 4)   ### Random Smoke and Flames

        ##################  Bot Flames + Smoke  ##################-------------





    def AddShadowReceivers(self):
        self.SetShadowSource(5.897, 19.159, 5.899)





       
    def Activate(self, on):
        if on: self.players = plus.getPlayers()

        Arenas.SuperArena.Activate(self, on)





    def HazardsOn(self, on):
        if on:
            ##################  Bot Flames + Smoke  ##################-------------
            self.BOT_Flame_0 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_0)                                                                   
            self.BOT_Flame_1 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_1)                                                                   
            self.BOT_Flame_2 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_2)                                                                   
            self.BOT_Flame_3 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_3)
            self.BOT_Flame_4 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_4)                                                                   
            #self.BOT_Flame_5 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            #self.AddHazard(self.BOT_Flame_5)
            #self.BOT_Flame_6 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            #self.AddHazard(self.BOT_Flame_6)
            #self.BOT_Flame_7 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            #self.AddHazard(self.BOT_Flame_7)
            #self.BOT_Flame_8 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            #self.AddHazard(self.BOT_Flame_8)           

            ##################  Bot Flames + Smoke  ##################-------------


        return Arenas.SuperArena.HazardsOn(self, on)







       
    def Tick(self):
        for each in self.players:
            if plus.getLocation(each)[1] < -10: # Adjust this parameter to floor height(s).
                plus.eliminatePlayer(each)

        ##################  Bot Flames + Smoke  ##################-------------
        self.RI_0 = randint(-4, 4)
        self.RI_1 = randint(-4, 4)
        self.RI_2 = randint(-4, 4)
        self.RI_3 = randint(-2, 2)
        self.RI_4 = randint(-2, 2)
        self.RI_5 = randint(-2, 2)
        self.RI_6 = randint(-2, 2)
        self.RI_7 = randint(-2, 2)
        self.RI_8 = randint(-2, 2)
        self.RI_9 = randint(-2, 2)
        self.RI_D = randint(1, 4)
        self.RI_Y = randint(0, 2)

        self.BOT_Flame_0.Tick()  # Individual bot flames
        self.BOT_Flame_1.Tick()  # ""
        self.BOT_Flame_2.Tick()  # "" 
        self.BOT_Flame_3.Tick()  # "" 
        #self.BOT_Flame_4.Tick()  # Generic Lightning striking bot_flame.
        #self.BOT_Flame_5.Tick() 
        #self.BOT_Flame_6.Tick() 
        #self.BOT_Flame_7.Tick() 
        #self.BOT_Flame_8.Tick() 

        if 0 in self.players:
            if plus.getHealth(0,0) < 0.2:  #
                if self.RI_SandF_0  <= 2:
                    plus.emitSmoke(1, (plus.getLocation(0)), (self.RI_3, 1 ,self.RI_4), (.2,.4,.2))
            if plus.getHealth(0,0) < 0.1:  #
                if self.RI_SandF_0  < 0:
                    plus.emitSmoke(1,   (plus.getLocation(0)), (self.RI_4, self.RI_Y, self.RI_5), (.2,.4,.2))
                    self.BOT_Flame_0.BotFlameOff()   
                    self.BOT_Flame_0 = HazardsBlueRay.BotFlame(plus.getLocation(0), (self.RI_4, self.RI_Y, self.RI_5), (.2, .4, .2), .8)
                    self.BOT_Flame_0.BotFlameOn()

        if 1 in self.players:
            if plus.getHealth(1,0) < 0.2:  #
                if self.RI_SandF_1  <= 2:
                    plus.emitSmoke(1, (plus.getLocation(1)), (self.RI_4, 1 ,self.RI_5), (.2,.4,.2))
            if plus.getHealth(1,0) < 0.1:  #
                if self.RI_SandF_1  < 20:
                    plus.emitSmoke(1,   (plus.getLocation(1)), (self.RI_5, self.RI_Y, self.RI_6), (.2,.4,.2))
                    self.BOT_Flame_1.BotFlameOff()   
                    self.BOT_Flame_1 = HazardsBlueRay.BotFlame(plus.getLocation(1), (self.RI_5, self.RI_Y, self.RI_6), (.2, .4, .2), .8)
                    self.BOT_Flame_1.BotFlameOn()

        if 2 in self.players:
            if plus.getHealth(2,0) < 0.2:  #
                if self.RI_SandF_2  <= 2:
                    plus.emitSmoke(1, (plus.getLocation(2)), (self.RI_5, 1 ,self.RI_6), (.2,.4,.2))
            if plus.getHealth(2,0) < 0.1:  #
                if self.RI_SandF_2  < 0:
                    plus.emitSmoke(1,   (plus.getLocation(2)), (self.RI_6, self.RI_Y ,self.RI_7), (.2,.4,.2))
                    self.BOT_Flame_2.BotFlameOff()   
                    self.BOT_Flame_2 = HazardsBlueRay.BotFlame(plus.getLocation(2), (self.RI_6, self.RI_Y, self.RI_7), (.2, .4, .2), .8)
                    self.BOT_Flame_2.BotFlameOn()

        if 3 in self.players:
            if plus.getHealth(3,0) < 0.2:  #
                if self.RI_SandF_3  <= 2:
                    plus.emitSmoke(1, (plus.getLocation(3)), (self.RI_6, 1 ,self.RI_7), (.2,.4,.2))
            if plus.getHealth(3,0) < 0.1:  #
                if self.RI_SandF_3  < 0:
                    plus.emitSmoke(1,   (plus.getLocation(3)), (self.RI_8, self.RI_Y, self.RI_9), (.2,.4,.2))
                    self.BOT_Flame_3.BotFlameOff()   
                    self.BOT_Flame_3 = HazardsBlueRay.BotFlame(plus.getLocation(3), (self.RI_8, self.RI_Y, self.RI_9), (.2, .4, .2), .8)
                    self.BOT_Flame_3.BotFlameOn()

        ##################  Bot Flames + Smoke  ##################-------------






        return Arenas.SuperArena.Tick(self)



 
Arenas.register(Twisted_Loser)

« Last Edit: July 26, 2015, 12:13:27 AM by Trovaner »
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V.

Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)

Offline 090901

  • alcoholic in denial
  • *
  • Posts: 7010
  • Rep: 22
  • :mrgreen:
  • Awards Donated money for site hosting 2019 GTMCS2 Divison Winner GTMCS Division Winner
    • View Profile
    • Awards
Re: Action Cam (?) causes Fight Result + Music to Glitch
« Reply #1 on: July 25, 2015, 08:57:34 PM »
Never had that happen to before or heard of it happening.
A quick fix would be just deleting the bassy tune's sound file, I don't remember the name of the file off the top of my head

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: Action Cam (?) causes Fight Result + Music to Glitch
« Reply #2 on: July 26, 2015, 12:27:26 AM »
I don't recall this ever happening to me when using the action cam but I'll play around with it when I have some time.

Based on a very quick scan of the arena code, I'm guessing this happens every time you have hazards off. I'm definitely seeing an issue but I'm not sure if it is the culprit. Would you mind testing this?

Offline G.K.

  • *
  • Posts: 12156
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: Action Cam (?) causes Fight Result + Music to Glitch
« Reply #3 on: July 26, 2015, 08:00:14 AM »
I've not been playing with hazards off as there was no difference between the two and turning them off was an extra click. All my reporterd times come with hazards on. Nevertheless, I'll test now.

==Results==

- Playing with hazards off, either in the reliable Inf AI install or the new one, and turning on the action cam, caused RA2 to crash.
- I tested rigorously in the Inf AI one and it didn't really ever crash.
- I tested rigorously in the new problematic one and found it only gitched when bots have started 'being on fire'
- I checked my HazardsBlueRay.py in the new install and found it wasn't updated to the post BBEANS 5 version, so I copied the one on my Inf AI over - that version being 19th November 2009.
- While my testing has only been 10-15 matches, any time the flames are involved it still runs fine, so it looks like I fixed it.
- Reducing my resolution also got rid of the lag trouble I had.

While I suspect that the problem was the woefully outdated HazardsBlueRay, is there anything else I should be doing to make sure it's all in working order.

Also, is that 19/11/2009 HazardsBlueRay.py still the most up to date?
« Last Edit: July 26, 2015, 08:39:54 AM by G.K. »
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V.

Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: Action Cam (?) causes Fight Result + Music to Glitch
« Reply #4 on: July 31, 2015, 12:55:12 AM »
Your HazardsBlueRay.py should be fine. Mine is from around the same time and I don't recall Mad ever changing a hazard after a public release (he usually just made new hazards with small tweaks).

The issue that I saw before has to do with all of your flame hazards not being saved to variables when hazards were off in the HazardsOn method. However, you are still trying to use them down in the Tick method. Just to give you a simplified example, here is what I am seeing for self.BOT_Flame_0: (anything that doesn't help in explaining the issue has been removed so I wouldn't recommend copy/pasting this)
Code: [Select]
    def HazardsOn(self, on):
        if on:
            self.BOT_Flame_0 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)

    def Tick(self):
        self.BOT_Flame_0.Tick()
and here is one way of fixing this issue:
Code: [Select]
    def HazardsOn(self, on):
        if on:
            self.BOT_Flame_0 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)

    def Tick(self):
        if self.bHazardsOn:
            self.BOT_Flame_0.Tick()

In other words, self.BOT_Flame_0 is supposed to be an instance of an object but, when that object has not been instantiated, you can't call one of its methods (Tick). Currently, self.BOT_Flame_0 has no value when hazards are off.

I haven't gotten a chance to look into your other issues yet but I promise to get to them ASAP.

Offline G.K.

  • *
  • Posts: 12156
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: Action Cam (?) causes Fight Result + Music to Glitch
« Reply #5 on: July 31, 2015, 03:38:33 AM »
I see, this makes sense.

And would you believe it, the addition of one line and a small indentation change now means the arena doesn't crash at startup if hazards are not selected.

You're the best, Trov! :)

EDIT - eek - Now sometimes the music problem comes back and sometimes it just crashes midgame when hazards are off :S. I'm going to test a bunch more to try and isolate the problem.
« Last Edit: July 31, 2015, 04:14:05 AM by G.K. »
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V.

Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)

Offline G.K.

  • *
  • Posts: 12156
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Flame Code causes Crashes and Fight Result Music Glitching
« Reply #6 on: July 31, 2015, 12:14:51 PM »
DP, because this contains new info and I don't want anyone who's seen the previous post to miss it.

I've run like 40-50 fights in the Twiiisted Arena and while I'm no closer to solving the current issues I have narrowed down when they happen.

- When hazards are on everything runs fine, I think. I only ran about 15 fights with hazards on though so I guess there could be occasional bugs I've not seen.
- When hazards are off the fights seem to be running fine, until a bot is dealt the amount of damage that would result in a flame with hazards on. Instead of flame, the game crashes at this point.
- When hazards are off and a fight does finish, sometimes hopp_club.wav (The fight result music) will glitchily continue to play after I leave the battle, as described in the OP, though this happens less often than it did before. The version of RA2 I'm running this in ATM doesn't have your action cam, Trov, so it's nothing to do with that.

I had a look in the BBEANS Arena 2 to try and compare with its flame coding but it appears to be coded slightly differently so I'm lost. As I see it there are 5 options.

1 - Fix the issue while maintaining my current flame code - but I don't know how.
2 - Leave it as it was before I added 'if self.bHazardsOn:' and write a note in the arena description saying 'Do Not Play with Hazards Off'.
3 - Take out all the flame code and paste in the BBEANS code, and see if that all works.
4 - Just remove the flame code - it's not there to do damage, only for the visuals, so it's essentially nothing but pretty lag. Even if I need it for filming, I see less of a need for the arena's general re-release in an updated BTTB AI.
5 - Move the flame code in the .py so it isn't only enabled when hazards are on. No idea where to move it too though, ideas would be appreciated.

I'll give both #3 and #5 a shot later today, but if ultimately I cannot fix it through those or #1 I'm stuck as to which option of #2 and #4 I'm going to run with.

For reference, the .py in its current state, which is a bit different from before as I had to build it again to get the arena introduction to work:

Code: [Select]
from __future__ import generators
import plus
import Arenas
import Hazards
import random
import math

from random import randint
import time
import HazardsBlueRay
import string
import Gooey

class BoxArena(Arenas.SuperArena):
    "The official arena for all BTTB tournaments."
    name = "Twiiisted Arena"
    preview = "twisted/twi_preview.bmp"
    game_types = ['DEATHMATCH', 'BATTLE ROYAL', 'TEAM MATCH']

    def __init__(self):
        Arenas.SuperArena.__init__(self, "Arenas/twisted/twisted_L.gmf")
        plus.setBackColor(0, 0, 0)
       
        degrad = 0.01745
        self.AddStaticCamera("Main View", (0, 30, -20), (68*degrad,0), 55*degrad)
        self.AddStaticCamera("Battle View", (19.5, 25, 19.5), (56*degrad,225*degrad), 40*degrad)
        self.AddStaticCamera("High Flipper View", (-19.5, 45, -19.5), (48*degrad,45*degrad), 84*degrad)
        self.AddStaticCamera("Birds Eye View", (0, 45, 0), (90*degrad,0), 50*degrad)

        self.AddWatchCamera("Combat Cam", (-12, 8, 12), (16, 36, 65*degrad, 30*degrad))
        self.AddWatchCamera("Aerial Cam", (-19.5, 35, -19.5), (50, 60, 45*degrad, 60*degrad))
        self.AddWatchCamera("Ground Cam", (8, -5, -8), (15, 40, 75*degrad, 35*degrad))
        self.AddWatchCamera("Spectator Cam", (13, 15, 13), (6, 18, 45*degrad, 45*degrad))

        self.players = ()

        ##################  Bot Flames + Smoke  ##################-------------
        self.RI_1 = 0
        self.RI_2 = 0
        self.RI_3 = 0
        self.RI_4 = 0
        self.RI_5 = 0
        self.RI_6 = 0
        self.RI_7 = 0
        self.RI_8 = 0
        self.RI_9 = 0
        self.RI_D = 0
        self.RI_Y = 0
        self.RI_SandF_0 = random.randint(-4, 4)   ### Random Smoke and Flames
        self.RI_SandF_1 = random.randint(-4, 4)   ### Random Smoke and Flames
        self.RI_SandF_2 = random.randint(-4, 4)   ### Random Smoke and Flames
        self.RI_SandF_3 = random.randint(-4, 4)   ### Random Smoke and Flames

        ##################  Bot Flames + Smoke  ##################-------------
       
    def AddShadowReceivers(self):
#Shadow Light Sources
        self.SetShadowSource(5.897, 19.159, 5.899)

    def Activate(self, on):
        if on: self.players = plus.getPlayers()
        return Arenas.SuperArena.Activate(self, on)
 
    def HazardsOn(self, on):
        if on:
            ##################  Bot Flames + Smoke  ##################-------------
            self.BOT_Flame_0 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_0)                                                                   
            self.BOT_Flame_1 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_1)                                                                   
            self.BOT_Flame_2 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_2)                                                                   
            self.BOT_Flame_3 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_3)
            self.BOT_Flame_4 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            self.AddHazard(self.BOT_Flame_4)                                                                   
            #self.BOT_Flame_5 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            #self.AddHazard(self.BOT_Flame_5)
            #self.BOT_Flame_6 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            #self.AddHazard(self.BOT_Flame_6)
            #self.BOT_Flame_7 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            #self.AddHazard(self.BOT_Flame_7)
            #self.BOT_Flame_8 = HazardsBlueRay.BotFlame((0, 0, 0), (0, 1, 0), (.2, .4, .2), .8)
            #self.AddHazard(self.BOT_Flame_8)           

            ##################  Bot Flames + Smoke  ##################-------------


        return Arenas.SuperArena.HazardsOn(self, on)
 
    def Introduction(self):
        sounds = self.intro_sounds
       
        # set initial camera & fade from black
        plus.setCameraPosition(23.7554,14.3743,-47.141)
        plus.setCameraRotation(0.266024,-0.472956)
        plus.setCameraFOV(0.675)
        plus.fadeFromBlack(.25)

        #start playing music loop
        self.intro_music = plus.createSound("Sounds/intro_music/aggression.wav", False, (0,0,0))
        plus.setVolume(self.intro_music, 0, 0)
        plus.loopSound(self.intro_music)
        yield .25
       
        #load all sounds now to decrease lag later
        sounds['crowd'] = plus.createSound("Sounds/crowd/LoudCheer_Loop.wav", False, (0,0,0))
       
        arenaOpt = ("Sounds/announcers/Twisted_WinnersIntroduction.wav", "Sounds/announcers/Twisted_WinnersIntroduction.wav")
        sounds['arena'] = plus.createSound(random.choice(arenaOpt), False, (0,0,0))
        genericOpt = ("Twisted_StuckArenaFloor.wav", "Twisted_LegalDisclaimer.wav", "Twisted_LowLag.wav")
        sounds['generic'] = plus.createSound("Sounds/announcers/"+random.choice(genericOpt), False, (0,0,0))
        hazardOpt = ("Sounds/announcers/Twisted_EliminationCorners.wav", "Sounds/announcers/Twisted_EliminationCorners.wav")
        sounds['hazards'] = plus.createSound(random.choice(hazardOpt), False, (0,0,0))
        botOpt = ("Twisted_CrowdArmed.wav", "Twisted_CrowdArmed.wav")
        sounds['bots'] = plus.createSound("Sounds/announcers/"+random.choice(botOpt), False, (0,0,0))
       
        #intro cam, welcom comment
        plus.playSound(sounds['arena'])
        plus.fadeInToLoop(sounds['crowd'], -100, 800)
        plus.animateCamera((23.7554,14.3743,-47.141), (0.266024,-0.472956), 0.675, (30.3992,6.28651,8.97787), (0.193915,-1.86089), 0.675, 0, 8)
        yield 3
        plus.fadeOutLoop(sounds['crowd'], 8000)
        yield 1
       
        #play a generic (or specific) secondary comment
        plus.playSound(sounds['generic'])
        yield 6
       
        #hazard cams
        if self.bHazardsOn:
            plus.playSound(sounds['hazards'])
            plus.animateCamera((8.6126,4.07693,2.09747), (0.416206,-2.1045), 0.8862, (8.6126,4.07693,2.09747), (0.416206,-2.1045), 0.3162, 1, 1.5)
            yield 6

        players = plus.getPlayers()
        pcount = len(players)
        if pcount>0: plus.playSound(sounds['bots'])
        delaytime = 6 - pcount
       
        if 0 in players:
            self.BOT_0 = True
            #bot 1 cam
            plus.animateCamera((-8,6,-8), (0.8,0), 0.8, (-1,1,1), (0.525,-2), 0.8, 0, 6)
            yield 3
           
        if 1 in players:
            self.BOT_1 = True
            #bot 2 cam
            plus.animateCamera((8,6,8), (0.8,3.14159), 0.8, (1,1,-1), (0.525,1.143), 0.8, 0, 6)
            yield 3
           
        if 2 in players:
            self.BOT_2 = True
            #bot 3 cam
            plus.animateCamera((8,6,-8), (0.8,-1.57), 0.8, (-1,1,-1), (0.525,-3.569), 0.8, 0, 6)
            yield 3
           
        if 3 in players:
            self.BOT_3 = True
            #bot 4 cam
            plus.animateCamera((-8,6,8), (0.8,1.57), 0.8, (1,1,1), (0.525,-0.427), 0.8, 0, 6)
            yield 3
           
        #fade out music
        plus.fadeOutLoop(self.intro_music, 2000)
        yield 1
       
        # done
        yield 0
       
       
    def Tick(self):
        for each in self.players:
            if plus.getLocation(each)[1] < -10: # Adjust this parameter to floor height(s).
                plus.eliminatePlayer(each)

        ##################  Bot Flames + Smoke  ##################-------------
        self.RI_0 = randint(-4, 4)
        self.RI_1 = randint(-4, 4)
        self.RI_2 = randint(-4, 4)
        self.RI_3 = randint(-2, 2)
        self.RI_4 = randint(-2, 2)
        self.RI_5 = randint(-2, 2)
        self.RI_6 = randint(-2, 2)
        self.RI_7 = randint(-2, 2)
        self.RI_8 = randint(-2, 2)
        self.RI_9 = randint(-2, 2)
        self.RI_D = randint(1, 4)
        self.RI_Y = randint(0, 2)

        if self.bHazardsOn:
            self.BOT_Flame_0.Tick()  # Individual bot flames
            self.BOT_Flame_1.Tick()  # ""
            self.BOT_Flame_2.Tick()  # "" 
            self.BOT_Flame_3.Tick()  # "" 
        #self.BOT_Flame_4.Tick()  # Generic Lightning striking bot_flame.
        #self.BOT_Flame_5.Tick() 
        #self.BOT_Flame_6.Tick() 
        #self.BOT_Flame_7.Tick() 
        #self.BOT_Flame_8.Tick() 

        if 0 in self.players:
            if plus.getHealth(0,0) < 0.2:  #
                if self.RI_SandF_0  <= 2:
                    plus.emitSmoke(1, (plus.getLocation(0)), (self.RI_3, 1 ,self.RI_4), (.2,.4,.2))
            if plus.getHealth(0,0) < 0.1:  #
                if self.RI_SandF_0  < 0:
                    plus.emitSmoke(1,   (plus.getLocation(0)), (self.RI_4, self.RI_Y, self.RI_5), (.2,.4,.2))
                    self.BOT_Flame_0.BotFlameOff()   
                    self.BOT_Flame_0 = HazardsBlueRay.BotFlame(plus.getLocation(0), (self.RI_4, self.RI_Y, self.RI_5), (.2, .4, .2), .8)
                    self.BOT_Flame_0.BotFlameOn()

        if 1 in self.players:
            if plus.getHealth(1,0) < 0.2:  #
                if self.RI_SandF_1  <= 2:
                    plus.emitSmoke(1, (plus.getLocation(1)), (self.RI_4, 1 ,self.RI_5), (.2,.4,.2))
            if plus.getHealth(1,0) < 0.1:  #
                if self.RI_SandF_1  < 20:
                    plus.emitSmoke(1,   (plus.getLocation(1)), (self.RI_5, self.RI_Y, self.RI_6), (.2,.4,.2))
                    self.BOT_Flame_1.BotFlameOff()   
                    self.BOT_Flame_1 = HazardsBlueRay.BotFlame(plus.getLocation(1), (self.RI_5, self.RI_Y, self.RI_6), (.2, .4, .2), .8)
                    self.BOT_Flame_1.BotFlameOn()

        if 2 in self.players:
            if plus.getHealth(2,0) < 0.2:  #
                if self.RI_SandF_2  <= 2:
                    plus.emitSmoke(1, (plus.getLocation(2)), (self.RI_5, 1 ,self.RI_6), (.2,.4,.2))
            if plus.getHealth(2,0) < 0.1:  #
                if self.RI_SandF_2  < 0:
                    plus.emitSmoke(1,   (plus.getLocation(2)), (self.RI_6, self.RI_Y ,self.RI_7), (.2,.4,.2))
                    self.BOT_Flame_2.BotFlameOff()   
                    self.BOT_Flame_2 = HazardsBlueRay.BotFlame(plus.getLocation(2), (self.RI_6, self.RI_Y, self.RI_7), (.2, .4, .2), .8)
                    self.BOT_Flame_2.BotFlameOn()

        if 3 in self.players:
            if plus.getHealth(3,0) < 0.2:  #
                if self.RI_SandF_3  <= 2:
                    plus.emitSmoke(1, (plus.getLocation(3)), (self.RI_6, 1 ,self.RI_7), (.2,.4,.2))
            if plus.getHealth(3,0) < 0.1:  #
                if self.RI_SandF_3  < 0:
                    plus.emitSmoke(1,   (plus.getLocation(3)), (self.RI_8, self.RI_Y, self.RI_9), (.2,.4,.2))
                    self.BOT_Flame_3.BotFlameOff()   
                    self.BOT_Flame_3 = HazardsBlueRay.BotFlame(plus.getLocation(3), (self.RI_8, self.RI_Y, self.RI_9), (.2, .4, .2), .8)
                    self.BOT_Flame_3.BotFlameOn()

        ##################  Bot Flames + Smoke  ##################-------------

        return Arenas.SuperArena.Tick(self)


           
        return True

Arenas.register(BoxArena)
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V.

Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)

Offline Trovaner

  • *
  • Posts: 1222
  • Rep: 32
    • View Profile
    • Awards
Re: Action Cam (?) causes Fight Result + Music to Glitch
« Reply #7 on: July 31, 2015, 02:19:21 PM »
Try something like this for your Tick method:
Code: [Select]
    def Tick(self):
        for each in self.players:
            if plus.getLocation(each)[1] < -10: # Adjust this parameter to floor height(s).
                plus.eliminatePlayer(each)

        ##################  Bot Flames + Smoke  ##################-------------

        if self.bHazardsOn:
            self.RI_0 = randint(-4, 4)
            self.RI_1 = randint(-4, 4)
            self.RI_2 = randint(-4, 4)
            self.RI_3 = randint(-2, 2)
            self.RI_4 = randint(-2, 2)
            self.RI_5 = randint(-2, 2)
            self.RI_6 = randint(-2, 2)
            self.RI_7 = randint(-2, 2)
            self.RI_8 = randint(-2, 2)
            self.RI_9 = randint(-2, 2)
            self.RI_D = randint(1, 4)
            self.RI_Y = randint(0, 2)

            self.BOT_Flame_0.Tick()  # Individual bot flames
            self.BOT_Flame_1.Tick()  # ""
            self.BOT_Flame_2.Tick()  # "" 
            self.BOT_Flame_3.Tick()  # "" 
            #self.BOT_Flame_4.Tick()  # Generic Lightning striking bot_flame.
            #self.BOT_Flame_5.Tick() 
            #self.BOT_Flame_6.Tick() 
            #self.BOT_Flame_7.Tick() 
            #self.BOT_Flame_8.Tick() 

            if 0 in self.players:
                if plus.getHealth(0,0) < 0.2:  #
                    if self.RI_SandF_0  <= 2:
                        plus.emitSmoke(1, (plus.getLocation(0)), (self.RI_3, 1 ,self.RI_4), (.2,.4,.2))
                if plus.getHealth(0,0) < 0.1:  #
                    if self.RI_SandF_0  < 0:
                        plus.emitSmoke(1,   (plus.getLocation(0)), (self.RI_4, self.RI_Y, self.RI_5), (.2,.4,.2))
                        self.BOT_Flame_0.BotFlameOff()   
                        self.BOT_Flame_0 = HazardsBlueRay.BotFlame(plus.getLocation(0), (self.RI_4, self.RI_Y, self.RI_5), (.2, .4, .2), .8)
                        self.BOT_Flame_0.BotFlameOn()

            if 1 in self.players:
                if plus.getHealth(1,0) < 0.2:  #
                    if self.RI_SandF_1  <= 2:
                        plus.emitSmoke(1, (plus.getLocation(1)), (self.RI_4, 1 ,self.RI_5), (.2,.4,.2))
                if plus.getHealth(1,0) < 0.1:  #
                    if self.RI_SandF_1  < 20:
                        plus.emitSmoke(1,   (plus.getLocation(1)), (self.RI_5, self.RI_Y, self.RI_6), (.2,.4,.2))
                        self.BOT_Flame_1.BotFlameOff()   
                        self.BOT_Flame_1 = HazardsBlueRay.BotFlame(plus.getLocation(1), (self.RI_5, self.RI_Y, self.RI_6), (.2, .4, .2), .8)
                        self.BOT_Flame_1.BotFlameOn()

            if 2 in self.players:
                if plus.getHealth(2,0) < 0.2:  #
                    if self.RI_SandF_2  <= 2:
                        plus.emitSmoke(1, (plus.getLocation(2)), (self.RI_5, 1 ,self.RI_6), (.2,.4,.2))
                if plus.getHealth(2,0) < 0.1:  #
                    if self.RI_SandF_2  < 0:
                        plus.emitSmoke(1,   (plus.getLocation(2)), (self.RI_6, self.RI_Y ,self.RI_7), (.2,.4,.2))
                        self.BOT_Flame_2.BotFlameOff()   
                        self.BOT_Flame_2 = HazardsBlueRay.BotFlame(plus.getLocation(2), (self.RI_6, self.RI_Y, self.RI_7), (.2, .4, .2), .8)
                        self.BOT_Flame_2.BotFlameOn()

            if 3 in self.players:
                if plus.getHealth(3,0) < 0.2:  #
                    if self.RI_SandF_3  <= 2:
                        plus.emitSmoke(1, (plus.getLocation(3)), (self.RI_6, 1 ,self.RI_7), (.2,.4,.2))
                if plus.getHealth(3,0) < 0.1:  #
                    if self.RI_SandF_3  < 0:
                        plus.emitSmoke(1,   (plus.getLocation(3)), (self.RI_8, self.RI_Y, self.RI_9), (.2,.4,.2))
                        self.BOT_Flame_3.BotFlameOff()   
                        self.BOT_Flame_3 = HazardsBlueRay.BotFlame(plus.getLocation(3), (self.RI_8, self.RI_Y, self.RI_9), (.2, .4, .2), .8)
                        self.BOT_Flame_3.BotFlameOn()

        ##################  Bot Flames + Smoke  ##################-------------

        return Arenas.SuperArena.Tick(self)

I'm posting this from my phone so hopefully I didn't mess up the spacing. Basically, I moved the random integers into the bHazardsOn check since they aren't being used when hazards are off (this shouldn't fix anything but it is better coding) and indented all of the smoke and fire activation code so that the previously noted issue doesn't happen in a different place.

Edit: I'll look into the music issue later.

Offline G.K.

  • *
  • Posts: 12156
  • Rep: 10
  • Striving for a good personal text since 1994.
    • View Profile
    • Awards
Re: Action Cam (?) causes Fight Result + Music to Glitch
« Reply #8 on: July 31, 2015, 04:24:58 PM »
It's all working perfectly now. Thanks so much once again Trov, you're a star.
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V.

Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)