1 Reply Latest reply on Aug 20, 2006 7:30 PM by Roofy

    Bad Parameter ! box

    JustStupid
      Hello,

      I have a message box which pops when I run my code, but it doesn't look like a error with my code, its a smaller warning sign message box saying "Bad Parameter" I haven't put a alert box like this anywhere in my code. My code is using a shockwave 3D sprite and connect to shockwave multiuser server on local machine. What do you think this error could be? A bug with director? or with a Xtra? I'm using havok, and 3DPI as well.

      Cheers for any replies
        • 1. Bad Parameter ! box
          Roofy
          besides creating message boxes of your own, Diretor will spit out errors in a message box if there is any errors in your scripts, depending on if you are in author mode or runtime mode, When you get an error in athouring mode, and you get an error, this means there is a peice of code that Driector does not understand at all. For example, lets say you wanted to move a sprite on the stage 5 pixels down the stage. The correct dot syntax to do so is like so....

          sprite(1).locV = sprite(1).locV + 5

          ... but lets say you made a mistake and typed this in...

          sprite(1).locV = sprite.locV + 5

          doing this and after you press the compile button or close the script window, you would get an error window that looks simular to as you calling the alert handler stating...
          "Script Error: Operator expected"
          sprite(1).locV = sprite.?locV + 5

          In addition, you can also have errors at run time. An example of this would be somthing like so...

          lets say we still want to move this sprite 5 pixels down, but this time you want this to happen when you call a custom handler. Now the correct way of doing this can be something like this...

          property pTimer

          on beginSprite
          pTimer = the milliseconds
          end beginSprite

          on exitFrame me
          if (the millseconds - pTimer) = 1000 then
          moveMe(me)
          pTimer = the milliseconds
          end if
          go to the frame
          end exitFrame

          -- Note the code below is the custom handler that needs to be inside the same script or else you will get an error at runtime
          on moveMe me
          sprite(me.spriteNum).locV = sprite(me.spriteNum).locV + 5
          end moveMe

          ... now if you did not have the moveMe custom handler inside the above script then at runtime you would get the same error window stating this


          "Script error: Handler not defined
          moveMe(me)

          #moveMe"

          So what I am saying is, your error is a script error that Director is spiting out because there is something wrong with your code, and we can not help you if you do not post your script in here.