Game Development Community

$myBot=AIPlayer::spawnPlayer(); help

by Tim W. Cress · in Torque Game Engine · 10/26/2003 (10:45 am) · 4 replies

Hi,

If Newb was in the dictionary my picture would be in the definition.I have followed several instructions on "adding a bot
in Torque",to no avail.Including the tutorial by Stefan Beffy Moises on the site "Tork Zenkel".I have imported the 2 files
aiPlayer.h and aiPlayer.cc to C:\torque\vc7\Torque SDK in VSC++.net7.0\TorqueDemo\game and recompiled.
When I enter this command in the Console,
$myBot01=AIPlayer::spawnPlayer("bot");
I get this return,
unable to find function AIPlayer::spawnPlayer

I have done numerous forum and tutorial searches on this
problem.My guess is that I am not adding the
aiPlayer.h and the aiPlayer.cc in the correct place or manner.

Thankyou for your time and patients as I am unskilled in
this area

Tim

#1
10/26/2003 (11:31 am)
The error means the "Scripting Language"
was unable to find the function..
not the c++ side of things.


so, double check your syntax.
then find where the aiPlayer.cs is located verify the function exhists.

then verify that the file is executed within the scope of your configuration.

if all else fails....
execute the file manually in the console, and try again.
#2
10/26/2003 (5:52 pm)
Thankyou for the reply Badguy.

I will work on your suggestions.Can anyone tell if I
added aiPlayer.h and aiPlayer.cc in the right place by
my previous post?

Also is execute the file manually in the console different
than what I was doing?


Thanks again Badguy,
I have read several of your posts gg.

Tim
#3
10/26/2003 (11:18 pm)
Np :)

looks like the right place.
that one will work.

basically just adding that allows it to get built into the binary.

still tho, the script has not gotten far enuff to need the class yet.

to verify the script is loaded simply view the file:
game.cs located in the server/scripts folder.

depends on your working version exactly tho.

anyhow to execute a file:
exec("path/aiPlayer.cs");
to execute this from the console you would need to type the path starting with the mod I believe.

you can simply view the console output to see if it is executed already.

what version is this?
#4
10/27/2003 (12:27 pm)
OK,

With your help I got it working "thanks" Badguy.
The prollem was not compiling correctly along with
incorrect syntax in the addplayer command.The command that works in the console is $myBot=aiAddPlayer("bots name");

I'm not sure how to tell what version I have.
It was the Head around 10/8/03 before the build that needs
VC++.net 7.10 to open the source.

thanks Bad,

Tim