SRL Archive - MSI Tutorials

How to: PriorityAutoing;


NCDS

2010-09-14 02:24:36

This thread is meant to educate everyone on how to use MSI's PriorityAutoing feature.


What is it?
With PriorityAutoing MSI now gives users the ability to give certain objects a priority over others, so they may be found first the majority of the time.

How it works:
If you wish to use the PriorityAutoing feature you will need to assign a numerical value to each Object declared in the Objects array in DeclarePlayers.


with MSI_Players[1] do
begin
Name := '';
Pass := '';
Nick := '';
Pin := '';
Active := True;
Member := False;
Location := ;
Scripts := [];
Objects := [[]];
Priority := [[]]; //Here
Loads[0] := ;
Loads[1] := ;
end;
As you can see, the 'Priority' array is a multidimensional array just like the 'Objects' array.

Example:

Objects := [[OBJ_TREE, OBJ_OAK, OBJ_YEW]];
Priority := [[20, 20, 60]];
As you can see in the above example, the sum of all the values in the 'Priority' array add up to 100. Therefore, in this example 'OBJ_YEW' will have a 60% chance of being first in the array, while 'OBJ_TREE' and 'OBJ_OAK' both would have a 20% chance.

If the user chooses not to fill out the 'Priorities' array, or fills it out incorrectly, then the 'Objects' array will just be searched through randomly.


Hopefully that's understandable, it's quite late :yawn:

Coh3n

2010-09-14 15:57:10

Priorities don't have to add up to 100, do they? IIRC from the code, just the higher the number, the nigher chance. It's still all a percentage, but it doesn't HAVE to add to 100.

NCDS

2010-09-15 00:20:43

From: Coh3n
Priorities don't have to add up to 100, do they? IIRC from the code, just the higher the number, the nigher chance. It's still all a percentage, but it doesn't HAVE to add to 100.


my mistake if it sounded like I was inferring that it needs to add up to 100. I was simply stating that because in the example I used, they added up to 100 so 60 would equal 60%.

It was just so I could explain it easier :p

Coh3n

2010-09-15 01:25:05

From: NCDS
my mistake if it sounded like I was inferring that it needs to add up to 100. I was simply stating that because in the example I used, they added up to 100 so 60 would equal 60%.

It was just so I could explain it easier :p

Yeah that's what I thought, but I figured I'd make it more clear. :)

Coh3n

2010-09-17 16:40:34

I don't think this is working right for me. :unsure:

I have objects set to ROCK_TIN and ROCK_COPPER, and it either mines a full inventory of one or the other.

I've also had the priorities set to 50, 50 and the default.

NCDS

2010-09-17 20:40:50

From: Coh3n
I don't think this is working right for me. :unsure:

I have objects set to ROCK_TIN and ROCK_COPPER, and it either mines a full inventory of one or the other.

I've also had the priorities set to 50, 50 and the default.


I don't really now what to say? Me and you did this together for the most part so you now just as much about it as I do.

Starting monday I should have a few solid days again to get some things done.

Meanwhile I just will have an hour here and there.. :/

Coh3n

2010-09-20 18:17:11

From: NCDS
I don't really now what to say? Me and you did this together for the most part so you now just as much about it as I do.

Starting monday I should have a few solid days again to get some things done.

Meanwhile I just will have an hour here and there.. :/

Fixed now. :)

NCDS

2010-09-20 18:41:12

From: Coh3n
Fixed now. :)


Thank you sir :)