Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Snippet Exchange

Junior Spellweaver
Joined
Oct 12, 2014
Messages
127
Reaction score
22
Code:
void obj_Player::UpdateLocalPlayerMovement()

Here is good, weight and acceleration backpack.

Code:
// apply weight to moving speed before gravity and jumping
 float weightAdj = 1.0f + ((m_GearWeight/100.0f)); // each 100kg half your speed
 
☆Dying Dawn☆
Joined
Jan 30, 2012
Messages
971
Reaction score
727
Cancel bodyAdjust when look up or down

This is not 100% done, have some bugs when the player use the aim to down or up so we have to update it just when use the weapon to aim
ai_player - look for this
Code:
void obj_Player::UpdateRotation()

and comment this
Code:
if(bodyAdjust_y[0] < bodyAdjust_y[1]) 
    {
        bodyAdjust_y[0] = R3D_MIN(bodyAdjust_y[0] + fTimePassed * 3.2f, bodyAdjust_y[1]);
    } 
    else if(bodyAdjust_y[0] > bodyAdjust_y[1]) 
    {
        bodyAdjust_y[0] = R3D_MAX(bodyAdjust_y[0] - fTimePassed * 3.2f, bodyAdjust_y[1]);
    } 
    else
        bodyAdjust_y[0] = bodyAdjust_y[1];
PROOF

GigaToni - Snippet Exchange - RaGEZONE Forums
GigaToni - Snippet Exchange - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Elite Diviner
Joined
Nov 28, 2014
Messages
427
Reaction score
249
See if changing the code above, it works

Code:
else if(r3dmouse::mCenterButton){ //New Logic, Just Testings..   
        uberAnim_->StopTurnInPlaceAnim();
        
        UpdateBodyAdjustX(&bodyAdjust_x, 0.f, fTimePassed * 4.0f);


        float fY = getMinimumAngleDistance(m_fPlayerRotation, m_fPlayerRotationTarget);
        UpdateRotationToTarget(fY, _ai_fTurnSpeedWalk);
    }
 
Junior Spellweaver
Joined
Jan 5, 2015
Messages
173
Reaction score
194
Code:
// lerp body bending to target
	if (m_isAiming) //burakdatlife :: only use this when player is aiming
	{
	if(bodyAdjust_y[0] < bodyAdjust_y[1]) {
		bodyAdjust_y[0] = R3D_MIN(bodyAdjust_y[0] + fTimePassed * 3.2f, bodyAdjust_y[1]);
	} else if(bodyAdjust_y[0] > bodyAdjust_y[1]) {
		bodyAdjust_y[0] = R3D_MAX(bodyAdjust_y[0] - fTimePassed * 3.2f, bodyAdjust_y[1]);
	} else
		bodyAdjust_y[0] = bodyAdjust_y[1];
	}

Thats better
 
Joined
Apr 23, 2013
Messages
1,172
Reaction score
1,738
Show GC/Dollar in MainMenu FrontEnd (all screen)

Goto and open
Code:
classes\warz\frontend\Frontend.as

Search
Code:
public    function setDollars (dollars:int)        {            money.dollars = dollars;            if(Main.Marketplace.isActiveScreen)                Main.Marketplace.setNewGD();        }        public    function setGC (gc:int)        {            money.gc = gc;            if(Main.Marketplace.isActiveScreen)                Main.Marketplace.setNewGC();            if(Main.CreateSurvPopup.visible)                Main.CreateSurvPopup.CreateSurvPopup.refreshCharacterUnlock();        }

Add
Code:
Main.MainMenu.MenuGD.Text.text = dollars;

In flash, add in MainMenu text with name MenuGD

Like / Done

Code:
public    function setDollars (dollars:int)        {            money.dollars = dollars;            Main.MainMenu.MenuGD.Text.text = dollars;            if(Main.Marketplace.isActiveScreen)                Main.Marketplace.setNewGD();        }        public    function setGC (gc:int)        {            money.gc = gc;            Main.MainMenu.MenuGC.Text.text = gc;            if(Main.Marketplace.isActiveScreen)                Main.Marketplace.setNewGC();            if(Main.CreateSurvPopup.visible)                Main.CreateSurvPopup.CreateSurvPopup.refreshCharacterUnlock();        }
 
Joined
Apr 23, 2013
Messages
1,172
Reaction score
1,738
Re: AirDrop container drop but fast - time

WarZ_Server.sln

Search
Code:
bool hitResult = g_pPhysicsWorld->raycastSingle(PxVec3(GetPosition().x, GetPosition().y + 0.5f, GetPosition().z), PxVec3(0, -1, 0), 1.0f, PxSceneQueryFlags(PxSceneQueryFlag::eIMPACT), hit, filter);

Easy, change 0.5f to 0.05f

Or copy>paste this
Code:
bool hitResult = g_pPhysicsWorld->raycastSingle(PxVec3(GetPosition().x, GetPosition().y + 0.05f, GetPosition().z), PxVec3(0, -1, 0), 1.0f, PxSceneQueryFlags(PxSceneQueryFlag::eIMPACT), hit, filter);

This will make AirDrop fall faster, and the softer refresh rate.
 
Joined
Apr 23, 2013
Messages
1,172
Reaction score
1,738
Re: Delay before returning back to idle

Nothing very important, simple.

WarZ.sln

