Game Development Community

Adv chapter 3

by gillian anderson · in Torque Game Engine · 06/08/2006 (3:03 am) · 8 replies

I can't run the examples in chap3. i get an error message saying can't find object ' '

About the author

Recent Threads

  • Press 'm' for map
  • Weapon

  • #1
    06/08/2006 (3:59 pm)
    Look at the code on the cd. It works.
    #2
    06/09/2006 (2:33 am)
    In fact none of the code for chapter 4 of the adv book works (door swinging)
    similar problem. i have copied the code from CD into Torque demo.
    is there a complete running example for the whole book, not just the chapter resources?
    #3
    06/11/2006 (7:44 am)
    The code on the cd works. Even the swinging door code. :)
    What I did was to compare the code. That helped me learn a lot about torque.
    Also, your error about "not finding object", make sure it exists and that the code is looking in the right place for it.
    #4
    06/11/2006 (9:05 am)
    I recently went through chapter 3 and typed all the programs out and don't recall any major problems. What I would recommend is that you check very carefully that the code you typed is exactly the same as that in the book. Watch out for variables/function names that are misspelled. I had a similar problem with chapter 4 and the solution was that I had mistyped a datablock name.

    Going off topic here, but In my opinion, I think TorqueScript would be better if it DID require variable declaration as it would minimise problems that occur due to mistyping. Is there a technical reason why Torque doesn't require this?

    --Amr
    #5
    06/13/2006 (3:06 am)
    Thanks for your help.

    this is the problem.
    i copied the chap 3 files from resources into the demo and followed the 3 steps on page 90 adv book.

    i get:
    ...
    loading compiled scripts demo/server/scripts/myServerScripts.cs
    ...
    then when i run the demo and press j, i get:

    *********we be warping!*********
    demo/server/scripts/myServerScripts.cs (12). unable to find object' ' attempting to call function ''getEyeVector'.

    it can't seem to recognise %client
    #6
    06/14/2006 (12:21 am)
    When i was doing this example In the book I had to break down the functions with echo and finally realized that found, was returning to much info for example I would get "3149 28 21 20" when I all I needed was the handle of the door object of 3149. I simply added a line of code after

    %found = ContainerRayCast(%start, %end, $TypeMasks::StaticShapeObjectType, %player);

    I just simply adde the following code line

    %found = getword(%found, 0);

    that cleared the problem right up. It was the first time I used echo to solve an issue and will be using it more ofter to help zero in on my problems
    #7
    06/16/2006 (5:49 am)
    Solution:
    PlayerKeymap.Bind(keyboard,j,Warp1);

    function Warp1(%val)
    {
    if (%val)
    commandToServer('Warp1');
    }
    #8
    08/30/2006 (3:26 pm)
    I found it usefull to decalre a $Debug variable in the root main.cs, then every major function call/ step in a function I put

    if ($Debug) Echo("We just did this...");

    then when we are set to release instead of removing the 1000+ echo commands we just set debug = false and they dont execute, thats just me though