SRL Archive - OSR Intermediate Scripting Tutorials

How to make and use Custom SPS Maps from the Minimap


J J

2012-04-29 15:11:09

I will make on custom SPS map for someone! I will make a video of the progress to make it more clear. PM me or post here and I will work on the video & the map as soon as possible. I might not be able to make all maps though, as my only p2p account is a summoning tank - which is limited to certain areas.

Hey,

Welcome to my guide about making custom sps maps by using the mini map. I decided to make this guide after getting a couple questions from people how they can make customs sps maps for area’s that aren’t on the world map. If your desired area is located on the world map, I would like to refer you to this guide: http://villavu.com/forum/showthread.php?t=75181
That is a guide about making custom SPS maps by using the world map. Before continuing reading I suggest you to read this guide again to fresh your memory up, if necessary: http://villavu.com/forum/showthread.php?t=71461
On to my guide.
At first you should make sure that your desired map is indeed not on the world map. If you have checked this, walk to the middle of your desired location. Be sure to walk there by using the SMART client, as the colors could possibly be different on other clients. Be sure to use the right graphic settings aswell (everything on the lowest). Once you are there, press on the ‘N’ on your RuneScape screen to set the angle to the north. After you’ve done that, press print screen on your keyboard. Open up PhotoShop and make a file with the following settings:
(Make sure the width and height represent the values for your computer. For the most people this will be 1920x1080. PhotoShop automatically defines them if you have taken a print screen)
Press ctrl+v on your keyboard to paste the screenshot of your screen. Right now you should have one layer with a screenshot of your whole screen.
Back to RuneScape, you should now move along your area to be sure to get pictures of the whole area. In my case, one screenshots covers the whole area. HOWEVER, you should get multiple pictures so you can edit out unwanted details such as yellow dots from NPC’s, symbols, and the white dot of your own player. Move around the area and press print screen again. Paste this into PhotoShop again. Repeat this process of moving around, pressing print screen and pasting it into PhotoShop until you have atleast five layers (more might be needed, depending on the size of the area).
This is how my PhotoShop looks right now:
I have six layers because I had to edit out the name of my RuneScape character. There are five layers of different minimap positions. Right now you should take a look at your screenshots by clicking on the eyes next to your layers. If you click on the eye you will hide the layer and you can see the different layers. Try to look if you could merge them and edit out ALL of the unwanted details, that I mentioned before. In my case, I can’t edit the Transportation symbol out, so I have to log out. Logging out will slightly change the positions of the symbols. I have to repeat this process until I can make sure that I can edit it out with the right colors. Some times the symbols aren’t changing positions by only logging out. If that happens to you, you should hop worlds. If the symbol still isn’t changing, you can edit it out by using your own imagination.
After getting five more screenshots of different symbol and NPC positions, this is my result
Now it’s time for the harder part. You should cut out the minimap only. Because the minimap is on the same location at all times, this won’t be too hard by using the following technique:
Select the Elleptical Marquee Tool:
Zoom in to your mini map on the top layer. Place your mouse around the green dot. It should be located to the east of the ‘N’ symbol:
Once your mouse is there, hold shift and move your mouse to the bottom right of the mini map.
Your screen should look like this
Right click in the selected area and click on select inverse.
Once you have done that, press delete. Click on a different layer now and press delete again. Repeat this for all the layers. This will cut out everything except the minimap. Once you have done that, your screen should look like this
You can now start with the blending. Move all the layers off each other like this:
Disable all the layers except two, by pressing on the eye symbol again. You should have two visible layers now. Move the top layer of those two above the other one. Example:
The problem with my pictures is that the area suddenly turns black. So I will edit the black part out by using the Magic Wand tool (Short cut W). After cutting the black part out:
Now I will do the exact same thing as two pictures above.
As you can see, the pictures are overlapping now. For me it was relatively easy because of the white outlines. For most of the maps it will be harder though. Put the top layer opacity on 30%. Move it around until you see that two parts of the different layers blend.
Now you should continue with all the other layers, and keep moving them around and keep editing the opacity to overlap each minimap with eachother. After overlapping them as good as possible
Now you should disable the visibility of all layers, except two again. You can now start with editing out NPC’s and symbols by using the colors of the other maps.
Editing out some of the NPC’s on one of the pictures.
After editing the NPC’s out on two of the pictures.
After editing the NPC’s out on five of the pictures.
After editing the NPC’s out on ten pictures
As you can see it doesn’t look great yet. You should now zoom in at max and get the right colors, and edit them in on one of the pictures yourself.
I picked the color on another picture, and it’s the same as the surrounding colors
Now I can edit those in at the original picture.
Most of the times you can also guess the color, as seen in this picture. The black gap can be filled with the darker blue color. As you can see it’s some sort of box, so you can easily edit it. If you aren’t sure you can check one of your other 10 pictures if that area has no NPC’s on them.
After filling the black parts in by using my imagination and using the other pictures, this is my result after a couple minutes.
As you can see there are still some black parts, that I can’t directly fill up. You have to look at the other map now. As you can see a white border is missing aswell, so I have to add one myself.
I grabbed the map part from four other maps to get an accurate result. Here are my pictures
Pasting them in my file
Cutting the pieces out and adding them to my map on the right spot. As you can see in the bottom right I have got 3 wall parts.
Pasting the parts of the wall together to make a straight line:
My result now:
As you can see I have some extra blue parts now aswell. Time to edit out the last two black gaps.
Ater editing them out..
Still have to edit out the symbol. To start off I’ll add another white line to the south spot. Copied from another layer, ofcourse. The extra wall part
After adding the part
Pasting in another image as a reference.
Using my imagination to finish it off.
There we go, it’s done! Make a new layer and go to Image -> Apply Image -> OK. Then press Ctrl+A on your keyboard, grab the move tool and move the map around. Then press Ctrl+C and go to File -> New. The dimensions must be 500x500 px. Press Ctrl+V and there you go, your own custom map! Make the background black, and save it as 0_5 and file type .png (0_5.png)
My result: USING YOUR OWN MAP
Now you want to use it.. Go to the place where you saved the file and copy it, and go to
C:\Simba\Includes\SPS\img\runescape_surface
Be sure to have SPS 2.
Then just copy it in there.

