SRL Archive - MSI Archives

Quick MSI_Objects help


the smith400

2010-12-06 21:56:37

    MSI_BANK_TT:
with MSI_Objects[whichObject] do
begin
Name := 'tttttttt';
UpText := 'anker';
Option := 'ank Banker';
Colors := [1270921];
Tol := 7;
Hue := 0.04;
Sat := 0.23;
FindAllColors := False;
W := 10;
H := 10;
Accuracy := 15;
ExcludeSelf := True;
RightClickOnly := True;
Tries := 10;
Anim := False;
WaitToMove := True;
BadColors := [];
BadColorTolerance := 10;
end;

What should I do about the Hue, Tol and Sat?
And how can I find the Width and Height of a bank or training area?

EDIT: So I tried inputing random numbers for the Hue, Tol, Sat, W and H and came up with another problem

[Hint] C:\Simba\Includes\SRL/SRL/core/gametab.scar(1513:3): Variable 'P' never used at line 1512
[Error] C:\Simba\Includes\MSI/Objects.simba(366:5): Unknown identifier 'MSI_BANK_TT' at line 365

:/

It highlighted MSI_BANK_TT: In the script

Coh3n

2010-12-07 00:17:29

I've moved this and your other thread to the MSI Help section. ;)

If you're adding a Catherby Fisher, you'll need:
  1. To add the following constants to Globals.simba in their appropriate area:

  2. // CB = Catherby Bank
    SCRIPT_CB_FISHER
    LOC_CB_BANK
    LOC_CB_FISH
    MSI_BANK_CB
  3. A TLocation record for LOC_DB_BANK and LOC_CB_FISH.
  4. An object record for MSI_BANK_CB (which is what you're doing in your post).
  5. Finally, the TScript record for SCRIPT_CB_FISHER.
I just thought I should give you that little explanation. :p

Now, on to you question. To get Hue, Sat, and Tolerance, use AutoColor Aid which can be found in you Simba/Includes/SRL/Scripting Tools folder. All you have to do is pick colors from the bank booth, choose CTS 2 (bottom right corner), and click Mark Best Color and it will show up in red dots on the screen. The Hue, Sat and Tol are all on the right side.

The red circle is the information you'll want to put into the record.


If this guide was unclear, or something needs to be better explained, let me know and I'll update it. :)

the smith400

2010-12-07 00:58:07

IT STILL WON'T WORK :'(

I did everything you said…

But I did find something. In Bank.scar Catherby's abbreviation is known as CT. I'm gonna change it all to CT from CB which i changed to CB from CA… :)

EDIT: Still didn't work…
Error: Out Of Range at line 46
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap]
File[C:\Simba\Includes\SRL/logs/SRL log 07-12-10 4.txt] has not been freed in the script, freeing it now.
File[C:\Simba\Includes\MSI\MSI Progress Reports\07-12-10 at 04 59 32 PM.txt] has not been freed in the script, freeing it now.

The following was highlighted… This problem should be damn easy to fix… but apparently it's not.
    with MSI_Locations[MSI_Players[CurrentPlayer].Location] do      



How to add a new location, minimap color area & color walk info:
Same as adding a new object. Just add the constant to Globals.simba and the records to MSI_LoadLocation (Locations.simba), MSI_LoadColorArea (Relocate.simba) and MSI_LoadWalkInfo (Walking_Color.simba) respectively.

You didn't mention we had to also add object.. took me a long time to find out the bank was an object. This should be added for the idiots like me who are to slow to understand.



P.S.. Oh. And i don't have Scripting Tools Folder

Coh3n

2010-12-07 01:28:13

Did you set this line in Globals.simba after you added the location constants?

LOC_ARRAY_LENGTH = 110; // Change to the highest location constant
And if the first post you have an object record for the bank, so I just assumed you knew it was an object. :p

Looks like I need to update that guide with some better explanations.

the smith400

2010-12-07 03:34:57

Before I start I need to tell you something. You forgot to tell me that I have to go into the Script.Simba and include the SCRIPT_CT_FISHER

I love that I'm learning this.. but I hate that it seems like I don't know what I'm doing…

