SRL Archive - MSI Suggestions

Player Location Detection


Harry

2010-10-27 03:24:12

Hi,

I have used SCRIPT_PS_WILLOWS for a few days now. One of the problems I have gotten would be relocation. Yes, I use Location := LOC_PS_WILLOWS; … but, I think MSI should find out where you are and attempt to relocate.

MSI uses Reflection, yes? So, would it be hard to place the tile location of the willows, and the tile location of the deposit box? If it finds you close to either of those, attempt to walk to it based on your current "goal" (if invfull -> bank, if not -> go to trees).

They are very close (2-3 clicks), and it would (I think) make the script a lot more stable and "flexible".

Oh, and it would also help with anti-randoms, I think? If you are far away from either of those tiles, then you obviously have something wrong with your character.

Thanks.


I left my char sitting next to the deposit box when I assigned location as LOC_PS_WILLOWS…. and it eventually timed out and went back to lobby screen, but then sat on lobby screen for a bit, and logged back in to do the same infinite loop… I think MSI needs more failsafes :\

i luffs yeww

2010-10-27 10:18:58

I'd like to work on this. I think it'd be useful to have large areas defined and see if you're within that area. Then there would be paths to go from one area to another based on the predetermined locations rather than willows -> bank.

Sir R. M8gic1an

2010-10-27 14:02:26

From: i luffs yeww
I'd like to work on this. I think it'd be useful to have large areas defined and see if you're within that area. Then there would be paths to go from one area to another based on the predetermined locations rather than willows -> bank.


Lovin' it. There's alsos cstrike's all world walker.

~RM

i luffs yeww

2010-10-27 16:57:41

Yeah. :) I wanna talk to cstrike about that. I think it'd be simple enough to do.

TomTuff

2010-10-27 17:02:58

Did cstrike ever finish that?
also, in the tscriptrecord, there should be multiple places where the specified item will be. for example, on the catherby shore, there should be 3-4 fishing spots.

i luffs yeww

2010-10-27 18:06:07

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

And at some point tonight (if I don't fall asleep again >_>) I will post a picture of my idea for this. :)

(My main project is still luffs, so no promises on me working on this anytime soon. Hopefully cstrike and I will work something out, along with anyone else who wants to contribute. :))

Coh3n

2010-10-28 01:02:53

There's already a relocater, but it's different then what you're describing.

From: Harry
I left my char sitting next to the deposit box when I assigned location as LOC_PS_WILLOWS…. and it eventually timed out and went back to lobby screen, but then sat on lobby screen for a bit, and logged back in to do the same infinite loop… I think MSI needs more failsafes :\

This has been on my to do list for the last couple months. :p What you suggest is simple enough. Because our path walking loops from the last point to the first, you can start at any where that has a visible tile. We just need a function to determine whether to go to the trees or the bank on script start (could be determined by inventory count, like you said).

This is low on my priority list because if you have your player in the same location as DeclarePlayers, you don't get this problem, but you are the first to point it out, and it's been around since the beginning, I just kept forgetting about it. :p

NCDS

2010-10-28 02:41:10

I'm pretty tired right now, but I don't see why it couldn't be done with 2 simple labels.

Just a couple if( not( TileOnMM(..)) then's to determine which label to use in MSI_MainLoop.

I have to get to bed now, but I plan on doing a few things in the morning, so I can probably add this too.

Coh3n

2010-10-28 22:54:43

From: NCDS
I'm pretty tired right now, but I don't see why it couldn't be done with 2 simple labels.

Just a couple if( not( TileOnMM(..)) then's to determine which label to use in MSI_MainLoop.

I have to get to bed now, but I plan on doing a few things in the morning, so I can probably add this too.

I think this type of situation would fit better in the setup player procedure, no?

Instead of going to different places in the mainloop, just walk a certain path if not within a certain distance of the location's tile. We would have to add a tile to each location, however, but they can just be taken from the path endpoints.

E: Adding this to the Core TO-DO List. Also renaming this thread to "Player Location Detection" since it doesn't quite relate to the relocator we have. :) Just to avoid confusion.

NCDS

2010-10-29 11:47:41

In that case we could do something similar to MSI_Deposit..

begin
//...
exceptions := MSI_GetExceptions;
if Length(exceptions) > InvCount then
WalkToBank
else
WalkToSkill;
end;

I'm assuming that's what you meant?

Coh3n

2010-10-29 12:35:56

From: NCDS
In that case we could do something similar to MSI_Deposit..

begin
//...
exceptions := MSI_GetExceptions;
if Length(exceptions) > InvCount then
WalkToBank
else
WalkToSkill;
end;

I'm assuming that's what you meant?

Something similar yeah, except it would be if (InvCount > exceptions) then so it would go bank if there's items in the inventory.

Maybe labels would work better here… :o

Coh3n

2010-11-01 19:14:58

Committed. :) Keep in mind that not every location has been tested, but as long as I didn't mess up the tiles, they should work.

Harry

2010-11-02 01:13:45

Hm, didn't work for me.

[0:20:43]: [ 711 ] MSI_SetupPlayer: True
[0:20:43]: [ 711 ] MSI_SetupPlayer: True
[0:20:44]: [ 711 ] There are 0 exceptions
[0:20:44]: [ 711 ] MSI_Walk
[0:20:44]: [ 711 ] – MSI_WaitWhileResting
[0:20:50]: [ 711 ] Player's Location = Port Sarim willows
[0:20:50]: [ 711 ] MSI_Walk: False
[0:21:00]: [ 711 ] MSI_UnsetPlayer
[0:21:00]: [ 711 ] Failed to walk to location
[0:21:00]: [ 711 ] MSI_SetSkillLevels
[0:21:02]: [ 711 ] – Woodcutting level hasn't changed
[0:21:02]: [ 711 ] MSI_SetSkillLevels: Exit
[0:21:02]: NextPlayer
[0:21:06]: SwitchToPlayer(PlayerNo: 2, Active: False);

I begun at the deposit box, though Location := LOC_PS_WILLOWS;. It just sat there for a short while and nextplayer'd.

Coh3n

2010-11-02 14:21:37

From: Harry
Hm, didn't work for me.


I begun at the deposit box, though Location := LOC_PS_WILLOWS;. It just sat there for a short while and nextplayer'd.

Sorry, fixed now. :)