Author Topic: Making a player unable to move?  (Read 1365 times)

Is there any way to do this? :o

Non-moving playertype

somewhere on RTB

Non-moving playertype

somewhere on RTB
that isnt what i wanted.

that isnt what i wanted.
I know it isn't, but Torque doesn't work that way.

You need to change the player's datablock to one that cannot move.

I know it isn't, but Torque doesn't work that way.

You need to change the player's datablock to one that cannot move.

Ya, like Iban said that is what you need to do, also what are you trying to do it for. Becuase you could make a toggle in the script to change the client to that and then on the second use put them back there original datablock.

I know it isn't, but Torque doesn't work that way.

You need to change the player's datablock to one that cannot move.
Right then.

I'm just trying to make a player have a sort of "sleep" mode where they can't move.

k thanks for the help guys

Right then.

I'm just trying to make a player have a sort of "sleep" mode where they can't move.

k thanks for the help guys
Woah! Epiphany. There is another way.

You know if you get smoked in ZAPT, your camera orbits your player but it can't move?

This is how.
Code: [Select]
// Funct: Sets the client camera to orbit the %obj.
// Sends: void
function Armor::zombieCameraSpectate(%this, %obj)
{
if(isObject(%obj))
{
%client = %obj.client;

if(isObject(%client))
{
%transform = %obj.getTransform();
%client.camera.setOrbitMode(%obj, %transform, 0.5, 8, 8, 1);
%client.camera.mode = "Orbit";
%client.setControlObject(%client.camera);
}
}
}

Return control to player.
Code: [Select]
if(isObject(%client))
{
%client.setControlObject(%client.player);
}

If you need any further detail of how this functions, just speak up.

Not that this is a bad or thing, or that you do not have the right or do not deserve to but you really love you ZAPT addon. Also that pretty cool way of doing it.

I remember when I had an epiphany like that.

thanks a bunch.  :cookieMonster:

question: What role does the variable %this play in that function? :o
« Last Edit: February 28, 2011, 10:54:49 PM by otto-san »

Not that this is a bad or thing, or that you do not have the right or do not deserve to but you really love you ZAPT addon. Also that pretty cool way of doing it.
ZAPT packages almost every function a novice modder will need or want to package.
It contains dozens and dozens of really nifty tricks.

It's a resource.

I remember when I had an epiphany like that.

thanks a bunch.  :cookieMonster:

question: What role does the variable %this play in that function? :o
None.

Armor functions are used when you want something to apply to only one kind of player.

For instance,

Code: [Select]
function Armor::zombieExplode(%this, %obj)
{
// Nothing!
}

Why make this function? So I can put this function in on top of it.

Code: [Select]
function ZombieBoomerArmor::zombieExplode(%this, %obj)
{
// Boomer explosion code here.
}

Then, I can call %armor.zombieExplode(); and it will always work with no console errors. If the boomer explodes, however, the bile affect is applied to nearby players.


For what you are doing, you do not need to use an Armor function. Just apply the code I give you intelligently to the function where the "discombobulation" happens.

Right then. Thank you for your help.

Non-moving playertype

somewhere on RTB
i should know it's there, as i uploaded it :D
and iban's way would be useful for things

There's many ways to make a player not able to move.

Mount it to an invisible (or visible) static shape, set the client's control object to a camera, etc.

There's many ways to make a player not able to move.

Mount it to an invisible (or visible) static shape, set the client's control object to a camera, etc.
Mounting a player to an invisible static shape not only requires some hacking to prevent the player for being able to just right click off the mount, but it requires additional datablocks and a shapefile with proper mount points. The camera method is by far superior.