How to add crafting (Works for any source)
Okay, so lets get started. This is a basic tutorial, and may need some work.
All i ask for in return in likes.
EDIT!
Make sure to add the .cpp to the project, and change the file directories in HUDCraft.CPP.
Code:
In HUD_TPSGame.cpp
After
#include "UI\HUDVault.h"
Add
#include "UI\HUDCraft.h"
Then after
HUDVault* hudVault = NULL;
Add
HUDCraft* hudCraft = NULL;
After
hudVault = new HUDVault();
Add
hudCraft = new HUDCraft();
After
hudVault->Init();
Add
hudCraft->Init();
After
hudVault->Unload();
Add
hudCraft->Unload();
After
SAFE_DELETE(hudVault);
Add
SAFE_DELETE(hudCraft);
After
if(hudVault->isActive())
return;
Add
if(hudCraft->isActive())
return;
After
else if(InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_INVENTORY))
hudPause->showInventory();
}
else
hudPause->Deactivate();
}
Add
bool showCraft = Keyboard->WasPressed(kbsY);
if (Keyboard->WasPressed(kbsU))
{
//hudTrade->Activate("FAPFAPFAP");
}
if(showCraft)
{
if(!hudCraft->isActive())
{
hudCraft->Activate();
}
}
After
if(hudVault->isActive() && Keyboard->WasPressed(kbsEsc))
hudVault->Deactivate();
Add
if(hudCraft->isActive() && Keyboard->WasPressed(kbsEsc))
hudVault->Deactivate();
After
R3DPROFILE_END( "hudVault->" );
return;
}
Add
if(hudCraft->isActive())
{
r3dMouse::Show(); // make sure that mouse is visible
R3DPROFILE_START( "hudCraft->" );
hudCraft->Update();
hudCraft->Draw();
R3DPROFILE_END( "hudCraft->" );
return;
}
Now, for key bindings
in
R3DInput.cpp
After
{kbsT , "T" },
Add
{kbsY , "Y" },
After
kbsT = DIK_T,
Add
kbsY = DIK_Y,
Now in DEBUG.HPP
After
'T', kbsT, 0,
Add
'Y', kbsY, 0,
After
'T', kbsT, 0,
Add
'Y', kbsY, 0,
Fix/Error update
Code:
HUDDisplay.cpp
After
#include "HUDDisplay.h"
Add
#include "HUDCraft.h"
After
PKT_C2C_PlayerUseItem,
Add
PKT_C2C_PlayerCraftItem,
After
struct PKT_C2C_PlayerSwitchWeapon_s : public DefaultPacketMixin<PKT_C2C_PlayerSwitchWeapon>
{
BYTE wid; // 255 - means empty hands
};
Add
struct PKT_C2C_PlayerCraftItem_s : public DefaultPacketMixin<PKT_C2C_PlayerCraftItem>
{
int slotid1;
int slotid2;
int slotid1q;
int slotid2q;
int slotid3;
int slotid4;
int slotid3q;
int slotid4q;
int itemid;
};
EDIT: How do i edit the the .obj files (example HUD_TPSGame.Obj)
Files needed. -
Link One - https://www.mediafire.com/?kkfujl0y1u037ki
Again, very basic tutorial.
Re: How to add crafting (Works for any source)
Appreciated, but this is some easy stuff, you can just look at Allright source and see how it works/copy it :)
Re: How to add crafting (Works for any source)
You just clean and build the whole solution...
Re: How to add crafting (Works for any source)
Nice, thanks for sharing. Now we'll be seeing nearly all servers with crafting :)
Re: How to add crafting (Works for any source)
Quote:
Originally Posted by
eXtremousZ
Nice, thanks for sharing. Now we'll be seeing nearly all servers with crafting :)
Just more something to do i suppose :)
Re: How to add crafting (Works for any source)
First thank you, I wonder if anyone knows how to deploy groups and the new frontend on DNC source
Re: How to add crafting (Works for any source)
No not all servers will have a working crafting system, extremousZ.
Re: How to add crafting (Works for any source)
"At 65 Likes ill show how to add Bandit AI"
If you really have it working fully then you should post it, idk why just bugs me when people say they got something when they don't.
Re: How to add crafting (Works for any source)
Quote:
Originally Posted by
Lost Echo
"At 65 Likes ill show how to add Bandit AI"
If you really have it working fully then you should post it, idk why just bugs me when people say they got something when they don't.
I do have it working, just haven't been ale to add yet.
HINT HINT
Use the code for zombies, but change the animations to Player Anims, (Only melee will work) But no item will show in hand.
Re: How to add crafting (Works for any source)
Re: How to add crafting (Works for any source)
Quote:
Originally Posted by
zwoorelook
i have this problem too! how to fix?
Re: How to add crafting (Works for any source)
Quote:
#include "r3dPCH.h"
#include "r3d.h"
#include "r3dDebug.h"
#include "HUDCraft.h"
#include "FrontendShared.h"
#include "../ObjectsCode/weapons/WeaponArmory.h"
#include "../ObjectsCode/ai/AI_Player.h"
#include "../multiplayer/MasterServerLogic.h"
#include "../multiplayer/ClientGameLogic.h"
look if you have all the include
Re: How to add crafting (Works for any source)
Quote:
Originally Posted by
ATIDOT3
look if you have all the include
http://kepfeltoltes.hu/view/140429/i...toltes.hu_.png
- - - Updated - - -
Quote:
Originally Posted by
ATIDOT3
look if you have all the include
i have all of these include files