Open up Simba and use this script to check if it’s working.
 program TestSPS;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
end;
end;

procedure SetupLogin;
begin
//ClearDebug;
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Wait(1000 + Random(3000));
ClickNorth(0);
end;

procedure SPSCheck;
var
MyPos:TPoint;

begin
SPS_Setup(RUNESCAPE_SURFACE, ['0_5']);
MyPos:=SPS_GetMyPos;
Writeln('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
end;

begin
SetUpLogin;
SPSCheck;
end.

Hit run and let RuneScape load, log in and be sure to be at your correct position. Once you are logged in click on run again. This are some of my results
 Current player: 
My position is x: 219 y: 2247
Successfully executed.
 Current player: 
My position is x: 263 y: 2251
Successfully executed.
If it’s working correctly it should return similar results. The results should be positive.
You can use these positions to determine the route you want to be walking. Let’s say I want to walk to a spot within the red box.
At first I will walk to the top left corner and run the script a few times to get a few results. You should also log out and back in two times to get a more accurate result. This is my result, after trying three different worlds for two times each. I recommend to test it more times for a more accurate result
 My position is  x: 227 y: 2223
My position is x: 227 y: 2223
My position is x: 227 y: 2223
My position is x: 227 y: 2223
My position is x: 227 y: 2223
My position is x: 227 y: 2223
As you can see my position is exactly the same, so I will be using (227, 2223) as my top left co-ordinate. Now for the right bottom co-ord. Repeat the same process. I got a bit lazy and just used four results.
 My position is  x: 243 y: 2235
My position is x: 243 y: 2235
My position is x: 243 y: 2235
My position is x: 243 y: 2235
I got the same result four times so I will be using that. (243, 2235).
Now I will be adding this to the SPS_Blindwalk function.
This is the edited part.
 procedure SPSCheck;
var
MyPos:TPoint;

begin
SPS_Setup(RUNESCAPE_SURFACE, ['0_5']);
MyPos:=SPS_GetMyPos;
Writeln('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
SPS_BlindWalk(Point(RandomRange(227, 243), RandomRange(2223, 2235)));
end;
Walk to a random position in your area that is mapped. And hit run, and see if your script brings you to the right spot!
Some of my own results

As you can see from the pictures, it does indeed work. I ran it from three different positions, left, down and right on the minimap. And it still got to the right position. At first I was planning to use a different function, but this one is more accurate.
At first I was going to use the transport symbol as a reference. I created this, but as the symbol changes it is less accurate.
 procedure Test;
var
X, Y, TransportSymbol: Integer;
InputAcc, OutputAcc: Extended;

begin
TransportSymbol := BitmapFromString(13, 11, 'meJxraRRlZGA4gAoksl5CEJANlG' +
'3BpgaizCfIFVklHmVwlUA1cPPREEQZXCWyCC5EkjIVXS1MBFcDZON' +
'yGNwKuBqITxegArgVcDW4AgSuBqgLqKayVBhTMdxquBoAMOy2Tw==');
InputAcc := 0.2;
ClickNorth(0);
FindDeformedBitmapToleranceIn(SymbolBitmap, X, Y, MMX1 + 30, MMY1 + 30, MMX2 - 30, MMY2 - 30, 75, 0, True, OutputAcc)
FreeBitmap(TransportSymbol);
if (OutputAcc > InputAcc) then
begin
WriteLn('Test succesful');
MMouse(X - 20, Y - 40, 5, 5); // = Acantha
//MMouse(X + 25, Y - 25, 5, 5); // = Wizard
//MMouse(X + 20, Y - 40, 5, 5); // = Vief
end;
end;

I hope you enjoyed this tutorial and learned something from it. I hope to see more usage of Custom SPS Maps in the future, as it’s a relatively easy and accurate way of walking!

Here is a video that I made, where you can see Custom SPS Maps being used to walk to the earth altar: http://www.youtube.com/watch?v=GCuzk_2vQ6I
At 26:10 - 28:40

Greetz,

JJ.

Striken

2012-04-29 20:30:18

Very detailed tutorial. I take it this is RuneSpan?

J J

2012-04-30 16:53:32

From: Phyaskou
Very detailed tutorial. I take it this is RuneSpan?

No, it's actualy the Great Orb Project :P RuneSpan is released now, though.

honeyhoney

2012-04-30 17:57:25

I noticed you placed the image in the middle of the 500x500 black background… does it have to be in the middle?

Would it hurt to have it on the top left so we're dealing with smaller coordinates? :p


E: Oh, and great tutorial! :)

Abu

2012-04-30 18:07:05

Very nice and detailed tutorial!

Will rep later, I've reached my limit for today :p

Arepirpi

2012-05-03 11:22:24

Thank you for this great tutorial :)
Can I do this with paint?

