Game Development Community

RTS prototype Unknown command setMoveDestination.

by gowinder · in Torque Developer Network · 01/12/2010 (2:56 am) · 32 replies

when i follow the document to the rts prototype, after i add
if( %scanTarg )
{
ClientGroup.getObject(0).player.setMoveDestination( getWords(%scanTarg, 1, 3) );
}
in scripts/gui/playGui.cs at the PlayGui::onRightMouseDown function,then i run the demo to test it with torsion, at the output window there is an error:
scripts/gui/playGui.cs (84): Unknown command setMoveDestination.
Object (3244) Player -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject

what is my problem?
Please help me guys!

About the author

Recent Threads

Page «Previous 1 2
#1
01/12/2010 (6:37 am)
When you create the player object. Create it as AIPlayer, not Player.
#2
01/12/2010 (9:12 pm)
i'll try , thanks!
#3
01/12/2010 (9:18 pm)
it really works!
thanks JANR!
what is the different between player and AIPlayer?
Dose the AIplayer have the path find method?
#4
09/22/2013 (6:59 am)
The player doesn't always move when i right click
is there a fix for that ?
#5
09/22/2013 (3:31 pm)
Yup - make sure you followed the steps correctly. You should have had a step that removes a GUI element from the center of the screen - it blocks mouse input. See the picture right above the line "Mouse-Driven Input".
docs.garagegames.com/torque-3d/official/content/documentation/Scripting/Advanced/images/RTS_RemoveDamageHUD.png
#6
01/15/2014 (10:37 am)
I have a similar problem with the function, setMoveDestination, and the third day I can not find exactly which script is the place where the created instance of objec "player", which is necessary to replace the word "player" to "AI player," I need instructions. I have several times started this lesson (RTS_Prototype) from the beginning, in the hope that I will find the place where I had a mistake, but every time I had the exact same error. Hope only on you, explained to me where that place?
#7
01/15/2014 (12:49 pm)
The object is of type AIPlayer, not Player. Player objects do not have a setMoveDestination() method because a human controls a Player object using keyboard/mouse input.

This step (right before Camera Setup) ensures that the default player spawns as an AIPlayer:

Quote:
Next, in scripts/server/gameDM.cs we'll change the default player class and datablock. In DeathMatchGame::initGameVars() make the following changes:
$Game::defaultPlayerClass = "AiPlayer";
    $Game::defaultPlayerDataBlock = "BoomBotData";
Later there is a step (right before Movement) that describes setting up a spawnsphere to create a specific object class:
Quote:
If you have multiple spawn spheres, delete all except for one. We can control what type of actor is spawned by changing the properties of the remaining spawn sphere. Select the sphere, then change the spawnClass to AIPlayer and spawnDatablock to BoomBotData. Also, change the name of the spawn sphere to PlayerSpawn. Technically this step is optional, but if you add other player types you will want to be able to specify who spawns where. This mechanism allows you to do that with minimal effort.


docs.garagegames.com/torque-3d/official/content/documentation/Scripting/Advanced/images/RTS_SpawnProperties.png
This basically replicates the change we made in script earlier, but only for this specific spawn point. You could as easily used MyBossData for the spawnDatablock field and then that spawnpoint would spawn MyBoss objects.
#8
01/16/2014 (10:06 am)
Thanks for the quick feedback, for me it is especially valuable now. I will try now even more closely to scour this part to find something there what I did not notice when I did it in the past attempts.
#9
01/17/2014 (8:52 am)
I'm here again, after attempts to consider all this under the microscope, I found a little info, and it looks strange and confused, but I have a hypothesis. I see the following situation is ...
When I opened the "scripts / server / gameDM.cs", and found the function "DeathMatchGame :: initGameVars ()" that turned out all right in there, and done exactly as it was written in the instructions, and it looks like the following ...
snag.gy/EHFG5.jpgThen I opened World Editor to check what there is present, and there are also all correctly. and looks like on the screenshot ...
snag.gy/abP3W.jpgBut then when I run the game mode on execution, and give a command by pressing the right mouse button in order to character started moving in this place. in the game nothing happens.
Then I create a new soldier pressing the "B" it appears in the place where my camera and falls to the ground. After that I click the left mouse button to start an attack and again nothing happens. After all these steps, I open the console and see next...
snag.gy/YDvMI.jpg
#10
01/17/2014 (9:26 am)
I think the problem is, in that there is need to change, a lot of names in different scripts, with Player to AIPlayer and it scares me terribly, because if you search every word in a completely unpredictable places, it is very uncomfortable in my opinion. I very much hope that all of this because I missed somewhere specific detail, and it is hidden somewhere out there, but for some reason I do not see it, please help me to find.
#11
01/17/2014 (10:59 am)
"Unable to find object '' attempting to call "
This means you're passing nothing to a function that expects something. Again, you've managed to either miss a step or you're "testing" before all necessary steps have been completed. I see that the "Unknown command setMoveDestination" error is gone at least.

