Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-03-2002, 07:13 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Thumbs down string problem

When I make a string to equal something and then I reenter the level how come the string will appear twice in the flag menu?
__________________
maximus_asinus
Reply With Quote
  #2  
Old 02-03-2002, 08:05 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
This aint josey

Try using a Variable #v
turns it into a number
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #3  
Old 02-03-2002, 10:48 PM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
example

If I made something initilize with a client.variable then reloaded it would repeat flag in the flag menu,like
if (playerenters) setstring client.durbies,0;
When I reload it will put client.durbies=0,client.durbies=0 in the flag menu.I don't want to post the script cause its for mining,and people are looking for it.
__________________
maximus_asinus
Reply With Quote
  #4  
Old 02-04-2002, 01:29 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to royce
what you mean is why does it repeat setting their durbies to 0 after they re-enter the level it will reset the script back to setting the durbies to 0.....spilt that 1 part then use destroy to penilize that seciton.
Reply With Quote
  #5  
Old 02-04-2002, 02:54 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
thanx,I fixed it,I made the script a bit better so it doesn't lag :P
__________________
maximus_asinus
Reply With Quote
  #6  
Old 02-04-2002, 11:41 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
It was doing that I believe because of a bug. I noticed that about a week ago also, I believe if you redownload it is fixed...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #7  
Old 02-05-2002, 05:26 AM
Gohan43331 Gohan43331 is offline
Registered User
Join Date: Jan 2002
Posts: 87
Gohan43331 is on a distinguished road
Send a message via AIM to Gohan43331
I'm also having a problem with strings...
NPC Code:

// Example:
if (playertouchsme) {
if (strequals(balance,#c)) {
say2 Greetings. Your balance is: #v(strtofloat(brbank));
}
tokenize #c;
if (strequals(deposit,#t(0))&&playerrupees>=strtofloa t(#t(1))) {
this.brbanktemp=brbank+strtofloat(#t(1));
playerrupees-=strtofloat(#t(1));
setstring brbank,#v(this.brbanktemp);
say2 Deposited #t(1) gralats.#bBalance is now #v(strtofloat(brbank));
}
}



When i deposit, say...1 gralat...it always says the ammount deposited, but never resets the brbank string... And every time i check the balance...no matter what the this.brbanktemp or str(brbank) is...IT"S ALWAYS 00000000000000...
:grrr: :grrr: :grrr:

(Irritated) Gohan
Reply With Quote
  #8  
Old 02-05-2002, 07:46 AM
Lomgren Lomgren is offline
Senior Member, Anti-Spam
Join Date: Mar 2001
Location: Missouri
Posts: 196
Lomgren will become famous soon enough
Gohan,when reading the value of a string, you have to do this;
#v(strtofloat(#s(string))

not sure why, but it works
__________________
Lomgren - devoted to classic, even though I may be gone for months on end
Reply With Quote
  #9  
Old 02-05-2002, 08:16 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Quote:
Originally posted by Gohan43331
I'm also having a problem with strings...
NPC Code:

// Example:
if (playertouchsme) {
if (strequals(balance,#c)) {
say2 Greetings. Your balance is: #v(strtofloat(brbank));
}
tokenize #c;
if (strequals(deposit,#t(0))&&playerrupees>=strtofloa t(#t(1))) {
this.brbanktemp=brbank+strtofloat(#t(1));
playerrupees-=strtofloat(#t(1));
setstring brbank,#v(this.brbanktemp);
say2 Deposited #t(1) gralats.#bBalance is now #v(strtofloat(brbank));
}
}



When i deposit, say...1 gralat...it always says the ammount deposited, but never resets the brbank string... And every time i check the balance...no matter what the this.brbanktemp or str(brbank) is...IT"S ALWAYS 00000000000000...
:grrr: :grrr: :grrr:

(Irritated) Gohan
you shouldn't do strequals(balance,#c), well atleast i dont think so, you should do strequals(#c,balance)
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #10  
Old 02-05-2002, 08:20 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
try thisGohan43331

NPC Code:

// Example:
if (playertouchsme) {
if (strequals(#c,balance)) {
say2 Greetings. Your balance is: #v(strtofloat(brbank));
}
tokenize #c;
if (tokenscount==2&&strequals(#t(0),deposit)&&playerr upees>=strtofloat(#t(1))&&strtofloat(#t(1))>0) {
this.brbanktemp=strtofloat(#s(brbank))+strtofloat( #t(1));
playerrupees-=strtofloat(#t(1));
setstring brbank,#v(this.brbanktemp);
say2 Deposited #t(1) gralats.#bBalance is now #v(strtofloat(#s(brbank)));
}
}

__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #11  
Old 02-05-2002, 01:15 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by TDK_RC6


you shouldn't do strequals(balance,#c), well atleast i dont think so, you should do strequals(#c,balance)
if its checking to see if the strings are equal, why would it matter?...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:51 PM.


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