Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-02-2004, 05:13 AM
Doodman's Avatar
Doodman
Developer
 
Join Date: Aug 2003
Posts: 246
Default

Quote:
Originally Posted by smogo
It's not the best way to implement such 'conversations', but yet could give the feel of the NPC understanding what you say, instead of of just matching words. Using a global 'conversation_subject' per NPC per player can give a cheap and funny improvement to quests.
I actually think quests should be done that way. It does work to make more natural conversations. Imagine if you talked that way to a buddy of yours:

Jim: Did you see the superbowl?
Joe: Yes I saw the superbowl.
Jim: Did you see that touchdown?
Joe: Yes I saw that touchdown.
Jim: Did you see the extra special half time performance with Janet Jackson and Justin Timberlake?
Joe: Yes I saw the extra special half time performance with Janet Jackson and Justin Timberlake/

No one talks like that.
Reply With Quote
  #2  
Old 03-02-2004, 08:47 AM
smogo
Discordant
 
Join Date: Jan 2004
Location: 47
Posts: 339
Default

@samandhi : sry maybe i went bit fast over the second half of your post .

i agree to say that there are other ways to do it, but still we need timeout, and th targlobal was giving such convenience at low cost. Just write one set/unset after 1mn proc, one with targlobal, the other using timers, they'll be very different .
RED

@Doodman
Nope.
Reply With Quote
  #3  
Old 03-02-2004, 10:58 AM
samandhi's Avatar
samandhi
Demi-God
 
Join Date: Aug 2003
Posts: 1,056
Default

Cool, I understand now what you are meaning.. And this WOULD be a nice thing to have...
__________________

Quote:
Analysis paralysis will keep you from failing, but it will also keep you from succeeding.
  • L.L. CoolJ
Reply With Quote
  #4  
Old 07-22-2004, 06:17 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

When I try and use this in my quests the npc does not revert to default as if there was an error, but whenever I try and trigger the setglobal() or targlobal() it doesnt work, and people in #support have said my quest is correct, so any thoughts?

What happens is if I have,
Code:
#281099.pl
sub EVENT_SAY
{
if($npcvari1 == 0 && $text=~/hail/i)
 {
 quest::say("Hello! Would you be interested in helping me?");
 }
if($npcvari1 == 1 && $text=~/helping/i)
 {
 quest::say("Thanks!");
 quest::targlobal("npcvari1","1","Y5",281099,$charid,26);
 quest::me("You have recieved a character flag!");
 }
}
When this is run, and you /say helping, the only thing that shows is "Thanks!" and on rehail I get the same "0" message, even after #reloadquest, logging, and zoning.

Any thoughts?
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #5  
Old 07-22-2004, 06:52 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default

Quote:
people in #support have said my quest is correct
I would like to know what they smoke ?!~

