So yeah.
A bit of debate in IRC over the physics in Freebuild led to the discovery of a bug related to jump force and jetlag.
I'll outline the basic problem:
1. At game start (those familiar with player.cs should know this) the mass of a minifig is set at 30 and the jump force is set at 70.
2. Now, you should know, that at a jump force of only 70 and a mass of 30, a minifig can only jump about one plate high.
3. In TBGserverCmd.cs function servercmdtoggleJet both the mass and jump force of the minifig are set. The mass is set to the jetlag, and the jump force is set to twelve times the jetlag.
4. Now, this is a bad thing. Why? What's twelve times 35?
5. 430. Yeah. Exactly. This leads one to believe that they're, in fact, not playing on Earth, but the Moon.
Alright, here's my proposed solution.
1. Rewrite the Admin GUI such that "Jetlag" is renamed "Jet Force".
2. Replace the servercmdtoggleJet function with this one:
Code:
Please note that the above code will actually work without the player having to suicide. Mainly because it doesn't change the player's mass.
3. Redefine the minifig's mass as 35 and jumpForce as 230. This will allow the minifig to jump just over seven blocks high.
4. ???
5. Victoly!
6. This will ALSO allow the server host to define the jump force seperately from jet force. Success!
This, I believe, should solve the problem entirely.
A bit of debate in IRC over the physics in Freebuild led to the discovery of a bug related to jump force and jetlag.
I'll outline the basic problem:
1. At game start (those familiar with player.cs should know this) the mass of a minifig is set at 30 and the jump force is set at 70.
2. Now, you should know, that at a jump force of only 70 and a mass of 30, a minifig can only jump about one plate high.
3. In TBGserverCmd.cs function servercmdtoggleJet both the mass and jump force of the minifig are set. The mass is set to the jetlag, and the jump force is set to twelve times the jetlag.
4. Now, this is a bad thing. Why? What's twelve times 35?
5. 430. Yeah. Exactly. This leads one to believe that they're, in fact, not playing on Earth, but the Moon.
Alright, here's my proposed solution.
1. Rewrite the Admin GUI such that "Jetlag" is renamed "Jet Force".
2. Replace the servercmdtoggleJet function with this one:
Code:
function servercmdtoggleJet(%client, %value) {
if( %client.getRank() >= $Rank::Admin ) {
if( %value < 0 || %value > 200)
messageClient(%client, 'MsgAdminForce', '\c2\x96Please pick a value between 0 and 200 inclusive.');
else {
$Pref::Server::Jet = %value;
for (%player=nametoid(LightMaleHumanArmor); %player<=nametoid(MWhite); %player++) {
%player.jetJumpForce = $Pref::Server::Jet;
}
messageAll("MsgAdminForce", "\c2\x96Jetpack Force is now\c3 " @%value@ "\c2.");
}
}
}
Please note that the above code will actually work without the player having to suicide. Mainly because it doesn't change the player's mass.
3. Redefine the minifig's mass as 35 and jumpForce as 230. This will allow the minifig to jump just over seven blocks high.
4. ???
5. Victoly!
6. This will ALSO allow the server host to define the jump force seperately from jet force. Success!
This, I believe, should solve the problem entirely.