![]() |
If Problem
ok
its like this NPC Code: now when i make it NPC Code: it says a acc, like projectigi when i make it NPC Code: it says -1(this.target is set to -1 before this) |
I don't see any difference between the scripts other than the fact that the second one has the chat= commented out. What are you trying to say? Mind providing some more detail other than "its like this" and "i make it"?
|
i say that thiso.newtarget is not -1
but it dont sets this.target to thiso.newtarget |
When describing a problem you should also describe the input and output, then we can help checking if the actualy program is correct.
Input = values of this.target and thiso.target before the program runs Output = value of 'chat' after the program is ran |
ok maybe i should post the whole script XD
maybe theres something wrong with with() or so NPC Code: well as i said, this three lines NPC Code: it says -1 (means this.cur_target is till -1) NPC Code: there it says an acc (means thiso.newtarget must be a acc); |
.account is the default parameter to the player object, I believe. If you just do player.chat = player; I believe it shows their account. Try doing: player.chat = this.cur_target.getdynamicvarnames();
|
chat=this.cur_target.getdynamicvarnames();
now it says nothing XD at chat=thiso.newtarget.getdynamicvarnames(); it dont say anything either |
Quote:
PHP Code:
|
it says
"Hmm, something is in it." but why this check? i mean it cant be null because its set to -1 |
Okay, the lack of commenting in that script makes me want to run and hide (just being honest).
|
well im not good at explaining but here:
NPC Code: |
I would have set the newtarget value to 0 on created and done:
if (!this.newtarget) instead :P Might be the same thing though, not sure. |
i always used -1
xD |
Quote:
|
You're doing a .05 timeout on serverside?
|
yeah I do lol
give me another way to make a baddy smooth =D also this thread was supposed to talk about why the if doesnt work and not to talk about .05 serverside timeouts its not even done xD |
I haven't scripting movement in a long time, but I remember that the 'move' command had ways to cache movement so that serverside NPCs didn't look so "laggy."
Perhaps look into that? I'm sure there are threads in the forums about it. EDIT: Found this, might help (for move command's last param): Quote:
|
as i said this thread is NOT supposed to talk about timeouts/lags
it supposed to talk about why this if doesnt works and as i said it isnt done |
Quote:
Quote:
|
Quote:
|
Quote:
However, there's still a bit of functionality in small timeouts. Let's say that you had an object you laid, you trigger it to activate, and then there's a time until deactivation required in the parameters of the trigger. Perhaps you'd want that to be 0.05, or perhaps 0.1. In most cases it probably wouldn't make sense, but there's probably a scenario that exists in which it does. Now, looping timeouts serverside is a different story. I'd say 0.6 is the highest I'd go for them, and then only if the level has players in it. Such the case for Baddies. A looping 0.05 serverside timeout is certainly enough to seriously risk crashing the NPC server. |
All times are GMT +2. The time now is 03:06 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.