Game Development Community

Nothing, delete this account.

by Olag Beshcaati · in General Discussion · 03/22/2008 (4:31 pm) · 13 replies

Nothing, delete this account.

#1
03/22/2008 (6:28 pm)
Constructor doesn't save as Map. torque doesn't use Map. it used DIF.
#2
03/22/2008 (6:46 pm)
Nothing, delete this account.
#3
03/22/2008 (10:10 pm)
...
#4
03/22/2008 (11:00 pm)
Nothing, delete this account.
#5
03/23/2008 (5:48 am)
Quote:Triggers I have done, but I don't know how to make it freeze the player and play a movie.

Have you done a dump of the players functions from within the console? (IE: player.dump(); )
You may have to write a function to actually freeze him. I know there are some functions already implemented in the default class that you could use to help you. (just don't recall which ones)
You'll need a few functions:

function playerFreeze ...

function playerUnFreeze ...

and the function to play a theora video is simular to playing a sound.

//-----------------------------------------------------------------------------
// Torque Game Engine 
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// DefaultTrigger is used by the mission editor.  This is also an example
// of trigger methods and callbacks.

datablock TriggerData(VideoTrigger)
{
   // The period is value is used to control how often the console
   // onTriggerTick callback is called while there are any objects
   // in the trigger.  The default value is 100 MS.
   tickPeriodMS = 100;
};


//-----------------------------------------------------------------------------

function VideoTrigger::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);

   PlayVideoFile();
}

function VideoTrigger::onLeaveTrigger(%this,%trigger,%obj)
{
   // This method is called whenever an object leaves the %trigger
   // area, the object is passed as %obj.  The default onLeaveTrigger
   // method (in the C++ code) invokes the ::onTrigger(%trigger,0) method on
   // every object (whatever it's type) in the same group as the trigger.
   Parent::onLeaveTrigger(%this,%trigger,%obj);

   StopVideoFile();
}

function VideoTrigger::onTickTrigger(%this,%trigger)
{
   // This method is called every tickPerioMS, as long as any
   // objects intersect the trigger. The default onTriggerTick
   // method (in the C++ code) invokes the ::onTriggerTick(%trigger) method on
   // every object (whatever it's type) in the same group as the trigger.

   // You can iterate through the objects in the list by using these
   // methods:
   //    %this.getNumObjects();
   //    %this.getObject(n);
   Parent::onTickTrigger(%this,%trigger);
}

   function PlayVideoFile()
{
%filename = "wtc/data/vid/911tribute.ogg";
tributeVideo.setFile(%filename);
//tributeVideo.setVisible(true);
canvas.pushDialog(myVideoGui);

echo("Entered Video Area");
}
function StopVideoFile()
{
tributeVideo.stop();
//tributeVideo.setVisible(false);
canvas.popDialog(myVideoGui);
echo("Left Video Area");
}
You'll also need a gui to play your video on

//--- OBJECT WRITE BEGIN ---
new GuiControl(myVideoGui) {
   Profile = "GuiDefaultProfile";
   HorizSizing = "right";
   VertSizing = "bottom";
   position = "0 0";
   Extent = "640 480";
   MinExtent = "8 2";
   Visible = "1";
   
   new GuiTheoraCtrl(tributeVideo) {
      canSaveDynamicFields = "0";
      Profile = "GuiDefaultProfile";
      HorizSizing = "right";
      VertSizing = "bottom";
      position = "114 50";
      Extent = "376 306";
      MinExtent = "8 2";
      canSave = "1";
      Visible = "1";
      hovertime = "1000";
      done = "0";
      stopOnSleep = "0";
      backgroundColor = "0 0 0 255";
   };
   };
//--- OBJECT WRITE END ---

That should get you going.
#6
03/23/2008 (5:44 pm)
Nothing, delete this account.
#7
03/24/2008 (2:10 am)
There are some books on torque script but there are none for the c++ code. For that you need to look at tdn or the docs.
#8
03/24/2008 (9:17 pm)
Nothing, delete this account.
#9
03/25/2008 (11:53 am)
Why couldn't you buy it yourself, and why $1,000?
#10
03/25/2008 (3:27 pm)
When i Learned Torque Script (also I'm no pro) I visited several sites that had free starter tutorials that get you started into understanding the scripting envorment. Check out the lessons in the resource area for more help thats where i started. The books are okay IMO but not the best in Human teachings. I value the user made tutorials more than the books, only because they more likely can be contacted easier and also their code seems to work better.

My starters was:

http://www.codesampler.com/torque.htm
#11
03/27/2008 (12:48 am)
Nothing, delete this account.
#12
03/28/2008 (11:00 am)
1. To make the player freeze, you can remove the control bindings (the keystrokes that make him move) and set the players position to make sure that it's not still moving.

2. You're on your own for saving, haven't figured that one out myself yet...
#13
03/28/2008 (2:32 pm)
Nothing, delete this account.