Code:
void CUberAnim::SyncAnimation(int PlayerState, int MoveDir, bool force, const Weapon* weap, bool isInAttmMenu

Change here the sec

Code:
if(PlayerState == PLAYER_IDLE && ((r3dGetTime() < weap->getLastTimeFired() + [B][COLOR=#0000ff]5.0f[/COLOR][/B]) && !IsFPSMode())) // 5sec delay before returning back to idle

// switch state if we firing in idle mode
and
// switch state if we firing in idle mode
 
Joined
Apr 23, 2013
Messages
1,172
Reaction score
1,738
Re: Fix jump backward

Just remove RED text
Code:
// process jump after assigning InputAcceleration, so that we can predict where player will jump        if(!disablePlayerMovement)        {            if(pl->bOnGround && (InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_JUMP)||Gamepad->WasPressed(gpA))                 && !crouching                 && !proning                && !swimming                && !pl->IsJumpActive()                [COLOR=#ff0000]&& prevAccel.z >= 0 /* prevent jump backward*/[/COLOR]                )            {                pl->StartJump();            }        }

I know! is easy, will have problems? I don't know, I'm not programmer.
 
Newbie Spellweaver
Joined
Jun 23, 2017
Messages
7
Reaction score
0
Dunno if its usefull but here Look in ur source for

Code:
// detect loot type modifier from channel

and u gonna see something like this

Code:
void CJobGetLootboxData::OnSuccess()
{   
 r3dOutToLog("Loot boxes data updated\n"); CLOG_INDENT;  

  // detect loot type modifier from channel   
  int srvLootType = 0;   
 if(gServerLogic.ginfo_.channel == 1) srvLootType = 1; // trial
 else if(gServerLogic.ginfo_.channel == 4) srvLootType = 2; // premium 
 g_pWeaponArmory->updateLootBoxContent(out_xmlFile.child("LootBoxDB"), srvLootType);}

And u can do some Changes for the loot

Code:
void CJobGetLootboxData::OnSuccess()
{    

r3dOutToLog("Loot boxes data updated\n"); CLOG_INDENT;    // detect loot type modifier from channel    //Loot Drop Rate    
int srvLootType = 0;    
if(gServerLogic.ginfo_.channel == 1) srvLootType = 1.5; // hardcore
    else if(gServerLogic.ginfo_.channel == 2) srvLootType = 1; // Offical 
   else if(gServerLogic.ginfo_.channel == 3) srvLootType = 0.5; // Private 
 else if(gServerLogic.ginfo_.channel == 4) srvLootType = 2; // premium 
 g_pWeaponArmory->updateLootBoxContent(out_xmlFile.child("LootBoxDB"), srvLootType);}

Not Sure if it Rly work but it seems so


And i even Found Something else

Look for
Code:
// Private and Premium servers have double the amount of vehicle spawns

and u Gonna See something like this

Code:
void obj_VehicleSpawnPoint::ReadSerializedData(pugi::xml_node& node)
{   
 parent::ReadSerializedData(node); 

 pugi::xml_node spawnNode = node.child("spawn_parameters");

 GetXMLVal("MaxSpawns", spawnNode, &maxSpawns);
    // Private and Premium servers have double the amount of vehicle spawns 
   if (gServerLogic.ginfo_.channel == 3 || gServerLogic.ginfo_.channel == 4) 
       maxSpawns *= 2;}

u can Adjust the Car Spawns aswell i dont know if its gonna work
 
Last edited:
Experienced Elementalist
Joined
May 28, 2017
Messages
225
Reaction score
127
Fix weapon reload bug(Actually this fix that if you have 30 bullets in a stanag 60 than dont change the stanag 60 to a stanag 30 when we equip a magazine with the same max bullets like our currently clip):

// if current clip is full, do not reload
if(getSelectedClipID() == clipCfg->m_itemID && getNumBulletsLeft() == clipCfg->m_Clipsize)
return;

and dont forget to add:

int getSelectedClipID()
{
// override client logic without modifying Var1, melee should always have one bullet left
if(m_pConfig->category == storecat_MELEE)
return 1;

return getPlayerItem().Var2;
}



Im going to release some small poop now what everyone maybe wants to have or to use for there emulator, I mean well there are probably only thais who needs that because that what I release is only simple poop.

// reload bigger magazine

int ammoSlot = optionalAmmoSlotToUse;
int ammoSlotOldVar1 = 0;
if(ammoSlot==-1)
{
bool foundMagazin = false;
for(int i=0; i<m_Owner->CurLoadout.BackpackSize; i++)
{
if(m_Owner->CurLoadout.Items.itemID == clipCfg->m_itemID)
{
wiInventoryItem& ammoItm = m_Owner->CurLoadout.Items;

if(ammoItm.Var1 == -1) {
foundMagazin = true;
ammoSlot = i;
break;
}
else if(ammoItm.Var1 > ammoSlotOldVar1)
{
ammoSlot = i;
ammoSlotOldVar1 = ammoItm.Var1;
//break;
}
//break;
}
}
//break;
}
if(ammoSlot == -1) {
return;
}
 
Experienced Elementalist
Joined
May 28, 2017
Messages
225
Reaction score
127
Im not going to post something special, but that here could be useful for some people to drop an airdrop or to do other stuff that might need a use of this function here: "SRV_WORLD_SCALE(VALUE)" This will fix your problem for dropping an airdrop on different maps, so if u just do "pos.y -= 2.0f" then its sometimes faster and sometimes slower on different maps, so just use "pos.y -= SRV_WORLD_SCALE(2.0f)"
 
Back
Top