View Full Version : Troubles with #v()

05-31-2001, 11:43 PM
I think the #v() command is broken. In proof, try this code:

// NPC made by Boco
if (playerenters) {
say2 The count is #v(this.Count);

Normally, a sign would pop-up with the text, "The count is 5". But, that isn't the case. Instead, you see, "The count is 0". Am I doing something wrong, or is this command really bugged?

05-31-2001, 11:49 PM
It's say2. It won't let you put stuff like that in, unfortunately.

At least, I think that's the problem.

06-01-2001, 12:38 AM
I have never had #v() work for me....I have had to use #s

06-01-2001, 01:28 AM
If just #v(varname) doesn't work, I'd suggest trying: #s(strtofloat(#v(varname))), sounds a bit weird, but it might just work.

06-01-2001, 09:57 AM
Try making the variable lowercase. That might fix it. I know #v works for me...

06-01-2001, 01:09 PM
I modifed my code:

// NPC made by Boco
if (playerenters) {
//If return's 1, then it works. If 0, then brokey
Normal is #v(test)#b
Level is #v(level.test)#b
NPC-Only is #v(this.test)#b
Client is #v(client.test)#b
Server is #v(server.test);

I tested all forms of the variable, and these are my results. I ran the test NPC and a sign popped up saying:

Normal is 1
Level is 1
NPC-Only is 0
Client is 1
Server is 1

this.variables are the only ones that don't work right. #s(this.variables) work, but for some reason, they don't with #v()... I am pretty sure this is a bug. Should I post this on the bug board now?

06-03-2001, 05:59 AM
Thanks for submitting it.
I have checked it, the problem is that
the npc uses a special function for say/say2
to parse the image codes (#i) and such stuff
and that function is npc-independed,
so no npc variables can be accessed.
I will fix that in the next version.