Author Topic: Playertype crashing blockland. (new trouble)  (Read 993 times)

I am just getting into scripting and was wondering why is my playertype crashing blockland when I try to start a server with it enabled? I will provide the code. It is just really a modified quake like player (if I recall)

Code: [Select]
//slowPlayer.cs

//a new player datablock with slow movement



datablock PlayerData(playerQuakeArmor : PlayerStandardArmor)
{
   runForce = 20 * 10;
   runEnergyDrain = 0;
   minRunEnergy = 0;
   maxForwardSpeed = 15;
   maxBackwardSpeed = 15;
   maxSideSpeed = 15;
  
   maxForwardCrouchSpeed = 5;
   maxBackwardCrouchSpeed = 5;
   maxSideCrouchSpeed = 5;

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

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

uiName = "Slow Player";
showEnergyBar = false;

   runSurfaceAngle = 55;
   jumpSurfaceAngle = 55;
};

Thank you.
« Last Edit: November 25, 2010, 01:37:54 PM by slimabob »

PlayerdStandardArmor

There seems to be a d that doesn't belong.

Thanks, i fixed that and am now starting a server "crosses fingers"

Ok, now the server starts up but it wont show up in the "playertype" list. Is there something that I am missing?

(double toast)

You might wanna change the datablock's name. The original quake player might be overwriting it.

playerQuakeArmor

Change that.

What should I change it to? Or does it not matter?

EDIT: Huzzah, Player_Slow now works! Thank you so much. It is amazing how just one word and a letter can mess up a script!
« Last Edit: November 25, 2010, 02:34:12 PM by slimabob »

You should refrain from using underscores. Not sure why but no one seems to use them.


In my opinion:
Underscores are for seperating concepts, while uppercase is for seperating words.

MyMod_SomeCode

Also, each concept should start uppercase unless the first word of it is a verb.

Thus:
isEnabled_SubFunction_elseCra sh

if you wand a convoluted and unrealistic example.

In variable names, though, they can be from a n-dimensional array, with n >= 2, so _ doesn't work as well in variables.

PlayerSlow doesn't feel right, SlowPlayer and Player_Slow do.

Summary: In my opinion, for naming (especially function names), an uppercase letter is like a space, and an underscore is like a comma or a semicolon, a small pause between groups of words that don't flow together with just a space but clarify each other. "Arthur Dent" and "Dent, Arthur" make sense, but "Dent Arthur" doesn't.