1

I'm currently working on a private server for the now closed Disney server, but whenever my client throws a pie it crashes and gives me this error.

File "toontown\toon\Toon.py", line 3029, in getTossPieInterval
    endPos=Point3(0, dist, 0), duration=time)
TypeError: __init__() got an unexpected keyword argument 'startPos'
Press any key to continue . . .

Here is the code that breaks

def getTossPieInterval(self, x, y, z, h, power, throwType, beginFlyIval = Sequence()):
    from toontown.toonbase import ToontownBattleGlobals
    from toontown.battle import BattleProps
    pie = self.getPieModel()
    flyPie = pie.copyTo(NodePath('a'))
    pieName = ToontownBattleGlobals.pieNames[self.pieType]
    pieType = BattleProps.globalPropPool.getPropType(pieName)
    animPie = Sequence()
    if pieType == 'actor':
        animPie = ActorInterval(pie, pieName, startFrame=48)
    sound = loader.loadSfx('phase_3.5/audio/sfx/AA_pie_throw_only.ogg')
    if throwType == ToontownGlobals.PieThrowArc:
        t = power / 100.0
        dist = 100 - 70 * t
        time = 1 + 0.5 * t
        proj = ProjectileInterval(None, startPos=Point3(0, 0, 0),
                                  endPos=Point3(0, dist, 0), duration=time)
        relVel = proj.startVel
    elif throwType == ToontownGlobals.PieThrowLinear:
        magnitude = power / 2. + 25

        relVel = Vec3(0, 1, 0.25)
        relVel.normalize()
        relVel *= magnitude

    def getVelocity(toon = self, relVel = relVel):
        return render.getRelativeVector(toon, relVel)

    toss = Track((0, Sequence(Func(self.setPosHpr, x, y, z, h, 0, 0), Func(pie.reparentTo, self.rightHand), Func(pie.setPosHpr, 0, 0, 0, 0, 0, 0), Parallel(ActorInterval(self, 'throw', startFrame=48), animPie), Func(self.loop, 'neutral'))), (16.0 / 24.0, Func(pie.detachNode)))
    fly = Track((14.0 / 24.0, SoundInterval(sound, node=self)), (16.0 / 24.0, Sequence(Func(flyPie.reparentTo, render), Func(flyPie.setScale, self.pieScale), Func(flyPie.setPosHpr, self, 0.52, 0.97, 2.24, 89.42, -10.56, 87.94), beginFlyIval, ProjectileInterval(flyPie, startVel=getVelocity, duration=3), Func(flyPie.detachNode))))
    return (toss, fly, flyPie)
halfer
  • 19,824
  • 17
  • 99
  • 186
  • Can you show the full traceback of your exception? The exception seems to be referencing your call `ProjectileInterval(None, startPos=Point3(0, 0, 0), endPos=Point3(0, dist, 0), duration=time)`. Where does the `ProjectileInterval` class come from? – Blckknght Jun 23 '14 at 03:57

2 Answers2

1

I'm not familiar with this server or the library you're using, but the error implies that the ProjectileInterval constructor does not want the startPos keyword argument. If you have source or documentation for that code, double check the arguments it expects.

Rob Lourens
  • 15,081
  • 5
  • 76
  • 91
-1

Its with panda3d. For some reason its not recognizing ProjectileInterval args. If you want, some things can be changed with a LerpPosInterval, however, since this uses a Velocity arg, the LerpPosInterval will not work. Perhaps try to define the args in the init of the toon.py, i'm not sure that will work, but it may.