[Tutorial] Fix Fall Damage

Results 1 to 8 of 8
  1. #1
    Android Developer doidloko is offline
    MemberRank
    Aug 2012 Join Date
    BrasilLocation
    253Posts

    happy [Tutorial] Fix Fall Damage

    open your warz server.sln

    search

    PHP Code:
    void obj_ServerPlayer::OnNetPacket(const PKT_C2S_FallingDamage_sn){
    r3dOutToLog("Falling damage to %s, damage=%.2f\n"Name.c_str(), n.damage); CLOG_INDENT;
    gServerLogic.ApplyDamage(thisthisGetPosition(), n.damagetruestorecat_INVALID);


    change to

    PHP Code:
    void obj_ServerPlayer::OnNetPacket(const PKT_C2S_FallingDamage_sn){
    float nulldamage 0.f;
    r3dOutToLog("Falling damage to %s, damage=%.2f\n"Name.c_str(), nulldamage); CLOG_INDENT;
    gServerLogic.ApplyDamage(thisthisGetPosition(), nulldamagetruestorecat_INVALID);


    Credits: vinnieshuda


  2. #2
    Enthusiast Izeliae is offline
    MemberRank
    Oct 2005 Join Date
    43Posts

    Re: [Tutorial] Fix Fall Damage

    this is stupid, if you dont want to take fall damage you should've removed it in your released client. if you decide to remove it on the server you should just drop the packet instead of sending a 0 damage packet back to the player, eating bandwidth and wasting cpu cycles.

    Code:
    void obj_ServerPlayer::OnNetPacket(const PKT_C2S_FallingDamage_s& n)
    {
    //r3dOutToLog("Falling damage to %s, damage=%.2f\n", Name.c_str(), n.damage); CLOG_INDENT; 
    //gServerLogic.ApplyDamage(this, this, GetPosition(), n.damage, true, storecat_INVALID); 
    }

  3. #3
    Member bone1554 is offline
    MemberRank
    Mar 2009 Join Date
    91Posts

    Re: [Tutorial] Fix Fall Damage

    What the @ Izeliae said is correct and also your way @ doidloko when the player falls down a mountain or the game will make the effects of damage (blood on screen and noise of pain) where 0 is returned damage. it can scare the player, thinking ta getting shot or something ... The best method is to comment and leave it empty. But do not remove the function completely because somewhere it is called and this crash can occur.

  4. #4
    Alpha Member javaz97 is offline
    MemberRank
    May 2006 Join Date
    HellLocation
    1,537Posts

    Re: [Tutorial] Fix Fall Damage

    new

    void obj_ServerPlayer::OnNetPacket(const PKT_C2S_FallingDamage_s& n)
    {
    r3dOutToLog("Falling damage to %s, damage=%.2f\n", Name.c_str(), n.damage); CLOG_INDENT;
    r3dOutToLog("Falling damage Disable\n", Name.c_str(), n.damage); CLOG_INDENT; // No Damage Enabled
    if (!profile_.ProfileData.isDevAccount)
    {
    gServerLogic.ApplyDamage(this, this, GetPosition(), n.damage, true, storecat_INVALID,false);
    }
    }

  5. #5
    Account Upgraded | Title Enabled! Stargate75 is offline
    MemberRank
    Apr 2013 Join Date
    GermanyLocation
    72Posts

    Re: [Tutorial] Fix Fall Damage

    This is the fix.

    Search
    desc.nonWalkableMode = PxCCTNonWalkableMode::ePREVENT_CLIMBING;
    Change to

    desc.nonWalkableMode = PxCCTNonWalkableMode::eFORCE_SLIDING;

  6. #6
    Alpha Member javaz97 is offline
    MemberRank
    May 2006 Join Date
    HellLocation
    1,537Posts

    Re: [Tutorial] Fix Fall Damage

    thank stargate75

  7. #7
    Member Arman Avetisyan is offline
    MemberRank
    Jan 2014 Join Date
    71Posts

    @DNC New Source not working standart fall damage disable(HOW TO DISABLE FALL DAMAGE?)

    This tut not working with new Dnc source


    EDIT by DNC:
    Would the OP be interested in modifying this tutorial to work with the new Community Edition code?

    Moved and edited post.
    Thank you
    Last edited by DNC; 14-06-14 at 05:36 PM. Reason: Moved and edited post.

  8. #8
    Alpha Member javaz97 is offline
    MemberRank
    May 2006 Join Date
    HellLocation
    1,537Posts

    Re: [Tutorial] Fix Fall Damage

    desc.material = g_pPhysicsWorld->PhysXSDK->createMaterial(0.5f, 0.5f, 0.1f);
    desc.userData = (void*)physCallbackObj;
    desc.nonWalkableMode = PxCCTNonWalkableMode::ePREVENT_CLIMBING;
    //desc.nonWalkableMode = PxCCTNonWalkableMode::eFORCE_SLIDING; // Fix Fall Damage by stargate75
    desc.groupsBitmask = 1<<params.type;

    dnc 2014

    ???
    Last edited by javaz97; 15-06-14 at 02:43 PM.



Advertisement