Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Bug Report (https://forums.graalonline.com/forums/forumdisplay.php?f=193)
-   -   onwater2 not working (https://forums.graalonline.com/forums/showthread.php?t=86498)

DustyPorViva 06-23-2009 10:15 AM

onwater2 not working
 
I have the following script running:
PHP Code:

  if (horsecheck == true) {
    
wall[0] = onwater2(player.x+check[k][0][0],player.y+check[k][0][1],check[k][2][0],check[k][2][1]);
    
wall[1] = onwater2(player.x+check[k][1][0],player.y+check[k][1][1],check[k][2][0],check[k][2][1]);
  } else {
    
wall[0] = onwall2(player.x+check[k][0][0],player.y+check[k][0][1],check[k][2][0],check[k][2][1]);
    
wall[1] = onwall2(player.x+check[k][1][0],player.y+check[k][1][1],check[k][2][0],check[k][2][1]);
  } 

Basically, if the player is riding a horse it will check for water, and if not it will check for a wall.

They both use the exact same checks. With wall checking, the detection is perfect. However, if I start trying to detect water, half the time the player will go halfway into the body of water and such. It seems to have a slight delay in actually registering water.

This is clientside, by the way. Can this please be fixed? :(

edit: after some testing, onwater2(x,y,1,1) will only check a one pixel area for water, NOT 1 tile, like onwall2. HOWEVER, onwater2(x,y,2,2) functions the same as onwall2(x,y,1,1)... so I don't know what the hell is going on.

Here's in the script I used to test:
PHP Code:

  showpoly(200,{mousex-1,mousey,mousex-1+1,mousey,mousex-1+1,mousey+1,mousex-1,mousey+1});
  
changeimgcolors(200,1,0,0,.25);
  
showpoly(201,{mousex,mousey,mousex+1,mousey,mousex+1,mousey+1,mousex,mousey+1});
  
changeimgcolors(201,0,1,0,.25);
  
player.chat onwater2(mousex-1,mousey,1,1SPC onwall2(mousex,mousey,1,1); 

http://i42.tinypic.com/261f9ly.png
Red box represents my water check, and the green is the wall check. Both are identical, except one returns true(the onwall2) and one does not -- these results are also shown over the player's head, left is the water check and right is the wall.

Robin 06-27-2009 05:11 PM

Does it work in the bigger areas?

DustyPorViva 08-20-2009 07:06 PM

Quote:

Originally Posted by Robin (Post 1502175)
Does it work in the bigger areas?

Don't know what you mean. All I know is it doesn't work like it should.

Stefan, could this be fixed please? I don't want to rewrite a WHOLE movement system to accommodate for a bug.

fowlplay4 08-20-2009 07:46 PM

Quote:

Originally Posted by DustyPorViva (Post 1516693)
Don't know what you mean. All I know is it doesn't work like it should.

Stefan, could this be fixed please? I don't want to rewrite a WHOLE movement system to accommodate for a bug.

I've never trusted the onwall2 or onwater2 functions, but

For now anyway, maybe just use a solution like the following?

PHP Code:

function onwater3(txtywh) {
  if (
== 12;
  if (
== 12;
  return 
onwater2(txtywh);


Edit: I see that you might be using more than just 1 tile checks.

Crow 08-20-2009 07:59 PM

onwall2 is fine, you just have to be aware of Graal's polygon calculation bug, since onwall2 seems to use the same code. Not sure about onwater2 though, but I can't image why it wouldn't function properly. I will give it a go soon.

[email protected] 08-22-2009 07:11 PM

please fix! thank you


All times are GMT +2. The time now is 03:22 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.