I stumbled across another problem.. (that I managed to fix because of the SCRIPT_CT_FISHER thing, but there's another one… dammit)

  {$IFDEF REFLECTION}
with MSI_Locations[Loc] do // This was highlighted.
for i := 0 to High(RelocatePoints) do

Everything went smoothly but this error occured before it could start walking..
Am I meant to include a Bitmap or whatever? Im stuck here.

Coh3n

2010-12-07 10:11:37

From: the smith400
Before I start I need to tell you something. You forgot to tell me that I have to go into the Script.Simba and include the SCRIPT_CT_FISHER

Yes I do…
From: Coh3n

How to add a new script:
[INDENT]I think you'll be surprised at how easy it is to add/make an new script. MSI has been written so that ANY script for ANY skill can be easily added by only creating a few type records. Another good thing is that it requires very little scripting knowledge to do so. :)

Keep in mind that all of this is mostly for Scripting Leaders. You only need to worry about these things if you want to create and test your own scripts, otherwise just make a thread and an SL will add all the (not so) difficult stuff.

Please note that this only works for scripts that already have the skill functions written. Meaning, if there is a file for the skill in /Skills/, the functions will most likely have been written.[/INDENT]

  • Items.simba, Objects.simba, Scripts.simba, Locations.simba
    • If applicable, add the new items, objects and locations (follow the steps above).
    • Add the script's record to Scripts.simba.
  • Globals.simba
    • Add the script's constant.


From: the smith400

I love that I'm learning this.. but I hate that it seems like I don't know what I'm doing…

Well you can't expect to to create a new script record without any prior scripting knowledge.

From: the smith400

I stumbled across another problem.. (that I managed to fix because of the SCRIPT_CT_FISHER thing, but there's another one… dammit)

  {$IFDEF REFLECTION}
with MSI_Locations[Loc] do // This was highlighted.
for i := 0 to High(RelocatePoints) do

Everything went smoothly but this error occured before it could start walking..
Am I meant to include a Bitmap or whatever? Im stuck here.

Again, did you not set LOC_ARRAY_LENGTH in Globals.simba?

// Seers Village
LOC_SV_MAGICS = 100;
LOC_SV_BANK = 101;
LOC_SV_MAPLES = 102;
LOC_SV_YEWS = 103;

// Guilds
LOC_GUILD_MINE = 110;

LOC_ARRAY_LENGTH = 110; // Change to the highest location constant
If you add locations after LOC_GUILD_MINE, you have to change LOC_ARRAY_LENGTH so you don't get Out of range errors. For example, to add Catherby locations:

// Seers Village
LOC_SV_MAGICS = 100;
LOC_SV_BANK = 101;
LOC_SV_MAPLES = 102;
LOC_SV_YEWS = 103;

// Guilds
LOC_GUILD_MINE = 110;

// Catherby
LOC_CB_BANK = 120;
LOC_CB_FISH = 121;

LOC_ARRAY_LENGTH = 121; // Change to the highest location constant
See how I set LOC_ARRAY_LENGTH to 121 because 121 is now the highest location constant.

NCDS

2010-12-07 15:38:43

Did we ever add support for multiple relocation points yet? If not, we will need to do that before Catherby is added to be able to use all the spots.

I just got my internet turned on at the new place so I plan on getting into some things tonight. :)

the smith400

2010-12-07 21:10:30


// Seers Village
LOC_SV_MAGICS = 100;
LOC_SV_BANK = 101;
LOC_SV_MAPLES = 102;
LOC_SV_YEWS = 103;

// Catherby
LOC_CB_BANK = 110;
LOC_CB_FISH = 101;

LOC_ARRAY_LENGTH = 101; // Change to the highest location constant

I'm sorry, I did change it 111 but then i changed it back to 101 for one strange reason because i though 101 was after 110…

Okay, so I have one final problem. I've labelled all the locations for the fishing spots and one for the bank. Now it won't move because it can't find the location of that tile or area on the minimap. It needs to take one extra step until it can finally find that spot on the minimap. Which section of the simba scripts should i add that final walking distance? In relocate.simba or walking_color?

[Offtopic] What are x and y offsets for the pathmaker? should i refer to the one in read me or the default? because when i put the GE Yews coordinates into the Pathfinder its located off the land and on the sea, far away from the GE

nickrules

2010-12-08 17:45:52

The offsets are just used for the pathmaker. See, when you load a map, without offsets, it assumes that the top left (right?) corner of the map image you loaded is 0,0. Offsets just tell it that its not, its actually at XXXX, YYYY

Coh3n

2010-12-10 00:55:52

From: the smith400

// Seers Village
LOC_SV_MAGICS = 100;
LOC_SV_BANK = 101;
LOC_SV_MAPLES = 102;
LOC_SV_YEWS = 103;

// Catherby
LOC_CB_BANK = 110;
LOC_CB_FISH = 101;

LOC_ARRAY_LENGTH = 101; // Change to the highest location constant

I'm sorry, I did change it 111 but then i changed it back to 101 for one strange reason because i though 101 was after 110…

Okay, so I have one final problem. I've labelled all the locations for the fishing spots and one for the bank. Now it won't move because it can't find the location of that tile or area on the minimap. It needs to take one extra step until it can finally find that spot on the minimap. Which section of the simba scripts should i add that final walking distance? In relocate.simba or walking_color?

[Offtopic] What are x and y offsets for the pathmaker? should i refer to the one in read me or the default? because when i put the GE Yews coordinates into the Pathfinder its located off the land and on the sea, far away from the GE

It sounds like you're missing relocation points for the TLocation records. One those are added it should work just fine. :) The point is just a tile in the bank, for LOC_CB_BANK for example.

@NCDS: No, that support hasn't been added yet. It shouldn't be too hard I don't think.

the smith400

2010-12-10 21:10:07

From: Coh3n
It sounds like you're missing relocation points for the TLocation records. One those are added it should work just fine. :) The point is just a tile in the bank, for LOC_CB_BANK for example.

@NCDS: No, that support hasn't been added yet. It shouldn't be too hard I don't think.


I'm assuming that's relocate.simba, I don't know what to do in that script, what to add, how to work it, etc. Otherwise, I've added all the coordinates into Script.simba and Locations.simba and I double checked if they were in the same place by trying to locate other areas, like the GE_YEWS, for there locations and used the points on scripts.simba and locations.simba as reference.

Coh3n

2010-12-13 00:11:43

From: the smith400
I'm assuming that's relocate.simba, I don't know what to do in that script, what to add, how to work it, etc. Otherwise, I've added all the coordinates into Script.simba and Locations.simba and I double checked if they were in the same place by trying to locate other areas, like the GE_YEWS, for there locations and used the points on scripts.simba and locations.simba as reference.

Nope, all you're missing are the points (which are defined in the TLocation record in Locations.simba). You shouldn't have to modify Relocate.simba at all.

LOC_VE_TREES:
with MSI_Locations[Which] do
begin
Name := 'Varrock east trees';
Constant := LOC_VE_TREES;
AtBank := False;
RelocatePoints := [Point(3276, 3450)]; // This is the point that's in the middle of the trees (used to relocate if trees aren't found)
RelocateDist := 20;
end;