Quote:
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. |
@samandhi : sry maybe i went bit fast over the second half of your post :oops: .
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. :wink: |
Cool, I understand now what you are meaning.. And this WOULD be a nice thing to have...
|
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 Any thoughts? |
Quote:
Try something like this, your syntax is wrong. Code:
*#281099.pl 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. |
Quote:
and will $npcvari1="0"; reset the global back to 0? Becuase thats not what I want. Thanks in advance. |
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 |
Quote:
Code:
sub EVENT_SAY |
Code:
sub EVENT_SAY 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 with that lets try to re write the code yes? Code:
sub EVENT_SAY 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 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 "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. <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) eg. Code:
quest::targlobal("Var",$charid + 1,"D1",$mobid,$charid,$zoneid); Code:
If($var == $charid + 1) 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 =) |
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:
+--------+---------+---------+----------+ |
Quote:
|
Quote:
Code:
sub EVENT_SAY |
Quote:
|
All times are GMT -4. The time now is 06:16 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.