![]() |
updateboard question
Okay, so I am working on a shovel. I am trying to make it place tiles in the level where I dig. I wan't them to wait so long then disappear. The problem is that they only seem to disappear if I replace the tiles for blank grass 2047 I think it is. If I place my tiles over any other tile they do not automatically disappear. Is there any trick to making the tiles revert after a set amount of time? I was thinking I could just re-replace the tiles but then it gets mad ugly when the player leaves the level because then your not in the same level and they don't end up getting reverted back ect.
PHP Code:
|
hello!
you should consider dropping a dirt npc on serverside instead, that way it can be made to either fade or transition out rather than disappear at once, plus there are ways to create the illusion of no lag if you make the player do a showani()/showimg() on clientside when triggering to serverside, then have that display disappear as soon as the npc they are the placer of appears on their client. dirtholes can then be checked for using findareanpcs(); which if it contains other non dirthole npcs you will probably want to trigger an event such as 'onDig' on them anyway |
Quote:
|
Well the dirt hole would be draw-under-player?
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
But you really shouldnt have to draw the item
Under the player, that would just be weird. |
Create a new gani and add a param for the dirt image and one for the item icon.
|
Quote:
|
Quote:
Dirt hole => under player Object => same layer as player ? |
Quote:
|
Quote:
|
Quote:
|
You can check out the "object" class in my Atlantis dump for something like this. I switch out tiles both on the serverside and clientside there to get a smoother experience. It's a bit more restrictive (bushes/stones/... sitting on top of the tiles) and therefore easier to control than your shovel stuff, though, but maybe it'll give you a few ideas. One thing to keep in mind: when using updateboard(), update a region larger than 2 by 2, no matter how many tiles you actually changed. Stefan added some "optimization" to the server at some point that can really **** up your tile handling when you're updating a 2 by 2 region.
|
bro... ganis.. not hard
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
use map coordinates
|
would be interesting to see your work around
|
Quote:
|
Okay, so this is giving me problems... more specifically its making npc's a good distance away say "Hit".. It's in the weapon npc... cx/cy are the cordinate x and y that I want to check at.. (top left of the hole dug).. Should be 2x2 tiles. But this seems to affect npc's further away.
PHP Code:
Edit: Okay, sorry I guess thats x/y/w/h I needed to just supply 2,2 for the width,height... for some reason I was entering ending x/y cords. My bad, sorry. However, gralats have not been showing for me on this server or my personal dev server unless I first logon UN... anyone know why this is? I would have thought a newly bought server would be working, is it missing some file? |
Quote:
Quote:
if not then it could be triggering to the server up to 4 times and ultimately checking a larger region on serverside than necessary |
Quote:
|
findareanpcs(x, y) returns a list of npc id's, not a list of a TServerNPC objects.
|
Quote:
Quote:
|
Quote:
|
Quote:
|
Okay still scratching my head over this. Can someone please help me figure out a more logical way to actually dig a hole because my hole, keeps digging OVER the npc I dig up when it's a block and its getting frustrating.
PHP Code:
PHP Code:
|
Try setting the item layer to 1?
|
im not sure if this is the case with more recent npc-server versions but it certainly was the case before, an npc needs a setshape() to be found by findareanpcs();
your check should still be improved though, currently it is attempting a loop only to return once it finds any npc, which could be the case for a random non-blocking npc, there should be a check within the loop to determine if the npc is either blocking or is a dirthole it could also be very unsmooth to be triggering like that in order to play a sound especially given a high latency, if you do these checks on clientside first you can have the sound play in real time (and even put it in a gani for others to see), then you can do the checks again on serverside as a matter of preventing duplication or for security |
Quote:
|
| All times are GMT +2. The time now is 07:28 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.