PDA

View Full Version : Qglobal problem


Adrianne
05-28-2006, 02:38 PM
Ok. Im creating an npc named Ambassador Dumont. I have him created and all, and I had the script working perfectly, however, I would like to add a feature to where he gives 20 pp to beginning players to buy some starter gear from a merchant, and not be able to get 20 more pp again from him. Im very confused about qglobal. Ive searched probably every thread on this forum, but I cant seem to find an explination here. It just seems vague. I understand the basic jist of it, but I cant figure out how to make it work. I looked in the npc_types in the db, and I cannot find the npcid of the character in there anywhere. But, he is in the database, and can run the basic areas of the quest, but just has problems with qglobal. I would appreciate any help anyone can give on this, because I have racked my brain for hours on end on this one.


sub EVENT_SAY
{
if($text=~/Hail/i) { quest::say("Ahh, hello young $race, what brings you to the Orders Library? You wouldnt happen to be responding to one of the [flyers] I sent out now would you?"); }
if($text=~/flyer/i) { quest::say("Ah good, good. Just give the flyer back to me and we shall begin."); }
if ($text=~/agree/i) {if($begincash == "") { quest::say("Good. Then all you need is some adventuring equipment and your ready to go. Here take a few platinum and go buy what you need from the armourers and weaponsmiths of the city. Dont worry, important buildings have magical signs at their entrances. You shall find it easy to locate the merchant shops that sell the items you seek. When you are [ready], return to me.");} elsif($begincash=="1") { quest::targlobal("begincash","1","Y5,336103,$charid,26);
quest::me("You have recieved a character flag!"); quest::say("Now dont be greedy. That is all the cash I am going to give you $name); } if ($text=~/ready/i) { quest::say("Good you are ready to begin, we shall start you off on something simple. The councils scouts have recently discovered a strange new race of humanoids dwelling in a place they call Crushbone. The reason it is called this is a matter of dispute between the council members, but nonetheless, the task before you is simple enough. The council wishes to gain information on the humanoids in Crushbone. An ambassador was sent a few days ago. When he returned he was missing a few vital body parts. Visit this place and get to know their history and lore. The scouts report seeing small books on a few of the more intelligent humanoids there. Bring back 4 of these 'Orcish tomes' for the council to study. Oh and $name, the council does not care how you obtain them."); }
if ($text=~/spellcaster/i) { quest::say("Then I suppose you will need these as well.");
quest::scribespells();
quest::say("There you go! For more powerful spells, I suggest you visit the librarians inside the Orders Library. There are many spells inside that great library, but keep in mind that you will have to pay for scrolls. The harder to find scrolls do not come cheap."); }
}
sub EVENT_ITEM
{
if ($item1 == 1001) { quest::say("Ok $name lets get started. Hmm your not very experienced are you? Well it doesnt matter, I can fix that."); quest::level(45); quest::setallskill(60); quest::say("Ah there we go, much better wouldnt you [agree]? It will take you a while to get used to your new skills, but if you wish to speed up the process, simply pay a visit to a trainer of your class. Of course you will have to pay for their services. Would you happen to be a [spellcaster]?"); }
}


Guess im just really confused. Im pretty new at this, but Im really interested in learning coding.

ylosh
05-28-2006, 11:58 PM
use quest::setglobal instead of targlobal.

set the qglobal field in npc_types to 1 if you haven't already to enable quest globals for your chosen npc. target the npc and use #showstats or #npcstats to get the npcid number.

the quest tutorial wiki page explains everything else pretty well.

Adrianne
05-30-2006, 01:16 PM
thats the thing.. I cant find any good examples there that were working.. all I saw were works in progress.. and the examples that were there were vague.. my npc is in the database.. he spawns when the server starts, but I cant find his npcid in the npc_type field.. I know his npcid. I just dont understand alot of this. I guess I just need to play around with it some more.

ylosh
05-30-2006, 06:55 PM
update npc_types set qglobal=1 where id=(ambassador dumont npcid);
quick example, maybe it'll help you.

sub EVENT_SAY {
if ($text=~/hail/i) {
if ($monkey == 1) {
quest::say("global is set");
}
else {
quest::say("hello there");
}
}
}

sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 1001 => 1)) {
quest::say("here is your quest global");
quest::setglobal("monkey",1,0,"Y1"); #option 0 - this npc, this player, this zone for 1 year
}
plugin::return_items(\%itemcount);
}

Adrianne
05-31-2006, 10:02 AM
Thanks. I appreciate the feedback. Much appreciated.

Adrianne
06-06-2006, 12:24 PM
ok went through and havin some problems with this. it works for the most part, however when I hail, the both the "Ahh, hello young $race, what brings you to the Orders Library? You wouldnt happen to be responding to one of the [flyers] I sent out now would you?" and "May you travel with the Fives blessing $name." show up when there is no quest global entry for it in the database, and when it sets the global to 1, the "May you travel with the Fives blessing $name." doesnt show up at all. What am I doin wrong here?
Ive tried every combination I could think of, searched this forum and peq forum, and have come up with no solution. Without the


else
{
quest::say("May you travel with the Fives blessing $name.");
}


Here is what I have so far:


sub EVENT_SAY
{
if ($flyer == 0)
{
if ($text=~/Hail/i)
{
quest::say("Ahh, hello young $race, what brings you to the Orders Library?
You wouldnt happen to be responding to one of the [flyers] I sent out
now would you?");
}
if ($text=~/flyer/i)
{
quest::say("Ah good, good. Just give the flyer back to me and we shall
begin.");
}
if ($text=~/ready/i)
{
quest::say("Here. This item will return you to our fair city. It holds
enchantments that will make you more powerful as well. Ill start you off on
something simple. The councils scouts have recently discovered a strange new
race of humanoids dwelling in a place they call Crushbone. The council
wishes to gain further information on the humanoids in Crushbone. An
Ambassador was sent a few days ago. He returned with a few missing body
parts. The scouts report seeing small books on a few of the more intelligent
looking humanoids there. Bring back at least four of these books for the
council to study. The council does not care how you obtain them. Feel free
to get them by any means necessary. Upon your return, find my apprentice.
He will handle the books accordingly.");
quest::summonitem(1002);
quest::setglobal("flyer",1,0,"M2");
}
else
{
quest::say("May you travel with the Fives blessing $name.");
}
}
}


I have sub EVENT_ITEM stuff too, but it doesnt relate to this, Im just wanting him to not allow people to repeat the quest. When they have said ready, I want it to consider the quest done, and instead of Hail saying:

"Ahh, hello young $race, what brings you to the Orders Library?
You wouldnt happen to be responding to one of the [flyers] I sent out
now would you?"

Id like it to say:

"May you travel with the Fives blessing $name."

Any help would be appreciated here.

ylosh
06-06-2006, 03:22 PM
sub EVENT_SAY {
if ($text=~/hail/i && $flyer == 1) {
quest::say("May you travel with the Fives' blessing, $name.");
}
if ($flyer == 0) {
if ($text=~/Hail/i) {
quest::say("Ahh, hello young $race, what brings you to the Orders Library? You wouldnt happen to be responding to one of the [flyers] I sent out now would you?");
}
if ($text=~/flyer/i) {
quest::say("Ah good, good. Just give the flyer back to me and we shall begin.");
}
if ($text=~/ready/i) {
quest::say("Here. This item will return you to our fair city. It holds enchantments that will make you more powerful as well. Ill start you off on something simple. The councils scouts have recently discovered a strange new race of humanoids dwelling in a place they call Crushbone. The council wishes to gain further information on the humanoids in Crushbone. An Ambassador was sent a few days ago. He returned with a few missing body parts. The scouts report seeing small books on a few of the more intelligent looking humanoids there. Bring back at least four of these books for the council to study. The council does not care how you obtain them. Feel free to get them by any means necessary. Upon your return, find my apprentice. He will handle the books accordingly.");
quest::summonitem(1002);
quest::setglobal("flyer",1,0,"M2");
}
}
}

Adrianne
06-06-2006, 09:35 PM
you rock! thanks alot it works perfectly.

Adrianne
06-07-2006, 09:26 AM
is there any problems with qglobal? Im trying to update the variable, and it doesnt work. heres example.


quest::setglobal("zavious",1,0,"M2");


that will create the variable zavious, and will set it to 1.. however when I try and create


quest::setglobal("zavious",2,0,"M2");


after a quest::say(""); and it wont update.. I even tried


quest::delglobal("zavious");
quest::setglobal("zavious",2,0,"M2"); #together


and


quest::delglobal("zavious"); #by itself


is this a bug that it wont delete the global variable or update it from 1 to 2.. it was originally 0.

Sory for bothering you again btw.. I just dont understand why its not updating.

aza77
06-07-2006, 09:36 AM
http://www.eqemulator.net/wiki/wikka.php?wakka=QuestTutorial#globals

Adrianne
06-08-2006, 03:51 AM
yes.. Ive read that tutorial several times, however what Im saying is the

quest::setglobal([varname],[value],[options],[duration]);


command, after used once, doesnt want to modify the value again.. like if it was originally 0.. then I change it to 1,.. when I change it to 1 it creates the variable and sets it to 1.. but when I try to use it again, and put in

quest::setglobal("zavious",2,0,"M2");

for instance, it doesnt change the variable zavious to 2 like it says in that tutorial..

Ill quote:

"setglobal
quest::setglobal([varname],[value],[options],[duration]); (perl format)

The setglobal command allows you to create or modify an existing global variable for the mob you are using the command on."

If the variable exists, and its currently set at 1, this command will not modify the variable and change it to 2.

the quest tutorial wiki page explains everything else pretty well.

so yea.. like I said.. Ive done all the reading.. searching.. and everything on here.. Ive searched peq's site as well.. I wouldnt post unless I completely didnt understand, and have searched in every possible manner. I read in peq's site that its a problem with qglobal. Im wondering if this is true.

If I can figure out how to update a global variable up to like 5 different times on 1 npc I would be set. I need to make it where people can only do 1 step at a time, not skip steps and not do steps more than once in a single npc quest. I cant do that when quest::setglobal doesnt modify the variable like specified in the wiki..:( Is anyone else having problems with this? If so, is there any other way to do this if globals dont update more than 1 time?

aza77
06-08-2006, 05:12 AM
at the quest tutorial:
[varname] the name of the variable you want to save. Do not include the variable prefix as part of the name. When the quest for the npc who recieves this variable begins, a variable with the name that you here preceeded by a "$" will be available. For example, if [varname] is "genius" then a variable named $genius will be available to the quest script of the npc with whatever you specified in it. Variables are cached and won't be reloaded unless the cache cleared or the variable is undefined. So make sure to use $variable = undef; after the variable was used, especially if you have multiple persons using the quest.

this means in your case each time you use the variable make sure to use $variable = undef; so it gets reloaded ;)

Adrianne
06-08-2006, 10:04 PM
Yea... that sucks.. Ive tried every possibility I could with $zavious = undef;.. nothing would update... tried quest::setglobal ($zavious = undef); Ive tried undef zavious, undef $zavious, quest::delglobal ("zavious"); wiht no sucess.. It was originally at 0, I used a coommannd to make it to 1 and it was sat at 1, and wont update to two.. with the commands specified by the program. I didnt knotice the part about $variable = undef; but Id like to see some sorta example here. Once I learn this, since there is very vague descriptions in all of this.. and no examples or documentation... well documentation that id like.. so I can learn this stuff.. but Ive spent 8+ hrs a day on this with no luc.. it wont go from 1 to 2.. Id be more tan willing to post both of my examples in order to help future people that come along that dont understand the stull that I didnt... I think it would be very helpful. So far heres what Im tryin to do. Its my last real step before I finally figure out the jist of qglobal. anyway, heres what i got. id like for someone to point out what Im doin wrong here, and ILl post alot more that you guys have helped with as well that I think a lot of newer scripters like me that catch on fast. I feel like a noob for not readin those few lines about $variable = undef; however Im catchin on pretty fast. for only learning this for about 2-3 weeks, Ive come prett yfar.At any rate, Im working on a smaller one first. Its pretty filled up with qglobals:P But like I said, I have some complex scripts, that I will utilate qglobal in once I get it sorted, that Im willing to share with the community... once I figure this one darn command out properly... Ive searched websites.. even non emu ones.. and have come up with stuff that doesnt work.. Ive read every script in peq quest database.. with little success.. they dont use $variable = undef; they use quest::delglobal("Zavious"), however.. delglobal wont delete it! very strange to me..at any rate Id like to thank everyone helping me fix this I need it to go from 0 to 1 to 2 to 3 to 4 in one script... I know thats extensive, but i need to make this part to where a player can only do this quest once.. well any player only do this quest once.. IM gonna go ahead and post my code here in hopes of some soultion someone can give me, because I am at a lose here.. Ive spend 8ish hours tryin to figure this out.. it seems like most of the peq quests dont use this function.. I saw 2 that used globals.. are they for advanced scripters? or is it new? Problem is our old coder is mia.. he said he would play, but wasnt gonna touch coding etc etc... so I decided to learn. IM a quick learner when it comes to this.. I think Ive got everything down pat now when it comes to quest npc's. But when my servers done, your more than welcome to come in and test any that wants to. Ill let come in and look. But anyway, I really hope Im not buggin you guys, and actually consider me as a new programmer keeping eqemu alive. So let me know what you think here


sub EVENT_SAY
{
if ($text=~/hail/i && $zavious == 1)
{
quest::say("Have you retrieved the four books that the Ambassador requested
from Crushbone?");
}
if ($text=~/hail/i && $zavious == 2)
{
quest::say("Are you [willing] to perform another task for the council?");
}
if ($text=~/hail/i && $zavious == 3)
{
quest::say("Have you discovered what else the orcs are doing in Crushbone?");
}
if ($text=~/hail/i && $zavious == 4)
{
quest::say("Good luck on your journey $name. May the Five light your path.");
}
if ($text=~/willing/i && $zavious == 2)
{
quest::say("Good, then you shall set off immediately to Crushbone. Some of
the adventurers that returned reported seeing a log cabin holding someone of
importance. We wish you to seek this person out and discover what else the
Orcs are doing. #summonitem 69977");
quest::setglobal("zavious",3,0,"M2");
}
if ($zavious == 0)
{
if ($text=~/Hail/i)
{
quest::say("Hello $name. I have been expecting you. Ambassador Dumont told
me you would be arriving shortly. Do you have the four books that the
Ambassador told you to retrieve from Crushbone? If so, hand them to me.
#summonitem 51510");
quest::setglobal("zavious",1,0,"M2");
}
}
}


sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 51510 => 4) && $zavious == 1)
{
quest::say("Ahhh you have returned with the books. You say the humanoids call
themselves Orcs? Hmmm.. Interesting.. The council will study these books to
decipher what is written within them. Ambassador Dumont thanks you as do I,
brave $race. If your still [willing] they have another task for you.");
quest::setglobal("zavious",2,0,"M2");
}
elsif (plugin::check_handin(\%itemcount, 69977 => 1) && $zavious == 3)
{
quest::say("What is this $name? It appears to be some kind of battleplan. Is
that Felwithe?! This truly is an amazing discovery my friend. Take this to
Councillor Elandilira. I think she may like to hear of this discovery. It is
a quick translation of the battleplans.");
quest::summonitem(1004);
quest::setglobal("zavious",4,0,"M2");
}
else
{
(plugin::return_items(\%itemcount));
quest::say("This isn't what I'm looking for.");
}
}
}


Once again, any help would be appreciated, I know Im probably bugging you guys at this point, but if theres anything I can do to help anyone, let me know and I will. Just being able to update the variable from 0 to 1 to 2 to 3 to 4 would be good, and I heard its through use of $variable = undef; if someone could help here.. Id worship them:P Thanks in advance.

aza77
06-09-2006, 12:11 AM
sub EVENT_SAY
{
if ($text=~/hail/i && $zavious == 1)
{
$zavious = undef;
quest::say("Have you retrieved the four books that the Ambassador requested
from Crushbone?");
}
if ($text=~/hail/i && $zavious == 2)
{
$zavious = undef;
quest::say("Are you [willing] to perform another task for the council?");
}
if ($text=~/hail/i && $zavious == 3)
{
$zavious = undef;
quest::say("Have you discovered what else the orcs are doing in Crushbone?");
}
if ($text=~/hail/i && $zavious == 4)
{
$zavious = undef;
quest::say("Good luck on your journey $name. May the Five light your path.");
}
if ($text=~/willing/i && $zavious == 2)
{
$zavious = undef;
quest::say("Good, then you shall set off immediately to Crushbone. Some of
the adventurers that returned reported seeing a log cabin holding someone of
importance. We wish you to seek this person out and discover what else the
Orcs are doing. #summonitem 69977");
quest::setglobal("zavious",3,0,"M2");
$zavious = undef;
}
if ($zavious == 0)
{
$zavious = undef;
if ($text=~/Hail/i)
{
quest::say("Hello $name. I have been expecting you. Ambassador Dumont told
me you would be arriving shortly. Do you have the four books that the
Ambassador told you to retrieve from Crushbone? If so, hand them to me.
#summonitem 51510");
quest::setglobal("zavious",1,0,"M2");
$zavious = undef;
}
}
}


sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 51510 => 4) && $zavious == 1)
{
$zavious = undef;
quest::say("Ahhh you have returned with the books. You say the humanoids call
themselves Orcs? Hmmm.. Interesting.. The council will study these books to
decipher what is written within them. Ambassador Dumont thanks you as do I,
brave $race. If your still [willing] they have another task for you.");
quest::setglobal("zavious",2,0,"M2");
$zavious = undef;
}
elsif (plugin::check_handin(\%itemcount, 69977 => 1) && $zavious == 3)
{
$zavious = undef;
quest::say("What is this $name? It appears to be some kind of battleplan. Is
that Felwithe?! This truly is an amazing discovery my friend. Take this to
Councillor Elandilira. I think she may like to hear of this discovery. It is
a quick translation of the battleplans.");
quest::summonitem(1004);
quest::setglobal("zavious",4,0,"M2");
$zavious = undef;
}
else
{
(plugin::return_items(\%itemcount));
quest::say("This isn't what I'm looking for.");
}
}
}

Adrianne
06-09-2006, 08:16 AM
now when var is at first 0 like it starts with, you can hail fine, you hail a second time it says

Have you retrieved the four books that the Ambassador requested
from Crushbone?
Hello $name. I have been expecting you. Ambassador Dumont told
me you would be arriving shortly. Do you have the four books that the
Ambassador told you to retrieve from Crushbone? If so, hand them to me.
#summonitem 51510

at the same time.. you turn in the 4 items and it says the normal message, but doesnt update the global_type from 1 to 2.. when you hail it says the same thing:

Have you retrieved the four books that the Ambassador requested
from Crushbone?
Hello $name. I have been expecting you. Ambassador Dumont told
me you would be arriving shortly. Do you have the four books that the
Ambassador told you to retrieve from Crushbone? If so, hand them to me.
#summonitem 51510

sigh..

aza77
06-09-2006, 09:47 AM
if ($zavious == 0)
{
$zavious = undef;
if ($text=~/Hail/i)
{
quest::say("Hello $name. I have been expecting you. Ambassador Dumont told
me you would be arriving shortly. Do you have the four books that the
Ambassador told you to retrieve from Crushbone? If so, hand them to me.
#summonitem 51510");
quest::setglobal("zavious",1,0,"M2");
$zavious = undef;
}
}

i don't know why u have $zavious == 0 in there ... the way u write it is a little bit confusing.

Adrianne
06-09-2006, 04:37 PM
wouldnt that be correct? I only want it to say:

Hello $name. I have been expecting you. Ambassador Dumont told
me you would be arriving shortly. Do you have the four books that the
Ambassador told you to retrieve from Crushbone? If so, hand them to me.
#summonitem 51510

one time, so when its 0 it doesnt have a variable there, but after you say it it doesnt say that anymore because it changes the variable to 1 so that it will now say:

Have you retrieved the four books that the Ambassador requested
from Crushbone?


Is this not the proper way to do this?

I kinda want this quest to progress step by step, and basically each player have to turn in the four books before they can turn in the battleplans to get the final reward, and get the item to give to the next npc to continue the main quest of our server.

Adrianne
06-21-2006, 01:23 AM
Any clue? Im still totally boggled with this, and this is the main thing holding me back atm. Any help would be appreciated.

Cripp
06-21-2006, 05:06 AM
can you repost what you have currently and ill take a look. too lazy to read all the other posts ;-)

Belfedia
06-21-2006, 10:11 AM
can you repost what you have currently and ill take a look. too lazy to read all the other posts ;-)

O...M...G... lol

Adrianne
06-22-2006, 08:05 AM
sub EVENT_SAY
{
if ($text=~/hail/i && $zavious == 1)
{
$zavious = undef;
quest::say("Have you retrieved the four books that the Ambassador requested
from Crushbone?");
}
if ($text=~/hail/i && $zavious == 2)
{
$zavious = undef;
quest::say("Are you [willing] to perform another task for the council?");
}
if ($text=~/hail/i && $zavious == 3)
{
$zavious = undef;
quest::say("Have you discovered what else the orcs are doing in Crushbone?");
}
if ($text=~/hail/i && $zavious == 4)
{
$zavious = undef;
quest::say("Good luck on your journey $name. May the Five light your path.");
}
if ($text=~/willing/i && $zavious == 2)
{
$zavious = undef;
quest::say("Good, then you shall set off immediately to Crushbone. Some of
the adventurers that returned reported seeing a log cabin holding someone of
importance. We wish you to seek this person out and discover what else the
Orcs are doing. #summonitem 69977");
quest::setglobal("zavious",3,0,"M2");
$zavious = undef;
}
if ($zavious == 0)
{
$zavious = undef;
if ($text=~/Hail/i)
{
quest::say("Hello $name. I have been expecting you. Ambassador Dumont told
me you would be arriving shortly. Do you have the four books that the
Ambassador told you to retrieve from Crushbone? If so, hand them to me.
#summonitem 51510");
quest::setglobal("zavious",1,0,"M2");
$zavious = undef;
}
}
}


sub EVENT_ITEM
{
if (plugin::check_handin(\%itemcount, 51510 => 4) && $zavious == 1)
{
$zavious = undef;
quest::say("Ahhh you have returned with the books. You say the humanoids call
themselves Orcs? Hmmm.. Interesting.. The council will study these books to
decipher what is written within them. Ambassador Dumont thanks you as do I,
brave $race. If your still [willing] they have another task for you.");
quest::setglobal("zavious",2,0,"M2");
$zavious = undef;
}
elsif (plugin::check_handin(\%itemcount, 69977 => 1) && $zavious == 3)
{
$zavious = undef;
quest::say("What is this $name? It appears to be some kind of battleplan. Is
that Felwithe?! This truly is an amazing discovery my friend. Take this to
Councillor Elandilira. I think she may like to hear of this discovery. It is
a quick translation of the battleplans.");
quest::summonitem(1004);
quest::setglobal("zavious",4,0,"M2");
$zavious = undef;
}
else
{
(plugin::return_items(\%itemcount));
quest::say("This isn't what I'm looking for.");
}
}
}


if ($zavious == 0)
{
$zavious = undef;
if ($text=~/Hail/i)
{
quest::say("Hello $name. I have been expecting you. Ambassador Dumont told
me you would be arriving shortly. Do you have the four books that the
Ambassador told you to retrieve from Crushbone? If so, hand them to me.
#summonitem 51510");
quest::setglobal("zavious",1,0,"M2");
$zavious = undef;


basically $zavious doesnt exist before this. #summonitem 51510 is just temperary so the tester knows what items to summon to test it. The "if ($zavious == 0)" is the first variable. Then global sets this to 1, so now, it no longer gives this message when you hail. it gives: {
if ($text=~/hail/i && $zavious == 1)
{
$zavious = undef;
quest::say("Have you retrieved the four books that the Ambassador requested
from Crushbone?");


Up to this point, the script works correctly as far as I know, now.. Heres the part that seems broken. I try to update the variable $zavious in the database to 2.. and it doesnt want to update.. Ive tried everything known to me:P heres the part:


{
if (plugin::check_handin(\%itemcount, 51510 => 4) && $zavious == 1)
{
$zavious = undef;
quest::say("Ahhh you have returned with the books. You say the humanoids call
themselves Orcs? Hmmm.. Interesting.. The council will study these books to
decipher what is written within them. Ambassador Dumont thanks you as do I,
brave $race. If your still [willing] they have another task for you.");
quest::setglobal("zavious",2,0,"M2");
$zavious = undef;


after the turn in of the 4 items with the item number of 51510, and $zavious == 1.. which it does, it works, because variable is 1. you now have the option to say [willing] since $zavious == 2.

if ($text=~/hail/i && $zavious == 2)
{
$zavious = undef;
quest::say("Are you [willing] to perform another task for the council?");
}


well your supposed to... but for the life of me, zavious, in mysql.. I use navicat to check, will not update... it will go from 0 to 1, where 0 is when the variable doesnt exist.. so basically it will create a 1 in the variable for zavious. quest::setglobal("zavious",2,0,"M2"); doesnt seem to update at all, and $zavious = undef; doesnt work. The variable just is stuck at 1...

If theres a better way of doing this, please tell me. I just need my quest to progress so that people cant do it over and over again, or even repeat previous steps, to prevent wasted time by the player. I would appreciate any examples, or ideas with some kinda examples or fix. Thanks alot guys. I know you guys work hard, but if I can just figure this out, Id be willing to post my finished scripts, because this will help alot of newer people, Im positive:P

Adrianne
06-25-2006, 08:41 PM
sigh.. dont kno what to do.. think Im gonna rewrite everything.

Muuss
06-25-2006, 11:21 PM
2 little suggestions.

Add parenthesis to your tests :


if (plugin::check_handin(\%itemcount, 51510 => 4) && ($zavious == 1))



Second one. This structure :

if (plugin::check_handin(\%itemcount, 51510 => 4) && $zavious == 1) {

} elsif (plugin::check_handin(\%itemcount, 69977 => 1) && $zavious == 3) {

} else {
plugin::return_items(\%itemcount);
}


Will lead to some issues with item turn in and items returned.
The tests with check_handin remove items from the list of handed items if it succeded. In that case, lets say for your first test, if the player gives 4x51510 but $zavious is not set to 1, the test will fail and he WONT get his items back (because check_handin succeded).

2 possibilities :

if (($zavious==1) && plugin::check_handin(\%itemcount, 51510 => 4)) {


or


if ($zavious==1) {
if (plugin::check_handin(\%itemcount, 51510 => 4)) {

}
} elsif ($zavious==3) {
if (plugin::check_handin(\%itemcount, 59977=>1)) {

}
}
plugin::return_items(\%itemcount);


If the tests $zavious==2 stil don't work, you could try with ($zavious eq "2")...

Aramid
08-12-2006, 03:19 PM
sigh.. dont kno what to do.. think Im gonna rewrite everything.

Was wondering if you ever got this working?

I picked up a Gambling Script that used Quest::setglobal and it wouldn't reset them either. I ended up having to delete the global variable and reset them each time along with using ($variable=undef);

Even if you set the Global Variable to last only 3 seconds, I could never change it without deleting it.

It's probably ugly by script writers standards, but it works... :grin:

I'm learning, but what a pain it is when your in the dark. Having to stop the server and restart it in order to change the quest (you DO have to do this, right) takes so much time. Oh well, once I get it under my belt, It won't take so long.

ylosh
08-13-2006, 08:02 AM
don't need to restart the server, #reloadpl in the zone after you've made changes to the .pl file.

Aramid
08-13-2006, 08:22 AM
Thanks ylosh.. I'm printing out the # commands now so I don't make this mistake again.. What a time saver this would have been... lol