![]() |
onwater()
So i have this script, and without onwater it works fine (I use it for birds), but when i put onwater in, the damn fish doesnt move period. :/
PHP Code:
|
Which tileset type are you using?
|
based off pics0 so i guess type 0.
Its kind of on topic, in a way now, so I'll go ahead an ask another question. Trying to find out the tile location, like 0x3AB or whatever, so I can do a movement system of sorts, but this isnt working either, tried it clientside and serverside. PHP Code:
|
Move is a preexisting function :P Try renaming it.
Also, you can just do something like this: PHP Code:
Also, it may be a problem with some sort of level thing... I doubt it, but try something like: this.level.onwater(x,y); |
Quote:
|
Have you considered using the built-in move? I know this probably doesn't fix your current problem but just something that could benefit you down the line.
Here's a little example of what's possible: PHP Code:
|
I was thinking of it, but was just trying to get onwater to work first. Have crabs that use that. :)
|
Try: onwater(this.x%64+1.5,this.y%64+2)
|
Still the same. :/
|
Quote:
|
Quote:
|
It does nothing. No player chat or anything.
|
Quote:
PHP Code:
PHP Code:
|
Floating points definitely don't matter for tiles[x,y] by the way.
|
Ok, so i didnt even realize the on was cap, works fine.
Im trying to get the tile location though, and it doesnt seem thats right. How would I put player.chat to the tile location? |
Quote:
|
I mean like the 0CxC39 stuff. or is the x,y good enough to do a movement sys with?
|
Quote:
To get the hex codes for tiles you need to use the external editor. Open it up and lay the tiles you want, highlight them and then click the button on the top that looks like a circle with a cross in it. Graal will convert these to integers(numbers) in gscript though, hence why tiles[x,y] return numbers instead. They're all the same, though. |
so i could use tiles[x,y] the same way, if i wanted to?
|
Quote:
|
coo, lol. thanks.
As for the onwater part of my question, is it just that it should work and its just not? |
try onwater2() and see if makes any difference? (sorry if someone already suggested this, I didn't read the whole thread)
|
I tried with 1,1 onwater2, did the same thing. :/
|
I tried your code on my server (using new tileset type, though) and it worked fine.
Just curious, are you defining this.speed anywhere? You said it works fine without the onWater() check, but I don't see this.speed set anywhere in your post. (dividing by zero is bad and would cause this not to work!) |
Quote:
|
Quote:
|
in my ex. i thought the onwater was in working, if its not, plz point out the problem.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
I don't see why you're being so stubborn, saying that "well, it works for birds" instead of just fixing the problem I showed you? If you did set this.speed to 1, and it's still not working, then your problem might not be in the code and there is something else conflicting. With the way you've responded though, I'm getting the feeling that you haven't even tried it yet. |
Sales is correct.
http://images.encyclopediadramatica....videbyzero.jpg PHP Code:
PHP Code:
|
Quote:
Quote:
Also, I knew you couldnt divide by zero, i was simply saying it didn't apparently matter much, because the bird works fine. Dont know how, but it does. dunno how yours works sales, b/c mine just moves anywhere it pleases, water or not. |
Quote:
|
Quote:
Quote:
|
Lol sales, I told u I'd try taking it out. -_- Sorry i got like that, guess i read what you were saying wrong unless you were just intending to be rude, but I did clearly say i'd take it out, and I tried that.
onwater still doesnt work. |
Quote:
I had a problem with projectile collision because I forgot to set newtilesets=true in the server options (it could be something stupid like that). |
:/ tried. probably a good thing to have true though.
|
| All times are GMT +2. The time now is 08:27 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.