Try something like this, your syntax is wrong.
Code:
*#281099.pl 
sub EVENT_SAY 
{ 
 if ($text=~/hail/i) 
 { 
  if($npcvari1 == 0) 
  {
   quest::say("Hello! Would you be interested in helping me?"); 
   $npcvari1="0";    } 
  }
 if($text=~/helping/i)
 {
  if($npcvari1 == 1 &&  
  { 
   quest::targlobal("npcvari1","1","Y5",281099,$charid,26);
   quest::say("Thanks!"); 
   quest::me("You have recieved a character flag!");
   $npcvari1="0"; 
  } 
 }
}
You check action done to NPC, then if there is a variable and its value, then you give the action to do.

One important things is to ALWAYS add "quest::targlobal" as the first actions, or you can have bugs.
Also be sure to always perl cache by using command "$npcvari1="0"; ".
*
Hope that will help and GL in dev quests.
__________________

Reply With Quote
  #6  
Old 07-22-2004, 07:41 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Quote:
Originally Posted by KhaN
Quote:
people in #support have said my quest is correct
I would like to know what they smoke ?!~

Try something like this, your syntax is wrong.
Code:
*#281099.pl 
sub EVENT_SAY 
{ 
 if ($text=~/hail/i) 
 { 
  if($npcvari1 == 0) 
  {
   quest::say("Hello! Would you be interested in helping me?"); 
   $npcvari1="0";    } 
  }
 if($text=~/helping/i)
 {
  if($npcvari1 == 1 &&  
  { 
   quest::targlobal("npcvari1","1","Y5",281099,$charid,26);
   quest::say("Thanks!"); 
   quest::me("You have recieved a character flag!");
   $npcvari1="0"; 
  } 
 }
}
You check action done to NPC, then if there is a variable and its value, then you give the action to do.

One important things is to ALWAYS add "quest::targlobal" as the first actions, or you can have bugs.
Also be sure to always perl cache by using command "$npcvari1="0"; ".
*
Hope that will help and GL in dev quests.
No i dont think you understood the quest, after you complete the quest the NPC should just respond with "Thanks for helping!".

and will

$npcvari1="0";

reset the global back to 0? Becuase thats not what I want.

Thanks in advance.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #7  
Old 07-22-2004, 07:43 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Ah, I forgot something. The code above was the syntax I used which they said would work, but they also said to try this. (using $solusek this time for the variable)
Code:
sub EVENT_SAY
{
if($text=~/hail/i)
{
if($solusek == "")
{
quest::say("Hello, would you like to [help] me?");
$solusek="";
}
elsif($solusek=="1")
{
quest::say("Thanks for helping me!");
$solusek="";
}
}
if($text=~/help/i)
{
quest::targlobal("solusek","1","Y5",281099,$charid,26);
quest::me("You have recieved a character flag!");
}
}
But THIS doesnt work either.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #8  
Old 07-22-2004, 04:31 PM
animepimp
Dragon
 
Join Date: Jan 2004
Posts: 860
Default

Quote:
Originally Posted by Cisyouc
Code:
sub EVENT_SAY
{
if($text=~/hail/i)
{
if($solusek == "")
{
quest::say("Hello, would you like to [help] me?");
$solusek="";
}
elsif($solusek=="1")
{
quest::say("Thanks for helping me!");
$solusek="";
}
}
if($text=~/help/i)
{
quest::targlobal("solusek","1","Y5",281099,$charid,26);
quest::me("You have recieved a character flag!");
}
}
But THIS doesnt work either.
If $solusek doesn't exist I don't think ($solusek == "") will ever be true. You should reverse the two and have only an else for the default case. You always want one to happen no matter what so they should not all have conditions. Like this:

Code:
sub EVENT_SAY
{
if($text=~/hail/i)
{
if($solusek=="1")
{
quest::say("Thanks for helping me!");
$solusek="";
}
else
{
quest::say("Hello, would you like to [help] me?");
$solusek="";
}
}
if($text=~/help/i)
{
quest::targlobal("solusek","1","Y5",281099,$charid,26);
quest::me("You have recieved a character flag!");
}
}
That way one or the other always happens when they say hail.
Reply With Quote
  #9  
Old 07-23-2004, 12:08 AM
Charmy
Discordant
 
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
Default

Code:
sub EVENT_SAY 
{ 
if($text=~/hail/i) 
{ 
if($solusek == "") 
{ 
quest::say("Hello, would you like to [help] me?"); 
$solusek=""; 
} 
elsif($solusek=="1") 
{ 
quest::say("Thanks for helping me!"); 
$solusek=""; 
} 
} 
if($text=~/help/i) 
{ 
quest::targlobal("solusek","1","Y5",281099,$charid,26); 
quest::me("You have recieved a character flag!"); 
} 
}
Kk lets start with a few things.

The quest::targlobal command is used to set entries into the sql database, which are then turned into global variables for use in the form $var1, $var2 etc.. however they are not perl global variables.

What this means is, they can't be set as script variables,
Code:
 $var1 = 123
will not work to affect the sql table.

with that lets try to re write the code yes?

Code:
sub EVENT_SAY 
  { 
    if($text=~/hail/i) 
     { 
       if($solusek == "") 
         { 
           quest::say("Hello, would you like to [help] me?"); 
          } 
        elsif($solusek=="1") 
          { 
            quest::say("Thanks for helping me!");  
           } 
         } 
      if($text=~/help/i) 
       { 
         quest::targlobal("solusek","1","Y5",281099,$charid,26); 
         quest::me("You have recieved a character flag!"); 
         } 
        }
Now a few things to look at here, you are trying to set a global variable for a flag, i assume this means you will use this flag with mob number 281099, and i also assume that the script this is put on is infact mob 281099.

now the script above dosen't do what you orignally intended, so lets add the stuff that needs to be added so it will do what you were trying to accomplish.

Code:
sub EVENT_SAY 
  { 
    if($text=~/hail/i) 
     { 
       if($solusek == "") 
         { 
          quest::say("Hello, would you like to [help] me?");   
         } 
        elsif($solusek=="1") 
          { 
            quest::targlobal("solusek","","Y1",281099,$charid,26);
            quest::say("Thanks for helping me!");  
           } 
         } 
      if($text=~/help/i) 
       { 
         quest::targlobal("solusek","1","Y5",281099,$charid,26); 
         quest::me("You have recieved a character flag!"); 
         } 
        }
The Result of this quest wil be.

You say: "Hail Mob 281099."
Mob says: "Hello, would you like to [help] me?"
You say: "I will help you"
You have Recieved a Character Flag!
You say: "Hail Mob 281099"
Mob says: "Thanks for helping me!"
You say: "Hail mob 281099"
Mob says: "Would you like to [help] me?"
You say: "I will help you"
You have Recieved a Character Flag!
You say: "Hail Mob 281099"
Mob says: "Thanks for helping me!"

just a big long loop!!

If you were to start off by just saying
"I will help you"
then hail he would say
"Thanks for helping me!"
if you said
"i will help you"
again, he would say
"Thanks for helping me!"
on the next hail, now you could aviod this by putting in a variable check right after the $text =~/help/i line

Code:
sub EVENT_SAY 
  { 
    if($text=~/hail/i) 
     { 
       if($solusek == "") 
         { 
          quest::say("Hello, would you like to [help] me?");   
         } 
        elsif($solusek=="1") 
          { 
            quest::targlobal("solusek","","Y1",281099,$charid,26);
            quest::say("Thanks for helping me!");  
           } 
         } 
      if($text=~/help/i) 
       { 
         if($solusek != "1")
          {
            quest::targlobal("solusek","1","Y5",281099,$charid,26); 
            quest::me("You have recieved a character flag!"); 
         }
         else # $solusek does = 1
         {
           quest::say("Yes, i know you will help me!");
          } 
        }
       }
Now a little thing i have found about quests, i have run into a problem multiple times that for some odd reason doesn't set the varialbe to the exact $charid. i.e.

"Hail, Mob!"
"Hello Bob, are you [good]?"
"I am good"
"Glad to hear"
"Hail, Mob!"
"Yes i know your good"

Ok so this goes well, however the next person comes up.

"Hail, Mob!"
"Yes i know your good"

Err.. whats going on? Problem with the communication between the qglobal table, and zone.exe. &lt;shrug>

Or!

"Hail Mob"
"Hi Bob, have you got my item?"
You hand in item
Mob sets variable $item to value "2" indicating you have turned int he item.
"Asome! Tell me when you are [ready]"

But before you can say ready, Joe was watching and types
"i am ready"

Now he should get the respond
"Your not ready Joe, i didn't get an item from you"

But instead he gets.
Variable set to "1" indicating you are no longer ready, but it affectrs your variable and not his =/.
"Ok off you go!"

and Bob says "ready" and gets the
"Your not ready Bob, i didn't get an item from you.

erf nother problem.


SO! to avoid this a simple change is made to assigning variables

instead of
Code:
quest::targlobal("Var","1","D1",$mobid,$charid,$zoneid)
you would instead make the value personal.
eg.
Code:
quest::targlobal("Var",$charid + 1,"D1",$mobid,$charid,$zoneid);
This makes sure that Character 1 will have a value of 2, and character 2 will have a value of 3, thus when you check to see if they have the correct value you put.

Code:
If($var == $charid + 1)
 { }
this will make it so that if joe says "ready" and the variable returns 3 becuase hei s charid 2, it will not pass, but when Bob says "ready" it finds th e variable to equal $charid + 1 = 1 +1 = 2, and it works!.

that way you won't run into these types of errors =), and ofcourse you can use any combination with $charid. $charid + 2, $charid + 1423, etc.. it doesn't matter, however it ensures that you don't run into this issue.

Hope this helped =)
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
Reply With Quote
  #10  
Old 07-23-2004, 03:16 AM
animepimp
Dragon
 
Join Date: Jan 2004
Posts: 860
Default

The reason you are seeing it appear for other characters is that you should probably use quest::setglobal([varname],[value],[options],[duration]); instead of targlobal if you want it to be private to that character. Just set the options field to 0 and it will be private to that character. Or use the other options for different combinations:

Code:
+--------+---------+---------+----------+ 
|  value |  npcid  |  player |   zone   | 
+--------+---------+---------+----------+ 
|   0      |  this     |   this    |   this     | 
|   1      |  all       |   this    |   this     | 
|   2      |  this     |   all      |   this     | 
|   3      |  all       |   all      |   this     | 
|   4      |  this     |   this    |   all       | 
|   5      |  all       |   this    |   all       | 
|   6      |  this     |   all      |   all       | 
|   7      |  all       |   all      |   all       | 
+--------+---------+---------+----------+
Reply With Quote
  #11  
Old 07-23-2004, 11:15 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Quote:
Code:
quest::targlobal("Var",$charid + 1,"D1",$mobid,$charid,$zoneid);

This makes sure that Character 1 will have a value of 2, and character 2 will have a value of 3, thus when you check to see if they have the correct value you put.
WOW! I didn't try it yet, but that is very clever Thanks =)
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #12  
Old 07-23-2004, 11:41 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Quote:
Originally Posted by Cisyouc
Quote:
Code:
quest::targlobal("Var",$charid + 1,"D1",$mobid,$charid,$zoneid);

This makes sure that Character 1 will have a value of 2, and character 2 will have a value of 3, thus when you check to see if they have the correct value you put.
WOW! I didn't try it yet, but that is very clever Thanks =)
After looking at it, its still not probably going to work. Well, ill try it anyway. Heres what I have.
Code:
sub EVENT_SAY
 {
if($text=~/hail/i)
  {
   if($solusek == "")
    {
    quest::say("Hello, would you like to [help] me? (NEW)");
    }
    elsif($solusek == $charid + 1)
     {
     quest::say("Thanks for assisting me!");
     }
    }
if($text=~/help/i)
 {
  if($solusek == "")
   {
   quest::targlobal("solusek",$charid + 1,"Y5",$mobid,$charid,$zoneid);
   quest::me("You have recieved a character flag!");
   }
   elsif($solusek == $charid + 1)
    {
    quest::say("You've already assisted me!!");
    }
   }
  }
Update Didnt work!!!
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #13  
Old 07-23-2004, 11:44 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Quote:
Originally Posted by animepimp
The reason you are seeing it appear for other characters is that you should probably use quest::setglobal([varname],[value],[options],[duration]); instead of targlobal if you want it to be private to that character. Just set the options field to 0 and it will be private to that character. Or use the other options for different combinations:

Code:
+--------+---------+---------+----------+ 
|  value |  npcid  |  player |   zone   | 
+--------+---------+---------+----------+ 
|   0      |  this     |   this    |   this     | 
|   1      |  all       |   this    |   this     | 
|   2      |  this     |   all      |   this     | 
|   3      |  all       |   all      |   this     | 
|   4      |  this     |   this    |   all       | 
|   5      |  all       |   this    |   all       | 
|   6      |  this     |   all      |   all       | 
|   7      |  all       |   all      |   all       | 
+--------+---------+---------+----------+
Tried it, and it didnt work.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
Reply

Thread Tools
Display Modes

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 -4. The time now is 11:54 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3