Game Development Community

Error: wrong number of arguments

by Matthew W · in Torque Game Engine · 04/26/2008 (7:14 pm) · 2 replies

This is really confusing me; do yall have any ideas?

i'm trying to do this
moveMap.bind( mouse, button0, useButton0);

//by matthew
function useButton0(%val) {

   
   if (%val) {
  
      %place = PlayGui::onMouseDown(GameConnection::getCameraObject());
      1785.setMoveDestination(%place, true);


   //%cl = ClientGroup.getObject(0);
   //%place = groundZ(%cl.getMouse3DPos());
   //echo ("Our place = ",%place);
   //%place = "0 0 0";
   
}
}


But it gives me this error message
Quote:tutorial.base/client/default.bind.cs (134): ::getCameraObject - wrong number of arguments.


In Appendix A from GPGT, on page 69, it lists
Quote:getCameraObject()
like that with out any parameters. So why would it complain about the wrong number of arguments?

#1
04/26/2008 (7:35 pm)
getCameraObject is a method and thus must be called on some object, e.g. like

ServerConnection.getCameraObject();

The GameConnection:: you are using above is just a namespace qualifier.
#2
04/26/2008 (10:37 pm)
Thank you.