![]() |
While Command doesn't seem to be working correctly
I did some testing, and found it isn't working...I am going to use the old graal version to see if it works with that....but this is for Stefan, just in case there is a problem
|
Re: While Command doesn't seem to be working correctly
Quote:
|
If your code is something like:
NPC Code:It'll only perform once, even if this.var+this.i becomes 2 again. The solution is quite simply putting it in a timeout loop. |
full script?
|
Quote:
Can't show =( Has some math in it that I don't want to reveal, its for my map and mini map. See the thing is, when I was doing it with if(weaponfired&&keydown(6)) { if (this.on=0) { this.on=1; }else{ if (this.on=1) { this.on=2; }else{ this.on=0; } } The while for while (this.on=>1) { myscript; } Worked fine...but when I switched it (since I needed to detect a key combination with another NPC) to detect a variable which indicates whether it was fired or not, it stopped working. It has never done this in the old graal EXE. |
Quote:
If that was true then my this.on while loop shouldn't be working.. btw...I do believe == is in boolean, which in other words would only work for 0 or 1, 0 meaning false, 1 meaning true. So it would just be plain = to work that way ;). Oh and I don't want it in a timeout loop, I already have some things preventing that from working well, and it will cause some lag. A timeout is unneeded for this...though, if the while is in fact flawed, it may be the only solution... |
erm grim squeaker isnt there a diff between == and = ? i thought == was for comparison ... or something i dunno
neways.. its working fine in my galaxy code .. and i havent had ne problems newhere else |
Quote:
|
== is for like checking somehting....ex: if (this.1==5){it checks if the thing equals that number...= just automatically sets the code to that number...im not good at explaining...so if part of it is wrong...dont get mad..!!:spam:
|
Soul Blade, PM Stefan the script if you don't want others to see it.
|
GScript is not c++, in c++, using == and = are two different things, in graal, they are exactly the same thing
for example if (j=4) { iam***(6); } in c++ would always run, because the "=" sets j to 4 and returns true, but if (j==4) { iam***(6); } would only run if j is 4, because it checks for equality and returns true if it is equal, and false if not. but in graal if (j=4) and if (j==4) are the exact same thing. also in graal, you cannot do things like if (j++<3), because you can't do setting in the "if" block |
Quote:
|
Re: While Command doesn't seem to be working correctly
Quote:
|
Re: Re: While Command doesn't seem to be working correctly
Quote:
Its not supposed to genius. Not with whiles at least. |
For checking stuff, just always use ==... and for setting stuff, just use =...
For that not-so-much working while-loop, it should be in an event... |
Quote:
|
you really only use while when for isnt a good choice. otherwise it really has no purpose.
|
Quote:
|
| All times are GMT +2. The time now is 06:16 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.