SRL Archive - OSR Beginner Scripting Tutorials

How To Create a SPS Map. [World Map Veiw]


Mat

2012-02-14 20:39:36

Okay.
I have seen people ask for this so I thought might aswell while I'm a bit awake:).
Covering?
  • Making the Image
  • Making the Code for SPS file
  • How to Test it :)
Making the Image!
  • First of go to the Location you want to create the Map for and see if you can use the world Map on it.
Lets look at FoG.
Perfect its has a world Map :)
Map it 100% Zoom! (MUST)
  • Now Take a screen shot of the map. and paste in to the editing program of your Choice I'll be using Adobe FireWorks CS5 as its a lot easier :).
  • Crop the image so there is abit of black around the outter of the map.
  • Now create a New Canvas which is 500px by 500px and make sure it has a Black Background!
  • As you can see from the image above I Have placed the Map in the middle of the image, you must do this!
  • Now save as 0_0.PNG
Finished Map
MAP IS MADE!!!!
Modifying SPS.Simba to have a new area!
  • Open SPS.Simba and you should see this:
  • Then scroll down still you see this:
  • Copy it, scroll down and re paste it at the bottom.
  • FoG:// Name of the area
    with SPS_Surface do
    begin
    Name := 'Fog';//Name
    ImagePath := SPS_IMG_PATH + 'Fog\';//Folder in which we will create shortly
    FactorX := 400;//No Touchy
    FactorY := 400;//No Touchy
    TileOffsetX := -1;//No Touchy
    TileOffSetY := -1;//No Touchy
    Tolerance := 0.4;//Tolerance Change this is you are having problems with walking.
    end;
    As you can see the code above is for FoG. all you do is copy it and paste it in, then change the folder Name etc.
  • Once you have done this the SPS.Simba File is Modified!
Making the Folder(Really Simple)
  • Go to
    C:\Simba\Includes\SPS\img
  • Next create new folder to what you called it in the SPS.Simba which I called FoG.
  • Once the folder is created add the 0_0.PNG File you create first in to it.
Testing Your Map!
  • Testing your Map is quite easy.
  • I uses this to test my SPS Maps:
    program SPS_Tester;
  • {$i srl/srl.Simba} {$i sps/sps.simba} begin SetupSRL; SPS_Setup({Here you put the name of the area in my case FoG},[{The map Name Our case '0_0'}]); Writeln(SPS_GetMyPos); end.
  • If you look at this image where I am testing it you will see a number like this (255, 245) this is the point in which you are at in that Map which means it has worked. Move around the area and keep testing it to see if it changes.
  • Creating a path, if that is the only Image in there you can use the path creator, but I'd find it easier to move around rs and run that little script which gives you your location, take a note of it and keep walking till you created your path(Like Reflection and Injection Bots Were).
Congratuations you have created and tested a Custom SPS Map!
If you have any question please feel free to post and I'll do the best I can to assist you :)
Mat
P.S. Bed time Now 2am … HardCore Much :D :spot: Also I may do a Tutorial on How to use the MiniMap to Create SPS Maps. (Maybe)

John

2012-02-23 03:40:05

Legend just made my own for the Security stronghold. :D

the flea

2012-02-23 11:21:09

didn't know this tutorial existed very detailed and usefull

Mat

2012-02-25 04:32:31

I made it because I've seen people asking about how :) I made a Random event map for demon drill to:)
Mat

Fwd Motion

2012-02-25 04:50:10

Great tutorial! (:

I'm sure many will find it useful!

Im4everlast

2012-03-12 17:54:17

Thanks for the tutorial, this helped me make a good Abyss map :)

EDIT:

// Supported SPS surfaces
RUNESCAPE_SURFACE = 1;
DUNGEON_ESSENCE_MINE = 2;
DWARVEN_MINE = 3;
RUNECRAFTING_ALTARS = 4;
FoG = 5; // <---- this needs to be added (:

Mat

2012-03-16 15:50:49

From: Im4everlast
Thanks for the tutorial, this helped me make a good Abyss map :)

EDIT:

// Supported SPS surfaces
RUNESCAPE_SURFACE = 1;
DUNGEON_ESSENCE_MINE = 2;
DWARVEN_MINE = 3;
RUNECRAFTING_ALTARS = 4;
FoG = 5; // <---- this needs to be added (:

