SRL Archive - MSI Suggestions

Check if there's a lot of players around


Gu3st...

2011-01-26 12:29:50

From: Flight
Also a good tip for scripts. Normal players wouldn't cut in a populated world like that, they'd probably switch or find a new spot. I don't know just how in-dept reflection is, but if it has the ability to count the number of players within an area, then you could easily get around this by having it switch worlds until it's found a less populated area. Obviously you can't have a static number of people to trigger a world switch, that'd be very detectable later on, but maybe like + or - 3 people above or over the 'population' limit would tell the script to switch worlds.

I think that's a pretty good idea, and it would be an awesome AI feature too :)

Coh3n

2011-01-26 15:25:00

Could be done with color also. Just count the white dots. IIRC there's a function in SRL that does just that.

grats

2011-01-26 15:28:40

From: Coh3n
Could be done with color also. Just count the white dots. IIRC there's a function in SRL that does just that.


There was a power mining bot.. back in 08 maybe 09 that left the world and tried a new one if too many people were around (no reflection because reflection was broken then)

I believe it was "The Mans" script

it did work too, I had it set to over 6 people then it left

**BANNED The Man

2011-01-26 15:33:55

procedure SwitchWorlds;
begin
if CountDots('white') > TooManyPlayers then
ChooseWorldBy(['players'], [True], SmartMembers, False);
end;

NCDS

2011-01-26 19:34:11

Problem is that if the players are standing in the same spot, then it would only count 1 even though there could be 100.

Regardless, we could just use Defines and add this with Ref and Color.

Coh3n

2011-01-26 20:24:17

From: NCDS
Problem is that if the players are standing in the same spot, then it would only count 1 even though there could be 100.

Regardless, we could just use Defines and add this with Ref and Color.

Could even be made as an extra; although, it may be too small.

Harry

2011-01-26 20:28:46

Doesn't MSI use Reflection? Just use Length(GetAllPlayers)?… Or am I confusing something here?

Edit:
From: NCDS
We don't rely on Reflection. Meaning it would have to be done with color as well, since you can run MSI with out Reflection.

Aaah, I see.

Well, I would suggest something to make sure it doesn't keep changing worlds over and over. Because most spots are packed and you'd be changing worlds alllll day :P

NCDS

2011-01-26 20:32:32

From: Harry
Doesn't MSI use Reflection? Just use Length(GetAllPlayers)?… Or am I confusing something here?


We don't rely on Reflection. Meaning it would have to be done with color as well, since you can run MSI with out Reflection.

Coh3n

2011-01-26 20:34:23

From: Harry
Doesn't MSI use Reflection? Just use Length(GetAllPlayers)?… Or am I confusing something here?

Only in some areas.

function MSI_GetPlayers(): Integer;
begin
{$IFDEFINE REFLECTION}
Result := Length(GetAllPlayers);
{$ELSE}
Result := CountDots('white');
{$ENDIF}
end;

procedure MSI_ChangeWorlds();
begin
if (MSI_GetPlayers > MSI_SetupVars[SETUP_MAX_PLAYERS]) then
WhateverTheFunctionIsToChangeWorlds();
end;
I would say that should be called when the player arrives at the location, after logged in, and maybe a couple times during the load.

NCDS

2011-01-26 20:56:22

From: Coh3n
Only in some areas.

function MSI_GetPlayers(): Integer;
begin
{$IFDEFINE REFLECTION}
Result := Length(GetAllPlayers);
{$ELSE}
Result := CountDots('white');
{$ENDIF}
end;

procedure MSI_ChangeWorlds();
begin
if (MSI_GetPlayers > MSI_SetupVars[SETUP_MAX_PLAYERS]) then
WhateverTheFunctionIsToChangeWorlds();
end;
I would say that should be called when the player arrives at the location, after logged in, and maybe a couple times during the load.

Take note of Harry's edit and yes.

We could just have a simple counter/hr. or something.

cycrosism

2011-02-19 21:34:41

I reckon there should be a variable called "Number of people" or something, and you enter a number such as 5 and when that number is exceeded the player logs and changes worlds?

This would be a great idea for when areas get crowded such as mining locations

Putnam

2011-02-19 21:45:12

Hmm, good idea! You could use Reflection to detect how many players are within an X number of tiles radius and if it exceeds the set amount then switch.

Coh3n

2011-02-20 02:32:11

http://villavu.com/forum/showthread.php?t=61747

Like I said in the above thread, you don't need to know anything about MSI to write something that would handle this. It's on our list of things to do, but don't expect it to be done by an MSI SL any time soon. We have other, more important issues to work on right now.

MSI is a community project, that means EVERYONE can write code for it. I think people think it's harder than it really is..

Floor66

2011-02-20 03:22:09

From: cycrosism
I reckon there should be a variable called "Number of people" or something, and you enter a number such as 5 and when that number is exceeded the player logs and changes worlds?

This would be a great idea for when areas get crowded such as mining locations


I think I wrote something like this, but with Reflection, for my rock crab killer. When I get back home I can dig it up.

Coh3n

2011-08-12 18:22:56

From: Floor66
I think I wrote something like this, but with Reflection, for my rock crab killer. When I get back home I can dig it up.

Sounds good.

I'm also pretty sure there's a GetDots function or the like in SRL that would work the same way.

E: I think when/if this gets added it should be added to the "Advanced Settings" in the new form. Also, guys, this is an extremely short function that can be added to Antiban.simba and called in MSI_FindRandoms. I'm thinking it should have a parameter to set exactly how many dots need to be found to switch worlds.

This is a good start if you've ever thought about contributing to MSI.

Kyle Undefined

2011-11-05 02:09:03

I've added this into MSI. I have it in my MSI Repo on github. What should I do now? Request a Pull?

Coh3n

2011-11-05 02:50:11

If it all works, yes. :)

Kyle Undefined

2011-11-05 02:57:39

I've tested it looking for Member worlds and free worlds. I tested everything I could, so hopefully I didn't over look anything.

Pull requested!

Coh3n

2011-11-08 17:03:25

Added. :)