[Tutorial] How to add custom rocks to your 2004scape server (225 based)

Adding new rock

Working directories: Content/scripts, Content/pack

Scripts hold a lot of logic on how different parts of game interact.
You can find levelup, skills, quests and much more logic here.
A lot of interaction changes take place here.

Pack mostly holds a list of items like obj (rs items), models, idk (character properties).
If you are adding new things, you also need to add them here.

PART 1: Making the rocks

Go to Content/scripts and locate skill_mining.
In the folder, open configs folder.
Open rocks.loc, locate [ironrock1] and copy it.
Paste it to the end of the file.
Do the same with [macro_ironrock1]
Let’s change the name between [ ], recol1d and param=macro_gas

Example:

[sapphire_rock]
name=Rocks
desc=A rocky outcrop.
model=plainrock1
op1=Mine
op2=Prospect
op3=hidden
mapscene=12
blockrange=no
recol1s=6342
recol1d=137
category=mining_rock_fast
param=next_loc_stage_mining,plainrock1
param=macro_gas,macro_sapphire_rock

[macro_sapphire_rock]
name=Rocks
desc=A rocky outcrop.
model=macro_plainrock1
op1=Mine
op2=Prospect
op3=hidden
mapscene=12
anim=gas
hasalpha=yes
blockrange=no
recol1s=6342
recol1d=137
recol2s=28538
recol2d=21070
category=mining_rock_macro_gas

What did you do?
You made a new loc (interactable ground object), that uses a model of plainrock, but recolors it blue.
Macro is mining specific event when rock starts to gas and explodes on mining.
Name between [ ] is what the loc is now called.

PS! Don’t forget to save the file!

PART 2: Adding loot table to rock

In the same configs folder, open mine.dbrow.
Copy iron_rock_table and paste it to the end.
Let’s again change the name between [ ], data-s
data=rock MUST match, what we added in the last step!

Example:

[sapphire_rock_table]
table=mining_table
data=rock,sapphire_rock
data=rock,macro_sapphire_rock
data=ore_name,sapphire
data=rock_output,uncut_sapphire
data=rock_level,15
data=rock_exp,350
data=rock_successchance,96,350
data=rock_respawnrate,20

What did you do?
You added data to our new rock.
It now knows what to output, what level of mining it requires, exp given etc.
Now it gives uncut sapphire every time, it is mined.
The name between [ ] is what the mining table is now called.
Save file!

PART 3: Adding new rock and table to loading (pack)

Go to content/pack and find dbrow.pack.
This is a file, that loads in the table.
In the file, scroll to the bottom and add a new row.
Add new highest id and follow structure.
In my example, it is:
1051=sapphire_rock_table
Save!

In the same folder, find loc.pack.
Do the same thing, but now with rock names.
In my example:

3388=sapphire_rock
3389=macro_sapphire_rock

Save.

Build your project and start it.
The rock is in the game now.
On the dev server, try ::~loc sapphire_rock
New rock should be under you.
This is a temporary loc, which disappears after mining it.

Now you can add custom rocks and have some knowledge, of how things work.
Other gathering skills work similarly, just a tad bit different.
Good luck with developing and happy scaping!

4 Likes

Nice tutorial.
I have to type more to post this.

Love to see these kinds of tutorials, I had half of one written but gave up lol. It’s super helpful for people getting into scripting!

Nit: Title the thread “tutorial” or something so people know to click on it when they’re learning. I thought you were asking a question based on the title

Good note, changed the title to include [Tutorial] and revision it is based on

1 Like