Game Development Community

Trigger Problem

by Jermaine Morgan · in Torque Game Engine · 10/14/2008 (7:56 pm) · 7 replies

I made a trigger.

When the player walks through the trigger a GUI pops ups. <---this works great

My problem is when he walks through the mouse completely stops working. The crosshair stops moving, i cant look up, down, left or right. I only can move the character.(Just cant turn him)

I am using the fps starter kit.

this is my trigger code
function PracticeTrigger::onEnterTrigger(%this,%trigger,%obj)
{
   // This method is called whenever an object enters the %trigger
   // area, the object is passed as %obj.  The default onEnterTrigger
   // method (in the C++ code) invokes the ::onTrigger(%trigger,1) method on
   // every object (whatever it's type) in the same group as the trigger.
   Parent::onEnterTrigger(%this,%trigger,%obj);
Canvas.pushDialog(HomeTown);
//echo ("I entered a practice trigger");
}



I have no errors in the console


Please help
Thanks in advance.

#1
10/15/2008 (5:32 pm)
Bumps
#2
10/15/2008 (7:29 pm)
The trigger code looks good. The fact that you say the GUI does pop up also indicates that the trigger seems to work. The fault sounds like it is in the HomeTown pop up, what does it's code look like?
#3
10/15/2008 (8:20 pm)
Depending on what type of GUI dialog you're using depends on whether you have to close it. If it's not related to the HUD it's probably taken mouse control and is waiting for you to close the dialog. Think of what happens when you hit ESC whilst playing, the "do you want to quit? Y/N" dialog pops up and takes mouse control, waiting for you to select the button.

If you just want to display something on screen it's probably best to link it as a HUD element. (I did this a bit ago but currently have my modelling brain engaged and thus can't quite remember how).
#4
10/17/2008 (6:54 am)
Thanks guys for the replies. Here is the code I'm using

//--- OBJECT WRITE BEGIN ---
new GuiControl(HomeTown) {
   canSaveDynamicFields = "1";
   Profile = "GuiDefaultProfile";
   HorizSizing = "right";
   VertSizing = "bottom";
   position = "0 0";
   Extent = "800 600";
   MinExtent = "8 2";
   canSave = "1";
   Visible = "1";
   hovertime = "1000";

   new GuiTextCtrl() {
      canSaveDynamicFields = "1";
      Profile = "GuiBigTextProfile";
      HorizSizing = "right";
      VertSizing = "bottom";
      position = "21 53";
      Extent = "161 40";
      MinExtent = "8 2";
      canSave = "1";
      Visible = "1";
      hovertime = "1000";
      text = "HomeTown";
      maxLength = "1024";
   };
};
//--- OBJECT WRITE END ---

Any ideas? Any help.

I'm stuck on this one. lol
#5
10/17/2008 (8:19 am)
Look into cursorOff(); cursorOn();
#6
10/17/2008 (12:27 pm)
Within the definition of HomeTown, try adding
noCursor = "1";
This is a line that gets left out of the usual GUI creation process, for some reason, but means that your mouse moves the cursor instead of your player.

At least, I think this is the issue you're seeing.
#7
10/17/2008 (7:03 pm)
@Daniel

Thanks that fixed it.