Abyss you can't use Whole Map I had to take small snaps of the Mini Map.

vacacow1

2012-03-28 18:30:50

Hey i can't seem to be able to compile it

Here's my code
 LIVING_ROCK_CAVERNS:// Name of the area
with SPS_Surface do
begin
Name := 'Living Rock Cavern';//Name
ImagePath := SPS_IMG_PATH + 'living_rock_caverns\';//Folder in which we will create shortly
FactorX := 400;//No Touchy
FactorY := 400;//No Touchy
TileOffsetX := -1;//No Touchy
TileOffSetY := -1;//No Touchy
Tolerance := 0.4;//Tolerance Change this is you are having problems with walking.
end;

I keep getting this problem

[Error] C:\Simba\Includes\SPS/SPS.simba(100:7): Unknown identifier 'LIVING_ROCK_CAVERNS' at line 99
Compiling failed.

I already got the folder created with the image inside of it but still can't make it compile

I wanted to know what i'm doing wrong and if you could help me please! Thanks!

Kyle Undefined

2012-03-28 18:47:45

At the top of sps.simba, which is found in /Simba/Includes/SPS/, you will see this:


const
// Path where all the SPS files are
SPS_IMG_PATH = IncludePath + 'SPS\img\';
SPS_IMG_FMT = '.png';

// Supported SPS surfaces
RUNESCAPE_SURFACE = 1;
DUNGEON_ESSENCE_MINE = 2;
DWARVEN_MINE = 3;
RUNECRAFTING_ALTARS = 4;

Add the LIVING_ROCK_CAVERNS there :)

vacacow1

2012-03-28 19:19:17

From: Kyle Undefined
At the top of sps.simba, which is found in /Simba/Includes/SPS/, you will see this:


const
// Path where all the SPS files are
SPS_IMG_PATH = IncludePath + 'SPS\img\';
SPS_IMG_FMT = '.png';

// Supported SPS surfaces
RUNESCAPE_SURFACE = 1;
DUNGEON_ESSENCE_MINE = 2;
DWARVEN_MINE = 3;
RUNECRAFTING_ALTARS = 4;

Add the LIVING_ROCK_CAVERNS there :)


Thank you very much man!!

Google

2012-03-29 20:01:34

I seem to be having a little trouble here

getting a simba error
_________________

SPS: Exception: Error while reading stream: File "C:\Simba\Includes\SPS\img\FoG\0_0.png" does not exists in SPS_Load


Please Run simba as an Adman bla bla…
Sorry for the inconvenience

osunateosu

2012-03-30 02:39:55

Beautifully done, took a while for me to get it. Had to experiment here and there, but hey isn't that what scripting is all about! With this tutorial I was able to get SPS set up in a area that wasn't already made, +1 to you Mat.

Mufasa

2012-05-27 10:57:28

Is this guide out of date now? I can't seem to find this bit.

case surface of

RUNESCAPE_SURFACE:
with SPS_Surface do
begin
Name := 'Runescape Surface';
ImagePath := SPS_IMG_PATH + 'runescape_surface\';
FactorX := 400;
FactorY := 400;
TileOffsetX := -1;
TileOffsetY := -1;
Tolerance := 0.4;
end;


The only part in the script which says "case surface of" is this bit;

// Loads the "Area" image
function SPS_GetArea(Area: string; surface: integer): TMufasaBitmap;
var
x, y: integer;
S: string;
begin
SPS_GetAreaCoords(Area, x, y);

case surface of
RUNESCAPE_SURFACE: s := RUNESCAPE_SURFACE_FOLDER;
RUNESCAPE_OTHER: s := RUNESCAPE_OTHER_FOLDER;
end;

try
Result := TMufasaBitmap.Create;
Result.LoadFromFile(SPS_IMG_PATH + s + Area + SPS_IMG_FMT);
except
Writeln('SPS_GetArea ERROR: '+ExceptionToString(ExceptionType, ExceptionParam));
end;
end;

Flight

2012-07-31 09:10:49

Mat by chance do you still have your SPS map piece for the Abyss? It would sure save me a lot of time from having to create my own.