Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Need Scripting Help (https://forums.graalonline.com/forums/showthread.php?t=60482)

raiden0899 08-12-2005 04:43 AM

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?

Lance 08-12-2005 09:25 AM

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.

raiden0899 08-13-2005 02:17 AM

i already set this.string....

Lance 08-13-2005 11:18 PM

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.

Grappler 08-14-2005 05:41 AM

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.

raiden0899 08-14-2005 09:15 AM

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.

Grappler 08-14-2005 04:52 PM

1 Attachment(s)
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.

Lance 08-14-2005 05:59 PM

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.

Lance 08-14-2005 06:01 PM

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.


All times are GMT +2. The time now is 11:16 AM.

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