Game Development Community

Changing the Player jumpDelay value

by Andrea Russo · in Technical Issues · 10/20/2006 (8:04 am) · 2 replies

How can I modify the jumpdelay of the "tutorial.base" folder?

in C:\Torque\SDK\example\tutorial.base\server\player.cs there only is the folloving code:

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

// Load dts shapes and merge animations
datablock TSShapeConstructor(PlayerDts)
{
   baseShape = "~/data/shapes/player/player.dts";
   sequence0 = "~/data/shapes/player/player_root.dsq root";
   sequence1 = "~/data/shapes/player/player_forward.dsq run";
   sequence2 = "~/data/shapes/player/player_back.dsq back";
   sequence3 = "~/data/shapes/player/player_side.dsq side";
   sequence4 = "~/data/shapes/player/player_fall.dsq fall";
   sequence5 = "~/data/shapes/player/player_land.dsq land";
   sequence6 = "~/data/shapes/player/player_jump.dsq jump";
   sequence7 = "~/data/shapes/player/player_standjump.dsq standjump";
   sequence8 = "~/data/shapes/player/player_lookde.dsq look";
   sequence9 = "~/data/shapes/player/player_head.dsq head";
   sequence10 = "~/data/shapes/player/player_headside.dsq headside";
   sequence11 = "~/data/shapes/player/player_celwave.dsq celwave";
};

datablock PlayerData(PlayerShape)
{
   renderFirstPerson = false;
   shapeFile = "~/data/shapes/player/player.dts";
};


//----------------------------------------------------------------------------
// PlayerShape Datablock methods
//----------------------------------------------------------------------------

function PlayerShape::onAdd(%this,%obj)
{
   // Called when the PlayerData datablock is first 'read' by the engine (executable)
}

function PlayerShape::onRemove(%this, %obj)
{
   if (%obj.client.player == %obj)
      %obj.client.player = 0;
}

function PlayerShape::onNewDataBlock(%this,%obj)
{
   // Called when this PlayerData datablock is assigned to an object
}

I tried to insert the following code ( and a few variations from C:\Torque\SDK\example\starter.fps\server\scripts\player.cs ) but it didn't work:

datablock PlayerData(PlayerBody)
{

   jumpForce = 8.3 * 90;
   jumpEnergyDrain = 0;
   minJumpEnergy = 0;
   jumpDelay = 15;

   recoverDelay = 9;
   recoverRunForceScale = 1.2;

};

Thanks in advance for your help.

:)

#1
10/20/2006 (6:01 pm)
When i saw this
C:\Torque\SDK\example\starter.fps\server\scripts\player.cs
vs
C:\Torque\SDK\example\tutorial.base\server\player.cs

i almost cried, i am the worst offender for editing the wrong file (vs.net is evil)

what you want is to add

jumpForce = 8.3 * 90;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
jumpDelay = 15;

to

datablock PlayerData(PlayerShape)
{
renderFirstPerson = false;
shapeFile = "~/data/shapes/player/player.dts";
};



which is your player datablock
that looks a little short so do a search for
datablock PlayerData
in tut.base and see if anything looks better.

good luck with it!

edit:spelling
#2
10/20/2006 (7:08 pm)
Thank you very much Andrew :)