Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Flag problems? (https://forums.graalonline.com/forums/showthread.php?t=55866)

falco10291029 10-31-2004 04:51 AM

Flag problems?
 
Ok, here's my problem, there is osbviously something wrong with how i set up the flag in the following script, but i cant figure out what (I know it's the flag because i ran several tests to check for the problem). It only does this once, even if the player has a lot of the string, acting like i have it set as if, instead of while. changing it to a for loop didnt help either.
NPC Code:


while (strtofloat(#s(clientr.#t(1)))>=1) {
freezeplayer .75;
setcharani ek_mine,;
setstring clientr.#t(1)dust,#v(strtofloat(#s(clientr.#t(1)du st))+1);
setstring clientr.#t(1),#v(strtofloat(#s(clientr.#t(1)))-1);
message #s(clientr.#t(1));
sleep .75;
setcharani idle,;
}



I have tried figuring it out myself, and i only put in part of the script, so i dont expect this thread to be closed/deleted before i solve this prob.

Slash-P2P 10-31-2004 05:40 AM

Quote:

Originally Posted by falco10291029
Ok, here's my problem, there is osbviously something wrong with how i set up the flag in the following script, but i cant figure out what (I know it's the flag because i ran several tests to check for the problem). It only does this once, even if the player has a lot of the string, acting like i have it set as if, instead of while. changing it to a for loop didnt help either.
NPC Code:

some code


I have tried figuring it out myself, and i only put in part of the script, so i dont expect this thread to be closed/deleted before i solve this prob.

I suggest a timeout instead of while
is there anything using tokenize so #t(1) works?

falco10291029 10-31-2004 05:44 AM

Quote:

Originally Posted by SlashP2P
I suggest a timeout instead of while
is there anything using tokenize so #t(1) works?

A timeout will not work in the script i have (i dont feel like posting the whole thing, just trust me), and yes, i am not stupid, it does tokenize it beforehand.

Slash-P2P 10-31-2004 05:49 AM

Quote:

Originally Posted by falco10291029
A timeout will not work in the script i have (i dont feel like posting the whole thing, just trust me), and yes, i am not stupid, it does tokenize it beforehand.

Try putting the tokenize in the while loop and keep it wherever it is now too.

VeX_RaT_Boy 10-31-2004 07:02 PM

1. That's not a flag, it's a string.

2. clientr. strings can only be set SERVERSIDE.

3. I do not think a 'while' loop is the best thing to do here. But don't kill me if I'm wrong, but from what I see, other things might be better.

Slash-P2P 10-31-2004 07:07 PM

Quote:

Originally Posted by VeX_RaT_Boy
2. clientr. strings can only be set SERVERSIDE.

I looked at the whole script and it is serverside.

VeX_RaT_Boy 10-31-2004 07:11 PM

Is a player active in the serverside script?

Slash-P2P 10-31-2004 08:05 PM

Quote:

Originally Posted by VeX_RaT_Boy
Is a player active in the serverside script?

Its under if (playerchats)

falco10291029 10-31-2004 09:04 PM

Yeah i tried a timeout loop but it doesnt even set the timeout if it;s serverside for some reason which is crap.

Slash-P2P 10-31-2004 10:50 PM

Quote:

Originally Posted by falco10291029
Yeah i tried a timeout loop but it doesnt even set the timeout if it;s serverside for some reason which is crap.

I don't know what timeout you used, but you cant have anything less than .1 for a serverside timeout.

Dach 10-31-2004 11:09 PM

Quote:

Originally Posted by falco10291029
I have tried figuring it out myself, and i only put in part of the script, so i dont expect this thread to be closed/deleted before i solve this prob.

It's against the rules to post full code to solve someone's problem, not just post full code...

Quote:

A timeout will not work in the script i have
I'm sure it would, regardless of how much you'd need to change.


try taking out all of that unnecessary code first then find the problem.
PHP Code:

