|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Join Date: Jan 2009
Posts: 392
|
This guide is going to be split up into two parts. The first part will show you how to obtain a copy of Smogon University's scripts locally so you can edit them, and the second part will be an introduction on how to script in PO. This thread will be only the former.
How to Set Up The Scripting Environment Our scripts are hosted on Sarenji's GitHub account under the repository name "poserver". Before you can pull the scripts onto your machine, you have to sign up for a GitHub account here. Once you've done that, you have to download, install, and configure Git. GitHub has a guide to do this on Windows here. If you're using Mac OS X, you will want to read this guide. If you are using a Linux distro, you should be able to know how to do this! But if you don't, I guess GitHub can help you out. Once you have configured Git, we can begin pulling in the latest scripts onto our machine! To do this, we are going to be doing a process called "forking", which simply means you're going to be contributing to someone's code; your version will be referred to as a fork of the original version. To begin, log in to your GitHub account, go to our repository here, and click the "Fork" button in the top right corner of the project page. Now that GitHub knows you are forking this project, you have to clone it onto your machine. Run the following code in Git Bash (make sure to replace username with your personal username): Code:
git clone git@github.com:username/poserver.git Code:
cd poserver git remote add upstream git://github.com/sarenji/poserver.git git fetch upstream When you've made changes to the scripts, go into Git GUI once you've modified the original scripts.js file. The program will automatically see that changes have been made from the original you obtained and will display the changes. If these changes look correct, you have to stage your changes by clicking the "Stage Changed" button. Once you've done that, you're ready to commit your changes: enter a commit message in the text area and click "Commit". Finally, you are going to push these changes so they appear on your repository: Code:
git push origin master Please note that the set of scripts on your machine will not be automatically synchronized with the official ones, you have to do this manually: Code:
git fetch upstream git merge upstream/master |
|
|
![]() |
| Thread Tools | |
|
|