Game Development Community

Script fixes (vehicle dismount, movie recorder)

by Paulb · in Torque Game Engine · 01/30/2003 (4:03 pm) · 7 replies

Here are some quick fixes for some of the broken scripting in Torque.

Vehicle Dismounting:

In the player.cs file find the function, Armor::doDismount(). The line:

%obj.schedule(4000, "SetMountVehicle", true);

should be changed to:

%obj.schedule(4000, "MountVehicles", true);

Then after that line, add the following:

// Prepare Dismount.
   // Mount last weapon used, unmount from node, and give player control.
   %this.onUnMount(%obj);
   %obj.unMount();
   %obj.setControlObject(%obj);

If you can't mount vehicles, just make sure you set the mountable property to true when you create your vehicle object.

function WheeledVehicleData::create(%block)
{
   %obj = new WheeledVehicle() {
      dataBlock = %block;
   };
   %obj.mountable = true;
   return(%obj);
}



Movie Recorder:

In /common/client/screenshot.cs find the function, recordMovie(). The line:

$screenGrabThread = schedule("movieGrabScreen(" @ %movieName @ ", 0);", $timeAdvance);

should be changed to:

$screenGrabThread = schedule($timeAdvance,0,movieGrabScreen,%movieName,0);

Now in the movieGrabScreen() function underneath, find the line:

$screenGrabThread = schedule("movieGrabScreen(" @ %movieName @ "," @ %frameNumber + 1 @ ");", $timeAdvance);

Change it to:

$screenGrabThread = schedule($timeAdvance,
      0,
      movieGrabScreen,
      %movieName,
      %frameNumber+1);

The movie recorder takes a screenshot at a defined interval. You provide the title of the movie and the rate at which screenshots should be made.

There is another small fix I should mention. The ItemData::OnPickup() method in /fps/server/scripts/item.cs, prints an invisible message to the client. The line:

messageClient(%user.client, 'MsgItemPickup', '\c0You picked up %1', %this.pickupName);

Should be changed to:

messageClient(%user.client, 'MsgItemPickup', '\You picked up %1', %this.pickupName);

Or some other color value, just not "c0".


All of this may have already been fixed, but it may be useful to some forum goers.


Project Shadow
http://www.vaevictisgames.com

#1
01/30/2003 (6:08 pm)
Maybe you should submit them as patches to any of the GG staff members so they can roll them in into cvs... or at least tell them about the bugs via email so you make sure they notice them.
#2
01/30/2003 (6:40 pm)
Thanks for the suggestion.
#3
02/04/2003 (5:25 pm)
How would I set a key to dismount the vehicle?
#4
02/04/2003 (10:40 pm)
Hey, thanks Paul!

That movie fix will be great.

-Eric
#5
02/05/2003 (2:47 pm)
These fixes have been integrated into the HEAD revision in CVS. Thanks Paul!
#6
07/23/2007 (2:59 am)
@ Edward: this key is already set, if you read the comments in doDismount it says this function is getting called through the engine when trigger2 is triggered, so youll have to press the jump key.
#7
07/23/2007 (5:58 am)
Man that post was over 4 years ago. If he has been waiting that long for an answer, I'd hate to see what his development timeline looks like.