Author Topic: Modifying a Player Type  (Read 944 times)

I've been trying to make a super simple player model, and I'm having a really hard time doing it. Sometimes it will work, but I will want to change the maximum forward speed minutely. And after I change literally a single number it will stop working. It will show up in the add on list before I start the server, but it won't show up in the player type lists in the events of a brick or in a mini game.

I've just taken quake-like player and copied the file, and replaced everything with things that suit my needs for the player type.

I've got the WinRAR ZIP archive file inside of my Documents > Blockland > Add-Ons folder and for the sake of example it's called Player_Weekday. Inside of the zip folder is two files, one named description.txt and one named server.cs . The description.txt file I haven't change at all, so it has this written on it;

Title: Quake-Like Player
Author: Eric Hartman
A player that moves very fast, has high air-control and can't jump very high.  Similar to quake.


The server.cs file has this written on it;

datablock PlayerData(PlayerQuakeArmor : PlayerStandardArmor)
{
   runForce = 100 * 90;
   runEnergyDrain = 1;
   minRunEnergy = 5;
   maxForwardSpeed = 5;
   maxBackwardSpeed = 3;
   maxSideSpeed = 3;

   maxForwardCrouchSpeed = 2;
   maxBackwardCrouchSpeed = 1;
   maxSideCrouchSpeed = 1;

   jumpForce = 9 * 90; //8.3 * 90;
   jumpEnergyDrain = 30;
   minJumpEnergy = 32;
   jumpDelay = 0;

   minJetEnergy = 0;
   jetEnergyDrain = 0;
   canJet = 0;

   uiName = "Weekday Player";
   showEnergyBar = true;

   rechargeRate = .7;

   runSurfaceAngle  = 55;
   jumpSurfaceAngle = 55;
};



I'm not sure at all why it is so spastic to work. I've tried deleting it entirely and restarting from scratch (by copying the quake-like player etc). I've never done anything with player types, and I'm really ignorant about it. I hope I posted this in the correct zone, and any help is very appreciated.

Since this a Torque Script problem it belongs in the Coding Help: http://forum.blockland.us/index.php?board=25.0
It seems you're overwriting the PlayerQuakeArmor default playertype as you're using the same datablock name.

Since this a Torque Script problem it belongs in the Coding Help: http://forum.blockland.us/index.php?board=25.0
It seems you're overwriting the PlayerQuakeArmor default playertype as you're using the same datablock name.

I apologize, I don't think I can move this thread myself without the help of an administrator, but if I can please inform me and I will.

(I do have the default quake player disabled when I'm trying to do any of this)

If I were to fix this, I would change the line

datablock PlayerData(PlayerQuakeArmor : PlayerStandardArmor)
to something like
datablock PlayerData(PlayerWeekdayArmor : PlayerStandardArmor)

I have no idea what the armor part is, I didn't even know there was such a thing.

I always thought that ( <anything> : <anything> ) was a ratio-like setup, but I'm just confused though.

If you could answer one other question too, what does the

runForce = 100 * 90;

Exactly mean? Does it literally mean what it showed, as in one hundred multiplied by 90, or is there some kind of hidden little thing there?

I apologize, I don't think I can move this thread myself without the help of an administrator, but if I can please inform me and I will.
You can't but you can lock this thread and make a new one in the forum but since we've started let's continue here.

(I do have the default quake player disabled when I'm trying to do any of this)
It's bad practice to overwrite existing stuff.

If I were to fix this, I would change the line

datablock PlayerData(PlayerQuakeArmor : PlayerStandardArmor)
to something like
datablock PlayerData(PlayerWeekdayArmor : PlayerStandardArmor)
Correct.

I have no idea what the armor part is, I didn't even know there was such a thing.
It's just a name.

I always thought that ( <anything> : <anything> ) was a ratio-like setup, but I'm just confused though.
It's about inheritance. (MyNewDatablock : DefaultDatablock) means MyNewDatablock takes all the variables and values from DefaultDatablock so the new datablock is identical to old one unless you change it.


If you could answer one other question too, what does the

runForce = 100 * 90;

Exactly mean? Does it literally mean what it showed, as in one hundred multiplied by 90, or is there some kind of hidden little thing there?
Nope. That's all it is. It's made like that so it's easy to change. The default player runs at speed 100 * 43.2 which is equal to 4320. You could either do runForce = 4320; or runForce = (100 * 43.2); and there would be no difference.

Thank you so much for all of your help so far, but I'm still having a problem. When I open Blockland and start a custom server, I have the option to turn my player type add-on on and off. Of course I have it on, and start the game. After I get into game it is still not appearing in the lists of player types. Here is what my server.cs file looks like when I try to do this;

Code: [Select]
datablock PlayerData(PlayerWeekdayArmor : PlayerStandardArmor)
{
   runForce = 3500;
   runEnergyDrain = 1;
   minRunEnergy = 5;
   maxForwardSpeed = 5;
   maxBackwardSpeed = 3;
   maxSideSpeed = 3;

   maxForwardCrouchSpeed = 2;
   maxBackwardCrouchSpeed = 1;
   maxSideCrouchSpeed = 1;

   jumpForce = 9 * 90; //8.3 * 90;
   jumpEnergyDrain = 30;
   minJumpEnergy = 20;
   jumpDelay = 0;

minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;

uiName = "Weekday Player";
showEnergyBar = true;

rechargeRate = .7;

   runSurfaceAngle  = 55;
   jumpSurfaceAngle = 55;
};

I'm really sorry for this too long thread for what the problem is, and thank you for your continued assistance.

rechargeRate = .7;

A value cannot begin with the decimal

try 0.7 instead

Thank you very much! Adding the zero worked.

Thank both of you for helping me, I am really grateful. I'll lock this topic now.