Brandon

2012-05-03 11:39:35

I use this.. Just login, press play, it grabs and saves the minimap for you. All that's left is to paste it on a black canvas.


program SPS_MapMaker;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}

Procedure GetMinimap(Name: String);
var
TPA, Draw: TPointArray;
TIA: TIntegerArray;
I, BMP: Integer;
begin
BMP:= CreateBitmap(MMX2 - MMX1 + 1, MMY2 - MMY1 + 1);
TPA:= TPAFromBox(MMBox);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, MMCX, MMCY);
TIA:= GetColors(TPA);

TPA:= TPAFromBox(IntToBox(0, 0, MMX2 - MMX1, MMY2 - MMY1));
DrawTPABitmap(BMP, TPA, 16777215);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, (MMX2 - MMX1)/2, (MMY2 - MMY1)/2);

For I:= 0 To High(TPA) do
begin
SetLength(DRAW, 1);
Draw[0]:= TPA[I];
DrawTPABitmap(BMP, Draw, TIA[I]);
end;

DebugBitmap(BMP);
SaveBitmap(BMP, 'C:/Users/Desktop/Brandon/' + Name + '.bmp');
FreeBitmap(BMP);
end;

var
I: Integer;

begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetupSRL;
while true do
begin
wait(1000);
while (Not SMARTENABLED) do
wait(1);
GetMinimap('MM' + ToStr(I));
Inc(I);
end;
end.

litoris

2012-05-03 13:12:34

Great guide, +repped.
From: ggzz
I use this.. Just login, press play, it grabs and saves the minimap for you. All that's left is to paste it on a black canvas.


