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 08-12-2005, 04:43 AM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Question Need Scripting Help

I was trying to set a string with another string in its name like this:
NPC Code:
setstring clientr.bla_#s(this.string)bla,value;


When I used that in my script, it just set clientr.bla_bla and left out the
#s(this.string). Is there a way to do something like that?
Reply With Quote
  #2  
Old 08-12-2005, 09:25 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by raiden0899
I was trying to set a string with another string in its name like this:
NPC Code:
setstring clientr.bla_#s(this.string)bla,value;


When I used that in my script, it just set clientr.bla_bla and left out the
#s(this.string). Is there a way to do something like that?
Setting this.string prior to setting clientr.bla_#s(this.string)bla would be the way to go.
Reply With Quote
  #3  
Old 08-13-2005, 02:17 AM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
i already set this.string....
Reply With Quote
  #4  
Old 08-13-2005, 11:18 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by raiden0899
i already set this.string....
Post the relevant code, else we can only believe you've done something wrong since it does work.
Reply With Quote
  #5  
Old 08-14-2005, 05:41 AM
Grappler Grappler is offline
Registered User
Join Date: Feb 2005
Posts: 43
Grappler is on a distinguished road
if this.string is a number, #v(strtofloat(#s(this.string))) instead of just #s(this.string).
By setting it, you are supposed to give it a value, not just use it in a setstring with nothing, if that might be the problem.
Also, is the this.string in another npc? If it is, then it wouldn't work. this.var's are variables only for that npc.
Reply With Quote
  #6  
Old 08-14-2005, 09:15 AM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
1) It is set in the same npc that is supposed to read it.
2) I said this.string, not this.var. It is a string (text), not a variable (number).
3) Lance, please don't just assume I'm noob scripter. I'm actually pretty good.
Reply With Quote
  #7  
Old 08-14-2005, 04:52 PM
Grappler Grappler is offline
Registered User
Join Date: Feb 2005
Posts: 43
Grappler is on a distinguished road
I don't see any problem. I tried it, and it worked fine. It's probably just a small error. You should post to code, like Lance said.
Attached Images
File Type: bmp test.bmp (886.9 KB, 166 views)
Reply With Quote
  #8  
Old 08-14-2005, 05:59 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Grappler
if this.string is a number, #v(strtofloat(#s(this.string))) instead of just #s(this.string).
Ugh, no. That's wasteful and accomplishes nothing.
Reply With Quote
  #9  
Old 08-14-2005, 06:01 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by raiden0899
3) Lance, please don't just assume I'm noob scripter. I'm actually pretty good.
The only thing I'm assuming is that you're doing something wrong. Not posting the relevant code is not helping anyone help you.
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 04:05 PM.


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