Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   A loop instead of a gani! (https://forums.graalonline.com/forums/showthread.php?t=81378)

Crow 08-22-2008 02:50 PM

A loop instead of a gani!
 
Well, yea, maybe some of you saw my other thread, my nickname gani which is eating waaaaay too much CPU. So Dusty said doing that in a loop is probably better. Ok, cool, I thought, let's just do that.
But now I got the problem I always had with this kinda stuff. The nicks are basically "lagging" behind, if you know what I mean. They got a small moving delay when the others move. Well, sure thing, lets just stuff it into the movement, either before or after any x/y changes, I don't remember.
Next problem arises. I never ever had a solution for this, and that's why I'm making this thread. When normally moving it works just fine. But when others are moved by scripts that don't use the movement system to move the player, KAPOOF, the nicknames got a delay again. How the hell do I fix this madness? :/

DrakilorP2P 08-22-2008 04:16 PM

Try just dealing with it. How annoying is it?

Crow 08-22-2008 04:18 PM

Pretty damn annoying.

Tigairius 08-22-2008 05:19 PM

Quote:

Originally Posted by DrakilorP2P (Post 1416480)
Try just dealing with it. How annoying is it?

Not helpful.


Crow, would you mind posting the snippet that you're having problems with?

Crow 08-22-2008 05:47 PM

Not needed anymore I suppose. Thanks to Hell Raven I got it fixed. I basically have to call a function that updates your own nick when you are moved by something that isn't the movement system. Only happens to yourself, sooo :)

Kristi 08-22-2008 08:14 PM

Quote:

Originally Posted by Crow (Post 1416498)
Not needed anymore I suppose. Thanks to Hell Raven I got it fixed. I basically have to call a function that updates your own nick when you are moved by something that isn't the movement system. Only happens to yourself, sooo :)

Just for knowledge, the reason this was happening: when the nicks were updated, the nick script kicked in before the script that was moving the player's x/y, so the movement happened then the nicks did not update until the next .05 tick.

So, the solution is to call the drawing update from the script that is doing the moving right after the moving. (which he did now)

DrakilorP2P 08-23-2008 01:31 AM

Quote:

Originally Posted by Tigairius (Post 1416493)
Not helpful.

Really? Sometimes I see people waste a lot of time trying to do something without stepping back and considering why they're doing it in the first place.

DustyPorViva 08-23-2008 03:21 AM

Also, I posted in the other thread that hiding and showing images constantly in a loop will have some bad CPU usage. Only hide when needed(current playercount < last playercount). I don't know if you do this, but someone mentioned it so I thought I'd throw that in.

Crow 08-23-2008 12:38 PM

Quote:

Originally Posted by DustyPorViva (Post 1416735)
Also, I posted in the other thread that hiding and showing images constantly in a loop will have some bad CPU usage. Only hide when needed(current playercount < last playercount). I don't know if you do this, but someone mentioned it so I thought I'd throw that in.

Hmm, so basically only hide when it's needed, and adjust the x, y and other things anyway? I will try that.

Edit: Done, and it helped. Neato!


All times are GMT +2. The time now is 05:33 AM.

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