Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MP Hax Package (referred to as "MPHP") vs Marble Blast Super (referred to as "MBS")
- MPHP:
- // Jeff: grab the client sided marble, very useful for clients to have
- // some control of the marble object
- function getMyMarble() {
- //No errors!
- if (!isObject(ServerConnection)) {
- return;
- }
- for (%i = 0; %i < ServerConnection.getCount(); %i ++) {
- %obj = ServerConnection.getObject(%i);
- if (%obj.getClassName() $= "Marble") {
- //HiGuy: If you are not the host, your marble is always the second one
- $Game::MyMarble = %obj;
- return %obj;
- }
- }
- return -1;
- }
- MBS:
- function getMyMarble()
- {
- if (!isObject(ServerConnection))
- return;
- if ($Multiplayer::MyMarble !$= "")
- return $Multiplayer::MyMarble;
- for (%i = 0; %i < ServerConnection.getCount(); %i++)
- {
- %obj = ServerConnection.getObject(%i);
- if (%obj.getClassName() $= "Marble")
- {
- $Multiplayer::MyMarble = %obj;
- return %obj;
- }
- }
- }
- MPHP:
- //HiGuy: Hides other peoples' Marbles (caps because they are of the Marble class)
- function hideFreddies() {
- //No errors!
- if (!isObject(ServerConnection)) {
- return;
- }
- //We need our marble to compare marbles
- if (!isObject($Game::MyMarble) && getMyMarble() == -1)
- return;
- cancel($Game::HideFreddieSchedule);
- //Iterate!
- for (%i = 0; %i < ServerConnection.getCount(); %i ++) {
- %obj = ServerConnection.getObject(%i);
- //If it's a marble, and it's not us
- if (%obj.getClassName() $= "Marble" && %obj.getId() != $Game::MyMarble.getId()) {
- //Easy hiding, as we can't use .hide or the game will crash
- %obj.setScale("0 0 0");
- //Get them out of the way, we don't want shadows
- %obj.setTransform("0 0 -1000000 1 0 0 0");
- }
- }
- $Game::HideFreddieSchedule = schedule($MP::Core::HideFreddieDelta, 0, hideFreddies);
- }
- MBS:
- function hideMarbles()
- {
- if (!isObject(ServerConnection))
- return;
- if ($Multiplayer::MyMarble $= "")
- {
- getMyMarble();
- return;
- }
- for (%i = 0; %i < ServerConnection.getCount(); %i++)
- {
- %obj = ServerConnection.getObject(%i);
- if (%obj.getClassName() $= "Marble" && %obj.getId() != $Multiplayer::MyMarble.getId())
- {
- %obj.setScale(0);
- %obj.setTransform("0 0 -1000000 1 0 0 0");
- }
- }
- }
- MPHP:
- //HiGuy: Actually hides the ghost
- function hideMyGhost() {
- //No errors!
- if (!isObject(ServerConnection)) {
- return;
- }
- //We need our marble to compare scales
- if (!isObject($Game::MyMarble) && getMyMarble() == -1)
- return;
- //Iterate!
- for (%i = 0; %i < ServerConnection.getCount(); %i ++) {
- %obj = ServerConnection.getObject(%i);
- //If it's a ghost...
- if (%obj.getClassName() $= "StaticShape" && strStr(%obj.getDataBlock().shapeFile, "/balls/") != -1) {
- //If it has the same scale as our marble
- if (getWord(%obj.getScale(), 0) $= $Game::MyScale) {
- //BAD GHOST
- %obj.hide(true);
- break;
- }
- }
- }
- }
- MBS:
- function getMyGhost()
- {
- if (!isObject(ServerConnection))
- return;
- if ($Multiplayer::MyGhost !$= "")
- return $Multiplayer::MyGhost;
- for (%i = 0; %i < ServerConnection.getCount(); %i++)
- {
- %obj = ServerConnection.getObject(%i);
- if (%obj.getClassName() $= "StaticShape" && strStr(%obj.getDatablock().shapeFile, "/balls/") != -1 && getWord(%obj.getScale(), 0) $= $Multiplayer::MyScale)
- {
- $Multiplayer::MyGhost = %obj;
- return %obj;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement