Blockland Forums > Suggestions & Requests
Jetpack system - needs scripter
<< < (5/16) > >>
Thé Lord Tony:
This is the script used in Old School Rifle that changes the datablock. It doesn't change health at all. All health and damage taken do not change values.


--- Code: ---ActivatePackage(OldSchoolRifle);

function altRifleImageScoped::onMount(%this,%obj,%slot)
{
Parent::onMount(%this,%obj,%slot);
serverPlay3D(altRifleScopeSound,%obj.getTransform());

%client = %obj.client;
%client.player.setDataBlock("oldschoolrifleArmor");

}

function altRifleImageScoped::onUnMount(%this,%obj,%slot)
{
Parent::onMount(%this,%obj,%slot);
serverPlay3D(altRifleScopeBackSound,%obj.getTransform());


%client = %obj.client;
if(!isObject(%client.minigame))
{
%client.player.setDataBlock("PlayerStandardArmor");
}else{
%client.player.setdatablock(%client.minigame.playerDatablock);
}
}

--- End code ---


--- Code: ---datablock PlayerData(oldschoolrifleArmor : PlayerStandardArmor)
{
firstPersonOnly=1;

   runForce = 10 * 180;
   runEnergyDrain = 0;
   minRunEnergy = 0;
   maxForwardSpeed = 3;
   maxBackwardSpeed = 3;
   maxSideSpeed = 3;

   maxForwardCrouchSpeed = 0;
   maxBackwardCrouchSpeed = 0;
   maxSideCrouchSpeed = 0;

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

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


uiName = "";
showEnergyBar = false;

   runSurfaceAngle  = 45;
   jumpSurfaceAngle = 45;
};
--- End code ---
Demian:

--- Quote from: Thé Lord Tony on February 20, 2013, 03:55:42 PM ---This is the script used in Old School Rifle that changes the datablock. It doesn't change health at all. All health and damage taken do not change values.


--- Code: ---...
%client.player.setDataBlock("oldschoolrifleArmor");
...

--- End code ---


--- Code: ---datablock PlayerData(oldschoolrifleArmor : PlayerStandardArmor)
...
--- End code ---

--- End quote ---
That script changes the playertype this this oldschoolrifleArmor which appends non-defined values from PlayerStandardArmor. It does change the health. It chages the health to whatever the health is in PlayerStandardArmor which is 100.
Thé Lord Tony:
Well I never seen a 200 health DM but for whatever reason there is one they can either change the preference or not use it due to compatibility issues. There's really nothing I can do unless you rather have the jetpack fly like a helicopter using height controls.

Then again it would be considered as a vehicle and won't have fuel.


I'll ask around anyways I know a few scripters.
Isaac Fox:
Can't we just do this? When a player picks up a jetpack item, it immediately appears on their back, replacing any player nodes on the player's back, and it enables jets, with the jet particles emitting from the jetpack instead of the player's feet. When the jetpack runs out of fuel, it will disappear and disable jets.
Demian:

--- Quote from: Thé Lord Tony on February 20, 2013, 04:06:29 PM ---Well I never seen a 200 health DM but for whatever reason there is one they can either change the preference or not use it due to compatibility issues. There's really nothing I can do unless you rather have the jetpack fly like a helicopter using height controls.

--- End quote ---
That's why I mentioned wizardry in my earlier post. I think there is a way to get the current player object > the playertype datablock that object is using > the various values in that playertype and then use those as variables in the jetpack playertype but that is way beyond my skills.

So yeah the item and mounting is done. Now I need a script that mounts an image the the jetpack when you press right click regardless of the item you are currently holding as well the wizardry above. Using a custom fuel jet player with no jet emitter would work great. I also need a script for recharging the fuel/energy when you pick up another jetpack (while you already have a jetpack in your inventory).


--- Quote from: Isaac Fox on February 20, 2013, 04:09:26 PM ---Can't we just do this? When a player picks up a jetpack item, it immediately appears on their back, replacing any player nodes on the player's back, and it enables jets, with the jet particles emitting from the jetpack instead of the player's feet. When the jetpack runs out of fuel, it will disappear and disable jets.

--- End quote ---
I would prefer if it was an item and reusable. A one time use jetpack could be a separate item.
Navigation
Message Index
Next page
Previous page

Go to full version