SRL Archive - General

MSI Default options for DeclarePlayers


Sir R. M8gic1an

2010-11-15 03:46:26


user := 'RM';
pw := 'msi';
//Staff := STAFF_FIRE

for i:= 0 to High(users) do
begin
if (users.Staff = STAFF_NULL) then
users.Staff := ChooseStaff(MostCasts)
end;


This allows us to have default options in MSI.

I think this would make declaring players a lot easier.

The same can be applied to other things

Rocks := ALL;

eg.
VEM:
Rocks := All //meaning
Rocks := Tin, Copper, Iron

Rocks := bronze
Rocks := Tin, Copper

Rocks := steel (?)
Rocks := Iron, Coal


//… furthermore…
if (Rocks = steel) then
SwitchScript(MINER_GUILD)

~RM

Coh3n

2010-11-15 12:06:16

We already have this. :p We've had it since the beginning actually.

The default objects (trees, fishspots, rocks) are in the script records, and the way I have magic setup so far is if the user doesn't specify which type of staff to use then it will choose the ones that use the most runes. The "users.Staffs" part is also set in MSI_LeastRunesStaffs (which is the default option right now as I haven't written the others yet).

For a script, you can fill it out like this and it will still work perfectly.

with Scripts[0] do
Name := SCRIPT_DB_WILLOWS;

E:
From: Sir R. Magician
//… furthermore…
if (Rocks = steel) then
SwitchScript(MINER_GUILD)

~RM

Shouldn't even need the if statement. We should just be able to switch to any script, and have the attributes automatically reset if not already set by the user. Afterall, it's all stored in the Players.Scripts array depending how the user set that player up.