SRL Archive - MSI Suggestions

Color.scar


Blumblebee

2009-09-18 07:31:37

I couldnt remember exactly what we wanted to call it, Library.scar would probably be the most fitting. Anyways here's how it works.

Adding Constants:

I figured that we should group things and not load specifics. This would mean loading LoadLibrary(Woodcutting) or something would give you all the woodcutting colors your heart would desire.

Prefixes can be changed, just the first thing that came to mind. Maybe sort them by MS and MM and MI area's.

Simple, the Function looks as so (I added a few colors to show some examples):

program New;

const
Skill_Mining = 0;
Obj_Iron = 0;
Obj_Copper = 1;
Obj_Tin = 2;

Skill_Woodcutting = 1;
Obj_Normal = 0;
Obj_Oak = 1;
Obj_Willow = 2;

Skill_Fishing = 2;
Obj_Spot = 0;

type
TObjInfo = Record
hue, sat: Extended;
TP: Tpoint;
UpTexts: TstringArray;
col: TIntegerArray;
Tol: Integer;
Width, Height: Integer;
end;

var Arr: Array of TObjInfo;

Procedure LoadLibrary(Index: Integer);
begin
case Index of
Skill_Mining:
begin
with Arr[Obj_Iron] do // iron
begin
sat := 0.17;
hue := 0.07;
Tol := 15;
Col := [2371405];
Width := 3;
Height := 3;
Uptexts := ['ine'];
end;
with Arr[Obj_Copper] do // copper
begin
sat := 0.84;
hue := 0.02;
Tol := 10;
Col := [4225488];
Width := 3;
Height := 3;
Uptexts := ['ine'];
end;
with Arr[Obj_Tin] do // tin
begin
sat := 0.12;
hue := 0.07;
Tol := 15;
Col := [8027016];
Width := 3;
Height := 3;
Uptexts := ['ine'];
end;
end;
Skill_Woodcutting:
begin
with Arr[Obj_Normal] do // Normal
begin
hue := 0.10;
sat := 1.58;
col := [1988169];
Tol := 8;
Width := 8;
Height := 8;
Uptexts := ['ree'];
end;
with Arr[Obj_Oak] do // Oak
begin
hue := 0.06;
sat := 0.79;
col := [3176040];
Tol := 10;
Width := 15;
Height := 15;
Uptexts := ['ak'];
end;
with Arr[Obj_Willow] do // Willow
begin
hue := 0.50;
sat := 0.45;
col := [7314065];
Tol := 8;
Width := 5;
Height := 5;
Uptexts := ['illow'];
end;
end;
Skill_Fishing:
begin
with Arr[Obj_Spot] do // Fishing Spot
begin
hue := 0.07;
sat := 0.33;
col := [11380128];
Tol := 15;
Width := 3;
Height := 3;
Uptexts := ['ishing', 'pot'];
end;
end;
end;
end;

begin
SetArrayLength(Arr, 100);
end.

In essence, you load an entire skill worth of colors. If someone decides that a different organization should be put in place, I'm happy to move in that direction.

Feedback on this would be awesome, thanks.

NCDS

2009-09-18 07:37:59

I like it so far.

That's going to be lot's of lines. I don't really see how else you would do it though.

Blumblebee

2009-09-18 07:47:22

I guess adding exits after loading a skill would be a smart idea :3 kuz yeah its going to be pretty large but I think it will be benificial in the end.

NCDS

2009-09-18 07:55:41

It couldn't hurt! Since your the one that taught/helped me with what I know now, I'm sure you will make it work ;)

Coh3n

2009-09-18 17:21:51

I think it's good. It's a simple, effective way to load all the object information we need. :)