Have you completed the entire tutorial? If so, you have to click the unit you want to move then right-click the place you want to move it to. If you want a unit to attack another you have to click the unit you want to use then click the unit you want it to attack.

If you were using Torsion debugging this script would be much easier. If you're unwilling or unable to part with $40 I suggest checking out this blog. The author has released a Torque development environment for free and it might have Torquescript debugging capabilities.

Quote:I think the problem is, in that there is need to change, a lot of names in different scripts, with Player to AIPlayer and it scares me terribly,
Welcome to game development. Games are complex software systems, this is not uncommon. Learning to troubleshoot and debug software is part of the game development process. Since I can't sit next to you while you go through the tutorial there is no way for me to see exactly what went wrong - so you're going to have to start using the echo() command at strategic locations to output more useful information to the console, or use a script debugging tool to catch breakpoints and examine what's happening.

Or, download the scripts that came with the tutorial and examine them directly. Use a tool like Beyond Compare or Winmerge to compare your scripts to the tutorial versions - the scripts are available at http://docs.garagegames.com/torque-3d/official/content/documentation/Scripting/Advanced/rts_prototype_scripts.zip
#12
01/18/2014 (10:47 am)
Thanks again for your advice and manuals, and for pointing about software. I should note that I think about buying Torsion for $ 50 but before that, I want to go all the training course. In order to understand for myself for sure if I'll be working with Torque future date or is not suitable for me. If yes, then I will gladly buy all the necessary tools to work seriously. But if not, I will continue my search for a place to "forge". And now I have not decided completely.

Quote:Quote:I think the problem is, in that there is need to change, a lot of names in different scripts, with Player to AIPlayer and it scares me terribly,
I have to rehabilitate this phrase, I mean that's what scares me UNKNOWN "map layout to scripts, unknown to me style in different places". and not of the complexity of its structure with the amount of work has to be done. =)

PS I apologize if somewhere somehow not correctly combine the words into sentences, for me this still difficult to translate all my thoughts in English text.
#13
01/18/2014 (4:35 pm)
Did you check out the tool in this blog? The author says it's a free Torque development environment - maybe it'll help with your debugging.
#14
01/19/2014 (9:45 am)
Yes I tried it immediately as you recommended to me to try, but so far I do not understand how to use it.
Yesterday and today I tried to open, correctly to work within the project, but probably I wrong I understand this project loading mechanism.
Maybe somewhere have a short instruction?
#15
01/19/2014 (9:56 am)

I have a small hypothesis where I could make a mistake (when I was doing an exercise "RTS manual") and now I'm trying to check this assumption.
#16
01/19/2014 (10:15 am)
Now of the end I figured out how to integrate the project relatively correctly in TorqueDev. but not all clear, especially unclear what type of project, need to choose when creating a new project TGE or TSE? and what the difference between them? In addition, completely not clear why when I check even absolutely clean project (new project "full"), which I yet have not changed anything, the debugger gave me are too many errors, but the project is started without any problems.
#17
01/20/2014 (4:22 pm)
Perhaps contact the guy who made TorqueDev? Or just download Torsion and use the 30 day trial.
#18
01/21/2014 (9:14 am)
This time I again started from the beginning lesson (RTS) and found a place in the tutorial which I did not understand what to do, because the specified

file does not exist in the specified directory. Here is fragment of the lesson ...
Quote:
The function call being modified is GameCore::spawnPlayer(%game, %this, %spawnPoint, %noControl), located in

game/core/scripts/server/gameCore.cs. The last two arguments determine the location of spawning (%spawnPoint) and whether or not the actor object

controls the camera (%noControl). We need to address that next.

Immediately below the %game.spawnPlayer() function, add the following code:
// Set camera to Overhead mode   
   commandToServer('overheadCam');

but just above this paragraph, the text listed a similar directory but another ...
Quote:
Mouse Cursor Toggling
Normally, the camera is controlled by an actor in FPS (aim) mode. To focus on just mouse and camera work, we need to change how the default camera

is controlled. Open game/scripts/server/gameCore.cs. In function GameCore::preparePlayer(%game, %client), locate the following line:
%game.spawnPlayer(%client, %playerSpawnPoint);

Change this code by adding a third argument to the function call:
%game.spawnPlayer(%client, %playerSpawnPoint, false);

with this directory everything okay.
#19
01/21/2014 (9:43 am)
Quote:
Perhaps contact the guy who made TorqueDev?

I know that the author asked not to disturb him for about support. here ...
Quote: Please do not contact me about support for either the software or the source code. If you do decide to release your own build because you made significant changes to make it better, feel free to let me know at sam@bacsa.ca.
from here ... www.torquedev.com/

Quote:
Or just download Torsion and use the 30 day trial.

yes it is a healthy idea!
#20
01/21/2014 (9:51 pm)
Quote:game/core/scripts/server/gameCore.cs.
Good catch - this should be game/scripts/server/gameCore.cs.
Page «Previous 1 2