Completely new to this, would like some assistance getting started

Various development-related discussions
Petnavi
Froob
Posts: 37
Joined: Sun Dec 04, 2022 10:30 pm
Has thanked: 4 times
Been thanked: 8 times

Re: Completely new to this, would like some assistance getting started

Post by Petnavi »

I think I explained myself incorrectly
You cannot have two branches checked out at once in git. That's not how git works. When you check out a branch in git, it changes your local files to match what is in that branch.
This was the relevation I was talking about
Changes to your master do not affect every single branch. Not automatically.

You do not have changes to your master until you've committed those changes.
I see. Also unfortunately I have the issue where I click on thanostool.jar and it pops up for a second but crashes. I can run it by doing the java -jar thanostool.jar only
Petnavi
Froob
Posts: 37
Joined: Sun Dec 04, 2022 10:30 pm
Has thanked: 4 times
Been thanked: 8 times

Re: Completely new to this, would like some assistance getting started

Post by Petnavi »

So I seem to have finally gotten Ceikry's approval on my MR for the Rockslugs and now I want to focus on the Butterfly net i.e. incorrect item reqs. As you can see

Image

This definitely shouldn't have a req of 21 herblore, just 15 hunter as per https://runescape.wiki/w/Butterfly_net?oldid=2079814. I go into Thanos and see this (guess I'll also fix the butterfly jar now that I see it also requires what I assume to be 21 herblore)

Image

Big problem. I know it requires 2 skills at 15 and 21 and knowing the bug I know the 21 correlates to herblore and 15 to hunter but without that knowledge how do I tell what those requirements are for? I assume deleting the numbers would mean just removing the req from the item, but how would you add a req and specify the skill? Like in the picture if I wanted to replace the 15 hunter and 21 herblore with 30 strength and 10 construction specifically in my SP server, how would I specify the skill I want attached to the number?
User avatar
Ceikry
Site Admin
Posts: 577
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 81 times
Been thanked: 93 times

Re: Completely new to this, would like some assistance getting started

Post by Ceikry »

You're reading it incorrectly. There is only one skill requirement defined in that picture. 21, for herblore.
They are defined as {skillID,level}

These are the skill IDs, which is an easy to find thing in the code:

Code: Select all

	public static final int ATTACK = 0, DEFENCE = 1, STRENGTH = 2, HITPOINTS = 3, RANGE = 4, PRAYER = 5, MAGIC = 6, COOKING = 7, WOODCUTTING = 8, FLETCHING = 9, FISHING = 10, FIREMAKING = 11, CRAFTING = 12, SMITHING = 13, MINING = 14, HERBLORE = 15, AGILITY = 16, THIEVING = 17, SLAYER = 18, FARMING = 19, RUNECRAFTING = 20, HUNTER = 21, CONSTRUCTION = 22, SUMMONING = 23;
If you want to define multiple requirements, you separate them with "-", eg:

Code: Select all

{0,10}-{1,20}
Would define something that requires 10 attack and 20 defence.

I have added a TODO to my list to make an easier to use requirements editor, but this should be enough info to get you along for now.
Nerds
Petnavi
Froob
Posts: 37
Joined: Sun Dec 04, 2022 10:30 pm
Has thanked: 4 times
Been thanked: 8 times

Re: Completely new to this, would like some assistance getting started

Post by Petnavi »

Okay so after a lot of tinkering I have no idea what's going on here. I made a MR to fix both the butterfly net and butterfly jar at https://gitlab.com/2009scape/2009scape/ ... quests/991.

I updated my fork and made sure my branch was clean of any changes and reset my fork so make sure it's 1:1 to I think it's called upstream? the 2009 repos. The problem is I literally only made 2 changes which was just swapping 2 numbers around in Thanos. I check my changes and it's +93 insertions -94 deletions. Anyone have any idea what's going on here? Even if it's not my fault (probably is) can someone explain why it's showing this when it should just be 2 edits?
User avatar
Ceikry
Site Admin
Posts: 577
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 81 times
Been thanked: 93 times

Re: Completely new to this, would like some assistance getting started

Post by Ceikry »

It's not your fault, no. Thanos abides by a specific sort order for the fields when it writes out the json. Someone probably made a manual/scripted (non-thanos) change at some point, and then you just happen to be the most recent person to re-save it with Thanos, so it re-enforced its sorting. If you actually look at the changes, which you can do by clicking the "changes" tab in gitlab, you can see it just changed the order the fields are in within the json.
Nerds
User avatar
Ceikry
Site Admin
Posts: 577
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 81 times
Been thanked: 93 times

Re: Completely new to this, would like some assistance getting started

Post by Ceikry »

On closer look, I can show you exactly what happened:

Image

At some point, someone's manual edit (non-thanos) involved them putting a duplicate requirements field for this item. When you re-saved through thanos, it saw this duplicate and cleared it out, which probably triggered the re-sort.
Nerds
Petnavi
Froob
Posts: 37
Joined: Sun Dec 04, 2022 10:30 pm
Has thanked: 4 times
Been thanked: 8 times

Re: Completely new to this, would like some assistance getting started

Post by Petnavi »

So, I got one more question. I want to fix https://gitlab.com/2009scape/2009scape/-/issues/885 that has this issue
Image
The issue is where do I get this weight from or better yet, what determines the weight of a drop?
User avatar
Ceikry
Site Admin
Posts: 577
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 81 times
Been thanked: 93 times

Re: Completely new to this, would like some assistance getting started

Post by Ceikry »

The weight is effectively the drop rate.
You determine it, based on what it should be. There's no special magic number shenanigans going on here. Weighted tables are pretty simple. The drop rate of a given item is its weight divided by the combined weight of every item in the table, including its own.

Let's say for example you had the below table:
Item | Weight |
============================
Abyssal whip | 13 |
Rune Dagger | 12 |
Nothing | 3 |
----------------------------------------

The total weight is (13 + 12 + 3) = 28
The drop rate of an abyssal whip is 13/28
The drop rate of a rune dagger is 12/28
The drop rate of Nothing is 3/28
Nerds
User avatar
Ceikry
Site Admin
Posts: 577
Joined: Wed Aug 10, 2022 11:48 pm
Location: Draynor Village
Has thanked: 81 times
Been thanked: 93 times

Re: Completely new to this, would like some assistance getting started

Post by Ceikry »

If it helps to think about it a different way, the total weight of a table is the number of "slots" it has. An individual item's weight, therefor, is the number of slots that item is in.
Nerds
Petnavi
Froob
Posts: 37
Joined: Sun Dec 04, 2022 10:30 pm
Has thanked: 4 times
Been thanked: 8 times

Re: Completely new to this, would like some assistance getting started

Post by Petnavi »

Something isn't clicking with me.
The drop rate of a given item is its weight divided by the combined weight of every item in the table
So for Hill Giants it has 49 drops on its main drop table and lets assume its drop rate is .60% or 1/166. Would I then have to add every single weight in this column together? Then find the number to get x / totalweight = .60 ? Does the total weight include the weight of the item in question? so would it be x / (totalweight + x) = .60 ?
Post Reply