program SPS_MapMaker;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}

Procedure GetMinimap(Name: String);
var
TPA, Draw: TPointArray;
TIA: TIntegerArray;
I, BMP: Integer;
begin
BMP:= CreateBitmap(MMX2 - MMX1 + 1, MMY2 - MMY1 + 1);
TPA:= TPAFromBox(MMBox);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, MMCX, MMCY);
TIA:= GetColors(TPA);

TPA:= TPAFromBox(IntToBox(0, 0, MMX2 - MMX1, MMY2 - MMY1));
DrawTPABitmap(BMP, TPA, 16777215);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, (MMX2 - MMX1)/2, (MMY2 - MMY1)/2);

For I:= 0 To High(TPA) do
begin
SetLength(DRAW, 1);
Draw[0]:= TPA[I];
DrawTPABitmap(BMP, Draw, TIA[I]);
end;

DebugBitmap(BMP);
SaveBitmap(BMP, 'C:/Users/Desktop/Brandon/' + Name + '.bmp');
FreeBitmap(BMP);
end;

var
I: Integer;

begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetupSRL;
while true do
begin
wait(1000);
while (Not SMARTENABLED) do
wait(1);
GetMinimap('MM' + ToStr(I));
Inc(I);
end;
end.


Except for the fact that this one only works in areas with no NPCs or symbols. The method J J explained makes it possible to get a custom map for everywhere.

J J

2012-05-04 07:55:40

From: honeyhoney
I noticed you placed the image in the middle of the 500x500 black background… does it have to be in the middle?

Would it hurt to have it on the top left so we're dealing with smaller coordinates? :p


E: Oh, and great tutorial! :)

Nope, it doesn't matter ;) And thanks.

From: abu_jwka
Very nice and detailed tutorial!

Will rep later, I've reached my limit for today :p

Thanks :P

From: Arepirpi
Thank you for this great tutorial :)
Can I do this with paint?

Yeah you could do this in paint, but the zooming in at PhotoShop is much more detailed. And you can simply move the layers etc. over eachother.

From: ggzz
I use this.. Just login, press play, it grabs and saves the minimap for you. All that's left is to paste it on a black canvas.


program SPS_MapMaker;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}

Procedure GetMinimap(Name: String);
var
TPA, Draw: TPointArray;
TIA: TIntegerArray;
I, BMP: Integer;
begin
BMP:= CreateBitmap(MMX2 - MMX1 + 1, MMY2 - MMY1 + 1);
TPA:= TPAFromBox(MMBox);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, MMCX, MMCY);
TIA:= GetColors(TPA);

TPA:= TPAFromBox(IntToBox(0, 0, MMX2 - MMX1, MMY2 - MMY1));
DrawTPABitmap(BMP, TPA, 16777215);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, (MMX2 - MMX1)/2, (MMY2 - MMY1)/2);

For I:= 0 To High(TPA) do
begin
SetLength(DRAW, 1);
Draw[0]:= TPA[I];
DrawTPABitmap(BMP, Draw, TIA[I]);
end;

DebugBitmap(BMP);
SaveBitmap(BMP, 'C:/Users/Desktop/Brandon/' + Name + '.bmp');
FreeBitmap(BMP);
end;

var
I: Integer;

begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetupSRL;
while true do
begin
wait(1000);
while (Not SMARTENABLED) do
wait(1);
GetMinimap('MM' + ToStr(I));
Inc(I);
end;
end.

You would still have the problem of removing the yellow and white dots. And the possible symbols. But thanks, might look into this as it would get more accurate cut outs of the minimap.

From: litoris
Great guide, +repped.

Except for the fact that this one only works in areas with no NPCs or symbols. The method J J explained makes it possible to get a custom map for everywhere.

Indeed, this ^ :P This also wouldn't work when the area doesn't fit on one minimap. I'm about to edit the main page. I will make one custom SPS map that someone requested and I will make a video of the whole process. To make everything more clear and how to merge multiple screenshots. This is a decent example, but it doesn't show how to merge multiple images like this:

xtrapsp

2012-05-06 07:35:52

Hey J J

So I'm working on a custom map but it's a bit difficult…

So heres the path on the worldmap :P I painted on it:


