[Tutorials] Github and Working with U&A


Recommended Posts

These are tutorials on using Github and on adding new things to the mod for those collaborating on it.

MAC

You'll need this:

https://mac.github.com/

WINDOWS

You'll need this:

https://windows.github.com/

 

LINUX

$ sudo apt-get install git 

Now, go to https://github.com/debugman18/UpAndAway and you should see a Clone To Desktop button near the bottom right of the page. Click it.

Select the folder UpAndAway in your mods folder of Don't Starve. If it doesn't exist, create it.

You'll want to pull the repo now. A 'pull' means that you are downloading the most current version of the repo to your computer. So long as you haven't modified the same files those in a recent commit, you can pull even while working on your own changes. A 'commit' is an update to the repo, adding, removing, or changing files.

At the top right, you should see a 'Sync' button. This will pull the most recent changes. This will also be used to 'push' changes. Pushing means to upload your commit to the repo (as I said, a commit is an update to the files).

Now, make whatever changes you're making.

Now when you go to the repo in your Github application (in case you haven't noticed the connection, repo is short for repository) you'll see an 'Uncommited Changes' box, with an area to type in a summary of the changes you've made.

For example, let's say you added a new creature, called the "Test Monster". You could type in something like "Added a Test Monster" into the summary box.

Once you're happy with the shown changes, hit the 'Commit' button. This will save your changes to your local version of the repo. To upload your changes so that everyone else can see them, hit the 'Sync' button again. This will push your commit to the online repo, and everybody else can now see the changes you made.

ADDING THINGS TO THE MOD

 

Up and Away's code is quite a bit different from the average mod, since it uses the Wicker framework.

 

ADDING A PREFAB

 

To add a prefab, you must place it in the /code/prefabs/ folder of UpAndAway. At the top of the prefab file, you'll want to add:

BindGlobal()

At the bottom of the prefab file, you'll want to create the prefab with something like this for a single addition:

return Prefab ("common/inventory/cloud_fruit", fn, assets, prefabs)

Or something like this for multiple additions in one file:

return {    Prefab ("common/inventory/crystal_wall", fn, assets, prefabs),    Prefab ("common/inventoryitem/crystal_wall_item", itemfn, assets, prefabs),}

Now, you'll need to tell the mod to load it. In the root mod directory, you'll find a file named 'prefabfiles.lua'. In this file is a list of prefabs. Here, you only need to add the name of the prefab file you added. For example, if you added a file called 'crystal_wall' which contained the table as seen above, you would add:

"crystal_wall",

Always make sure there is a comma at the end.

 

ADDING A MINIMAP ICON

 

After creating the appropriate prefab, you'll want to add a minimap icon to the assets list and the main file.

 

In the mod directory, there is a file called 'assets.lua'. If you open it up, you'll find a table called 'ImageAssets'. To add your minimap icon, add its file name to the list, like this:

"crystal_wall",

Make sure there's always a comma at the end, just like with adding a prefab.

 

Now, you'll also need to tell the mod itself to load that minimap icon. In the /code/ directory of the mod, you'll find a file named 'main.lua'. You'll want to add something like this to it, preferably with the other minimap atlas declarations:

AddMinimapAtlas("images/crystal_wall.xml")

There's no comma at the end this time.

 

 

ADDING AN INVENTORY ICON

 

After creating the appropriate prefab, you'll want to add an inventory icon to the assets list.

 

In the mod directory, there is a file called 'assets.lua'. If you open it up, you'll find a table called 'InventoryImageAssets'. To add your inventory icon, add its file name to the list, like this:

"crystal_wall",

Just like before, you'll want to make sure there's a comma.

 

Dingo annihilated...

Edited by debugman18
  • Like 1
Link to comment
Share on other sites

@debugman18

You might want to add a Linux section, even if it's just gonna say "You'll need git.". We don't want any potential Linux contributor to feel left out :razz:.

And as a side note, yes, "You'll need git.". Punctuation inside quotes is a part of the quote, punctuation outside of it is part of the surrounding sentence. I don't care if the Chigago Manual of Style says otherwise. :razz:

Edited by simplex
Link to comment
Share on other sites

@debugman18 - When I click "Clone to Desktop" it only asks which application I want to use to open it, so I choose Github,

 

EDIT: Found the sync button but not how to set it to specific folder

 

You should be able to just move the folder into your mods/ folder. Git will probably complain; just point it to where you moved it when it asks where the files are.

Edited by debugman18
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share