Log in

View Full Version : Variables +1


fault
03-24-2009, 10:34 AM
How would I use +1 with variables?

in this instance everytime somebody completes a task the variable would set

$variablename+1


so if the task had 10 steps each time it would +1 so at the end it would equal 10 so another NPC could just check for that variable of 10.

I was thinking quest::setglobal(variablename, +1); But not sure if that would work in this instance.

the is also $variable=+1; but I doubt that would work

Theeper
03-24-2009, 11:27 AM
You could use something like this.


$variablename++;
quest::setglobal("variablename", $variablename, 5, "F");

trevius
03-24-2009, 06:19 PM
I have used something like this and it works well:

quest::setglobal("variablename", $qglobals{variablename}+1, 5, "F");

Also, if you are wanting to setup something like a Task, you can use the actual task system. It is a bit complex to learn at first, but works very well once you know how to do it. It might just be the best way to do what you are wanting to do.