Jump to content

[TUTORIAL] How to apply a DIFF file to the bot


Recommended Posts

Hi, the following is a guide on how to apply a DIFF file provided by a feature author to an official bot.  Please be aware, I am only going to go through the steps needed to apply the DIFF file, I will not be covering steps to undertake if the DIFF fails to merge due to conflicts. 

 

Usually DIFF files supplied by authors should be created from a clean official bot, this means you should be able to merge it into an offical bot without problems, however keep in mind, if you are trying to add a feature to someone's compilation MOD, or you are adding multiple DIFF files, these files may have incompatabilities and may not merge.  To fix these issues properly requires changing code, to resolve the issue, and is beyond the scope of this tutorial.

 

So let us begin, firstly for this you will need a Git Client, the client used in this tutorial is SourceTree, just google it and you will find a download.  Also before I start, many thanks to @amintalkin who captured the screenshots for the process so I didn't need to.

 

NOTE:  This process only modifies source code, if you wish to run an EXE file of the modded bot you will need to recompile it.  That is not covered by this tutorial!

 

Step 1: Load SourceTree.

Step 2: Click the "Clone/New" toolbar button as shown in the following screen shot.

h0bgZuT.png

Step 3: Click the rightmost tab of the new window that opened which should by "Create New Repository".

dhmQHhe.png

Step 4: Click the "..." button beside "Destination Path" which will open an explorer dialog box as shown, and navigate to the folder containing your offical bot you wish to apply the DIFF to, and click "Select Folder".

kKaLpIU.png

Step 5: Now click the "Create" button, as shown below.

dxr01FJ.png

Step 6: Tick the checkbox above the unstaged files to stage them now.

Lxwtdhk.png

Step 7: Click the "Commit" button on the toolbar.

Step 8: Give it a descriptive name, for example: Offiial Bot 5.3.1, then click the commit button at the bottom right of the window.

jaWbL8r.png

Step 9: Click the "Actions" menu.

Step 10: Select "Apply Patch" menu item, as per the screen shot below.

63dCK4W.png

Step 11: Click the "..." beside the filename box to open an explorer window. Then navigate to the folder containing the DIFF file and select it, and then click "Open".

HMXCDdx.png

mWUaQ9G.png

Step 12: Click the "Apply Patch" button as shown in the screen shot.

hdLp2L9.png

Step 13: Again tick the checkbox above the unstaged files to stage the changes.

SplOD7Z.png

Step 14: Click the "Commit" toolbar button.

Step 15: Give it a descriptive name again, preferably related to what the patch is for and then click the "Commit" button at the bottom right of the window.

XR88OBB.png

The following steps are completely optional, at this point your folder now contains a modded bot, however the following steps take you through creating a backup zip file of the modded bot.

Step 16: Click "Branches" as shown in the screen shot, don't mind the typing mistake. ;)

sw3qGVz.png

Step 17: Right click your last commit, which should have a descriptive name for the DIFF you just applied, and click "Archive" from the context menu.

tSAf1RB.png

Step 18: You now have a zip file containing the modded bot.

BTxy51U.png

 

REMEMBER THE EXE FILE IS NOT MODIFIED BY THIS PROCESS, RUNNING THE EXE FILE WITHOUT RECOMPILING THE BOT WILL JUST GIVE YOU AN UNMODDED BOT!!!

Now presuming you had no merge errors, which I am not covering in this tutorial, you are all done and now have modified source code for the bot.

Edited by LunaEclipse
  • Upvote 9
Link to post
Share on other sites

@LunaEclipse thanks for tutorial but i have error 

I have error while comitting
 

git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F C:\Users\blero\AppData\Local\Temp\evx40tch.uvz

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <[email protected](none)>) not allowed


Completed with errors, see above.

Link to post
Share on other sites
9 minutes ago, blero said:

@LunaEclipse thanks for tutorial but i have error 

I have error while comitting
 

git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F C:\Users\blero\AppData\Local\Temp\evx40tch.uvz

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <[email protected](none)>) not allowed


Completed with errors, see above.

 

That looks like you have not registered SourceTree, its free, just click register and create your account.

Link to post
Share on other sites
31 minutes ago, blero said:

No i have account , i think it worked i have smartzap tab in bot :) also i have au3.rej file ?

Thanks :thumbsup:

Untitled.jpg

 

If you have a .rej file, that means some changes didn't merge, the SmartZap diff is created from a clean install and should merge into a clean 5.3.1 without errors, if you got errors, were you trying to merge into a bot with mods already installed.  If so, you need to look at the contents of the .rej file, and try to incorporate them into your bot, however this is a more advanced task and not one I plan on producing a tutorial for.

 

However with the code missing that is in au3.rej file, SmartZap may not be functioning 100% correctly, without me knowing what code has not been merged.

Edited by LunaEclipse
  • Upvote 1
Link to post
Share on other sites
On ‎02‎/‎04‎/‎2016 at 5:18 PM, ChacalGyn said:

Hi Friends !

 

From who use "git bash" just type:

 

git apply anyfile.diff

 

Regards :)

I'm not a programmer and I would like to know  which way is easiest.

 About "git bash" the procedure is like this one of tutorial or is it enough  to:  git apply anyfile.diff?

Thanks.

Regards

Link to post
Share on other sites
5 horas atrás, AnDrOmEdA disse:

I'm not a programmer and I would like to know  which way is easiest.

 About "git bash" the procedure is like this one of tutorial or is it enough  to:  git apply anyfile.diff?

Thanks.

Regards

 

Hi Friend !


The best tool is that one you know how to use
For beginners I recommend Visual Tools: like Source Tree


Regards

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...