How would i do this with the minimap? I mean it's a HUGE path haha

Would it be lots of minimaps like '20_1','20_2',20_3'?

litoris

2012-05-06 09:40:01

From: xtrapsp
Hey J J

So I'm working on a custom map but it's a bit difficult…

So heres the path on the worldmap :P I painted on it:


How would i do this with the minimap? I mean it's a HUGE path haha

Would it be lots of minimaps like '20_1','20_2',20_3'?


You'd have lots of maps. I think Karamja might be already on SPS though.

xtrapsp

2012-05-06 09:46:31

From: litoris
You'd have lots of maps. I think Karamja might be already on SPS though.


yea but it's not been updated :(

J J

2012-05-07 05:23:12

From: xtrapsp
Hey J J

So I'm working on a custom map but it's a bit difficult…

So heres the path on the worldmap :P I painted on it:

*pic*

How would i do this with the minimap? I mean it's a HUGE path haha

Would it be lots of minimaps like '20_1','20_2',20_3'?

Well it's not really a minimap SPS :P You can get that map by just opening the world map at 100%. It is already mapped out by Jagex so you won't need to merge mini maps together ;)

You can just make a screenshot of the world map at 100%, possibly edit some symbols out and then it will work. I'm not sure if that is more than 500x500 px, I think it will just fit on one custom SPS map.

I'll make it later today :P

From: litoris
You'd have lots of maps. I think Karamja might be already on SPS though.

I think it will be like 1-3 maps max :P And Yeah as said under me.. that one is apparantly not updated.

From: xtrapsp
yea but it's not been updated :(

Well I'll look into it now actually, got some time.

EDIT: I've made the whole procedure for you actually. SPS_Blindwalk works very well with custom maps. This got me flawless from "Stiles" to the lobster fish spot. And from the lobster fish spot to 'Stiles'.

Place this in the RUNESCAPE_SURFACE folder, name it 0_7

Script
program Test;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Active := True;
end;
end;

procedure SetupLogin;
begin
ClearDebug;
Smart_Server := 10;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
LoginPlayer;
Wait(1000 + Random(3000));
ClickNorth(0);
end;

procedure Test;
var
MyPos: TPoint;

begin
SPS_Setup(RUNESCAPE_SURFACE, ['0_7']);
MyPos:=SPS_GetMyPos;
Writeln('My position is x: '+inttostr(MyPos.x)+' y: '+inttostr(MyPos.y));
//SPS_BlindWalk(Point(RandomRange(99, 115), 3143)); // STILES
SPS_BlindWalk(Point(RandomRange(399, 403), RandomRange(2987, 3007))); // FISH SPOT

end;

begin
SetUpLogin;
Test;
end.

It will walk to a random spot on the lobster fishing platform thingy..
And max 2 squares away from stiles.

Enjoy :)

NKN

2012-05-12 16:12:51

Thanks.

I had no idea how to make custom maps. Now I got something to do with Photoshop. :D

Brandon

2012-05-12 16:21:17

From: J J
Indeed, this ^ :P This also wouldn't work when the area doesn't fit on one minimap.


Iunno what you mean by that but it works for every area. Of course your going to have to assemble the minimap shots it takes just like in your guide. The advantage is that you don't have to cut out anything except the NPC's and Symbols. It works everywhere.

J J

2012-05-12 18:00:42

From: NKN
Thanks.

I had no idea how to make custom maps. Now I got something to do with Photoshop. :D

No problem & good luck :)

From: Brandon
Iunno what you mean by that but it works for every area. Of course your going to have to assemble the minimap shots it takes just like in your guide. The advantage is that you don't have to cut out anything except the NPC's and Symbols. It works everywhere.

Hm not sure what I was thinking. It will indeed speed up the process and it will indeed work everywhere :P Once I test it out I will add it to the OP I think :)

Stanger

2012-05-22 15:47:49

I have made 3 maps of Edgeville Dungeon but what ever I do it wont work. I tryed blind walk with your method but whatever coordinates I fill in It will always click on the same spot somewhere offroad:( This route:
http://imageshack.us/photo/my-images/269/82073538.png/

Crash Override

2012-06-07 12:43:00

I made my own map.

It just keeps saying: My position is x: -1 y: -1
Any ideas?