Author Topic: How can I disable jumping but enable swimming?  (Read 1477 times)

I just don't know how to get it to change datablocks in water

Package Player::onEnterLiquid(%this) and Player::onLeaveLiquid(%this) and call %this.setDatablock(YourNoJumpDatablock); and %this.setDatablock(YourJumpDatablock); respectively.

You'll probably want to add a check to make sure they're the opposite datablock before switching them though, so if some unrelated player falls in they don't get transformed.

Those are actually methods of the player datablock, so you wouldn't even need to do datablock checks if you just were to do something like:

YourNoJumpDataBlock::onEnterLiquid(%this, %obj)
    change to YourJumpDatablock

YourJumpDataBlock::onLeaveLiquid(%this, %obj)
    change to YourNoJumpDatablock

Those are actually methods of the player datablock, so you wouldn't even need to do datablock checks if you just were to do something like:

YourNoJumpDataBlock::onEnterLiquid(%this, %obj)
    change to YourJumpDatablock

YourJumpDataBlock::onLeaveLiquid(%this, %obj)
    change to YourNoJumpDatablock

You missed two arguments. %coverage and %type.

Code: [Select]
datablock PlayerData(PlayerNojump : PlayerStandardArmor)
{
canjet=0;
firstPersonOnly=1;
jumpForce = 0 * 0; //0 * 0;
uiName = "No Jump Player";
};

So I need this and just a generic jumping playertype but with jets off and first person only.

Code: [Select]
datablock PlayerData(PlayerNojump : PlayerStandardArmor)
{
canjet=0;
firstPersonOnly=1;
jumpForce = 0 * 0; //0 * 0;
uiName = "No Jump Player";
};

So I need this and just a generic jumping playertype but with jets off and first person only.
Yep.


Would you be able to help I can't get it to work.
-Snip-
That's not good for learning.

Give us your code so we can help you.
« Last Edit: March 22, 2014, 08:11:28 AM by jes00 »