Game Development Community

Problem on RPG dialog addon from

by Lynn Song · in Torque Game Engine · 12/14/2004 (9:16 pm) · 3 replies

Is there anyone using RPG dialog by Nelson A. K. Gonsalves?

I met a problem while using it:

function spawntestnpc(); could be called and npc appears, but the TalkTo() function never get called when I press q key.

it is inside xxx\client\scripts\default.bind.cs:
------------------------------------------------------------------
function TalkTo(%val)
{
echo("Calling TalkTo()");
if(%val)
echo("Calling commandToServer()");
commandToServer('RPGDialogRay');
}

moveMap.bind( keyboard, "q", TalkTo );
------------------------------------------------------------------

I am using the demo mod but not the starter.fps within the SDK, I will try putting them together inside starter.fps. But, anyone could help me figure out what's happening? Thx

#1
12/14/2004 (9:42 pm)
It works on starter.fps by guidence from: www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3531
#2
12/14/2004 (9:43 pm)
I've never tried using this resource, but I think you've made a syntax error. If you intend for the command to server line to be contained within the if statement, it should look like this:

function TalkTo(%val)
{
    echo("Calling TalkTo()");
    if(%val)
    {
        echo("Calling commandToServer()");
        commandToServer('RPGDialogRay');
    }
}

otherwise that commandtoserver will be called once when you press the key, and once when you release it. I doubt this is the problem unless that function toggles the dialog, but it's something you should be aware of.
#3
12/14/2004 (9:53 pm)
Thanks a lot for noticing the error! I really should be more careful on basics even using scripting:)