SRL Archive - SRL Archives

MSTPointToBankPoint


Daniel

2009-07-03 15:13:37

Now, i BELIEVE there to be something wrong with the function MSTPointToBankPoint, which can be found in Bank.scar. It just isn't processing the coordinates properly..

{*******************************************************************************
Function MSTPointToBankPoint(P: TPoint): TPoint;
by: Wizzup
Description: Converts a point on the Mainscreen to the point in the Bank.
First Row and Col are (0,0).
*******************************************************************************}
Function MSTPointToBankPoint(MSP: TPoint): TPoint;

Begin
Result.X := (MSP.X - 38) / 44;
Result.Y := (MSP.Y - 90) / 45;
End;

Soo… just wondering if anybody else has noticed this?

Nava2

2009-07-03 20:20:06

It should probably be div not / ?

I am really not sure though. Are you sure its not working?

HyperSecret

2009-07-03 21:44:40

I believe in my recent script I had to do TPoint + 1 for it to work correctly.

If you Writeln the TPoint coords I was getting like x: -6 and y: 46. The y was off a little but the x was off the screen :P.

Daniel

2009-07-04 04:37:35

I don't know, but when i use the Withdraw function the script just terminates, also, when i move the mouse to the main screen coordinates it goes to the object, but when converting to bank screen coordinates the mouse just goes off the screen..

Wizzup?

2009-07-04 14:07:27

The first item is 0, 0 if I recall correctly. (Not 1, 1 if you were expecting that.)

ZephyrsFury

2009-07-04 14:24:02

From: Wizzup?
The first item is 0, 0 if I recall correctly. (Not 1, 1 if you were expecting that.)


Using Bank Points, first slot is 0, 0.
Using Bank Index, first slot is 1

Unless something has changed.

Daniel

2009-07-05 04:49:38

Well….

Here are some of the coordinates it's returning for me..

370671616, -2129133501

ZephyrsFury

2009-07-05 07:52:11

[QUOTE=Dan's The Man;596425]Well….

Here are some of the coordinates it's returning for me..

370671616, -2129133501

That looks like you didn't drag the crosshairs.

Daniel

2009-07-05 09:01:36

From: ZephyrsFury
That looks like you didn't drag the crosshairs.


I was using SMART.. With SRL setting up SMART…

Gu3st...

2009-07-08 00:38:26

[quote=Dan's The Man;596531]I was using SMART.. With SRL setting up SMART…[/quote]
First test moving the mouse to MSX2, MSY2. Then you can tell if SMART has lost it's focus or not.