while (strtofloat(#s(clientr.#t(1)))>=1) {
  
setstring clientr.#t(1),#v(strtofloat(#s(clientr.#t(1)))-1); 
  
message clientr.#t(1) = #s(clientr.#t(1));
  
sleep .75;


PHP Code:

if (playerchats) {
  
tokenize #c;
  
setstring test#t(0),5;
  
timeout .1;
}
if (
timeout) {
  if (
strtofloat(#s(test#t(0)))>=1) {
    
setstring test#t(0),#v(strtofloat(test#t(0))-1);
    
message test#t(0) = #s(test#t(0));
  
}
  
timeout .1;



falco10291029 11-01-2004 12:01 AM

I just tried using a timeout, it works fine offline meaning it's an online problem.. here's the new code:

PHP Code:

if (playerchats&&startswith(crush,#c)) {
  
tokenize #c;
  
if (strtofloat(#s(clientr.#t(1)))>0) {
    
playerx=x;
    
playery=y+5;
    
playerdir=0;
    
timeout=1;
  } else {
    
insertstring client.messages,0,You don't have any #t(1) gems.;
  }
}
if (timeout) {
  setcharani idle,;
  freezeplayer 1;
  setcharani ek_mine,;
  setstring clientr.#t(1)dust,#v(strtofloat(#s(clientr.#t(1)dust))+1);
  setstring clientr.#t(1),#v(strtofloat(#s(clientr.#t(1)))-1);
  setplayerprop #c,#s(clientr.#t(1));
  if (strtofloat(#s(clientr.#t(1)))<=0) {
    setcharani idle,;
    message Your crushing is completed;
  }
  else  {
    timeout=1;
  }



Andares 11-01-2004 04:29 AM

Quote:

Originally Posted by Slash-P2P
I suggest a timeout instead of while
is there anything using tokenize so #t(1) works?

I wasn't even aware the while command existed on gscript. :rolleyes:
I use timeouts. Timeouts own all.

xAndrewx 11-01-2004 11:52 AM

Quote:

Originally Posted by Andares
I wasn't even aware the while command existed on gscript. :rolleyes:
I use timeouts. Timeouts own all.

I never new about insertstring :o

VeX_RaT_Boy 11-02-2004 01:16 AM

Quote:

Originally Posted by falco10291029
I just tried using a timeout, it works fine offline meaning it's an online problem.. here's the new code:

PHP Code:

//MY SCRIPT 


Is this a weapon, or what?

falco10291029 11-02-2004 03:03 AM

it's an npc that turns your gems into gem dust for making spells on EK

VeX_RaT_Boy 11-02-2004 09:01 PM

I see the problem now. It does not set any active player in the timeout.

falco10291029 11-02-2004 09:56 PM

So how would i fix that?

VeX_RaT_Boy 11-03-2004 03:45 PM

When a person says 'crush SOMETHINg', you should set a string with the persons account name, then in the timeout do with(getplayer())

falco10291029 11-03-2004 10:49 PM

o yeah duh, i shoulda thought of that


EDIT: AFter some trial and error, i got it working thanks to vex, and woith thanks to others for suggesting timeouts instead of while. Thank you all

VeX_RaT_Boy 11-04-2004 11:02 PM

My ****ing name is KJETIL VALEN! NOT Vex!

falco10291029 11-04-2004 11:03 PM

well excuse me, i usually adress people by their account names

VeX_RaT_Boy 11-05-2004 04:50 PM

Then what is the point of a signature?

falco10291029 11-05-2004 10:12 PM

I never really look at the signatures people have

Blitz_Hunter 11-06-2004 07:44 AM

Quote:

Originally Posted by VeX_RaT_Boy
My ****ing name is KJETIL VALEN! NOT Vex!

Owned. :)

Slash-P2P 11-06-2004 08:26 AM

Quote:

Originally Posted by VeX_RaT_Boy
My ****ing name is KJETIL VALEN! NOT Vex!

I like Rat Boy ^^

VeX_RaT_Boy 11-06-2004 02:13 PM

I don't. Look at my signature. It does't say "RAT_Boy" there. Use Kjetil!

falco10291029 11-06-2004 08:47 PM

Ok sorry geez you dont see me getting mad if people dont call me chris do you?

Crono 11-06-2004 09:05 PM

Yo Vex the Rat Boy, calm down.

Here's my two cents-

NPC Code:

if (daplayurtouchzme) {
plzhide...maybe move1st!!;
}


VeX_RaT_Boy 11-06-2004 11:26 PM

Quote:

Originally Posted by falco10291029
Ok sorry geez you dont see me getting mad if people dont call me chris do you?

I do look at users signature. Yours is just a lame insult, not your name.

falco10291029 11-07-2004 12:08 AM

hey that insult is awesome man, be quiet!

Kaimetsu 11-07-2004 12:24 PM

Quote:

Originally Posted by falco10291029
hey that insult is awesome man

On the contrary, it doesn't even make sense. If I had a dollar for every brain that isn't in your possession, I would have approximately six billion dollars. This value would not vary if we were to make the intuitive discovery that you don't have one.

Blitz_Hunter 11-07-2004 10:43 PM

Quote:

Originally Posted by Kaimetsu
On the contrary, it doesn't even make sense. If I had a dollar for every brain that isn't in your possession, I would have approximately six billion dollars. This value would not vary if we were to make the intuitive discovery that you don't have one.

Haha, that's great. :cool:

falco10291029 11-08-2004 02:26 AM

Quote:

Originally Posted by Kaimetsu
On the contrary, it doesn't even make sense. If I had a dollar for every brain that isn't in your possession, I would have approximately six billion dollars. This value would not vary if we were to make the intuitive discovery that you don't have one.

A lot of people think that's what the insult means, but only the smart people (Yes in my school only me and a few of my friends actually GET this insult) realize by "every brain you didn't have", it is saying, every brain you're missing (as in it isn't in your possession and should be). I forgive your ignorance, but don't let it happen again ;).

Blitz_Hunter 11-08-2004 04:08 AM

Quote:

Originally Posted by falco10291029
A lot of people think that's what the insult means, but only the smart people (Yes in my school only me and a few of my friends actually GET this insult) realize by "every brain you didn't have", it is saying, every brain you're missing (as in it isn't in your possession and should be). I forgive your ignorance, but don't let it happen again ;).

I have a very strong feeling your about to get owned by Kai, yet again. >_<

falco10291029 11-08-2004 05:12 AM

Quote:

I have a very strong feeling your about to get owned by Kai, yet again.
very few people realize my argumentive talents :)

Kaimetsu 11-08-2004 08:12 PM

Quote:

Originally Posted by falco10291029
A lot of people think that's what the insult means

Then a lot of people are right. You can't just redefine whole segments of the English language and invent equivalence where none exists. It's easy to see what the 'insult' is supposed to mean, but you failed to articulate that meaning properly.

Dach 11-08-2004 09:35 PM

Quote:

Originally Posted by falco10291029
very few people realize my argumentive talents :)

I don't think any argumentative talents matter when you're wrong.
(unless you're arguing with a second grader, in which case I pity you)

falco10291029 11-08-2004 11:47 PM

Quote:

Originally Posted by Kaimetsu
Then a lot of people are right. You can't just redefine whole segments of the English language and invent equivalence where none exists. It's easy to see what the 'insult' is supposed to mean, but you failed to articulate that meaning properly.

No, just a lot of people aren't smart. If you look at the way it's worded, you can define it anyway the english langauge would allow, one way being how I said it is, and the creator decides which one is correct. Therefore, the argument IS valid because the way i interpreted it is allowable by the English langauge, and is how the creator meant it.

Kaimetsu 11-09-2004 12:05 AM

Quote:

Originally Posted by falco10291029
If you look at the way it's worded, you can define it

Are you sure you know what 'define' means? See, this is why you should not consider yourself an authority on the English language.

Quote:

anyway the english langauge would allow, one way being how I said it is, and the creator decides which one is correct
This isn't a matter of choosing one of numerous equally-weighted possibilities. In our case we have two possible interpretations. One assumes proper use of language, and is non-functional as an insult, and the other requires us to loosen our foci almost to the point of dissolution.

In other words: Being the author of a statement doesn't mean you can spool gibberish and blame other people if they point out your semantic errors.


All times are GMT +2. The time now is 01:42 AM.

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