|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |
 |
|
 |

03-24-2008, 04:07 PM
|
Sarnak
|
|
Join Date: Feb 2008
Location: Arizona, USA
Posts: 33
|
|
Confusing stuff on globals..
Ok, I have one section saying you need to access globals via the hash, another that this is possibly deprecated, and yet another insisting you don't need to set the NPC data in the DB for them to use them.. Added a private note on the subject to Caveman, but its been some number of hours, and figured, since I was confused, maybe it was a good idea to ask here too, so someone else looking for it can figure it out. The question is, how do you check on the value of a global, never mind use one correctly.
These are the relevant snips, from one of the NPCs in the quest line for Shar Vahl. While I know that some of the stuff I am doing may not be in live, its easy enough for someone to comment out the say event code for the stuff that isn't. I felt though that there where too many ways you could mess yourself up, from accidentally handing an item to someone that didn't have the return items code on them, to having nice people level you past level 10, then losing your body, with the needed items on it, before you get a chance to do the quest. At least one of the fixmes, for Bindarah is in the live, but missing from PEQ (and obscure enough I include a fix that is more sane).
Anyway. The problem is, from what I understand of the language, it should be working. So, either a) the global isn't being set, b) the globals are not available on these NPCs, or c) I screwed something up.
Here is the code from one of them:
Code:
## Changes by Kagehi.
## $Shar_Vahl_Cit tracks the steps you take to gain your initiate cloak.
## Since we don't want to hand people things that they can't normally get, or
## stuff they haven't earned, we need to track which stage in the quest they
## are at. 1 = Citizen Application. 2 = Cert. of Taxability, 3 = Stamped Cert.,
## 4 = Note to King Raja, 5 Note 'from' the king, 6 = Notarized Application
## and 7 = Initiate's Cloak.
sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("Hail. are you here to assist with something specific or just looking for something to do.");}
##Non-canon, for fixmes if you lose certain items (which are needed for this quest line and others).
##No idea if Live does this now or not. If these do exist there, feel free to adjust it.
if($text=~/application/i && $Shar_Vahl_Cit == 1){
quest::say("Luckily for you someone found it.");
quest::summonitem(2873);}
if($text=~/cloak/i && $Shar_Vahl_Cit == 7){
quest::say("Someone found this under a table at the one of the pubs. Try not to lose it this time.");
quest::summonitem(2878);}
}
sub EVENT_ITEM {
if(plugin::check_handin(\%itemcount,18552 => 1)){
quest::say("Our newest instrumentalist arrives! You have grown strong in the safety of our city and it is time now for you to repay our society. The Jharin. keepers of our history. accept you and deem you to be worthy of our training. Take this application to Registrar Bindarah and return to me with proof of your citizenship.");
quest::say("I know that you may be nervous right now... after all. this should be a very exciting first step for you. If you happen to get lost while looking for the registrar. just ask one of the other citizens or guards for directions. They will most likely know where to find the place or person that you are looking for.");
## We don't care at this point who gives you the application, cloak, etc.
## Only later, when we get into class specific quests will the person you
## come to, in order to recover lost items, matter.
## Using "all npc, this player, and all zones", since some later stuff in
## the class quest lines, linked to the cloak, are in other zones, should we
## use this to track cloak progress as well.
quest::setglobal("Shar_Vahl_Cit",1,5,"F");
quest::summonitem("2873");
}
elsif (plugin::check_handin(\%itemcount, 2897 => 1)) {
quest::say("This item. by itself. means nothing to me.");
quest::say("$name. citizen of Shar Vahl. accept this cloak as a symbol of your loyalty and service to our noble people. It will grow with you. young initiate. and like you it has incredible potential. Present your slate of citizenship to Gherik and he will guide you through your early training. May your songs inspire us all!");
quest::setglobal("Shar_Vahl_Cit",7,5,"F");
quest::summonitem("2878");
} else {
#do all other handins first with plugin, then let it do disciplines
plugin::try_tome_handins(\%itemcount, $class, 'Beastlord');
}
plugin::return_items(\%itemcount);
}
#END of FILE Zone:sharvahl ID:155166 -- Elder_Hymnist_Hortitosh
Relevant bits being ones like:
quest::setglobal("Shar_Vahl_Cit",1,5,"F");
and
if($text=~/application/i && $Shar_Vahl_Cit == 1){
I don't quite see where I messed up, though I do note some cases in other examples where people place extra () around things. In any case, the info on how to use globals isn't quite as clear as it should be imho, about which versions require what, and which things are needed, or not, like telling the DB that the NPC uses them, or not needing to do so. Could be I just badly misread that part.
---
Oh, BTW. As a side note, I presume that the server doesn't yet have something like quest::findnpc(<id>);? Luclin will need this, since one of its features was NPC awareness, where you could ask the guard where to find someone, including some not listed in the normal find, and the guards closest to them could activate a wisp, to lead you there. There doesn't seem to be any way at all to do that right now. :(
Last edited by Kagehi; 03-25-2008 at 12:09 AM..
Reason: Goof in part of the description in the code, trivial, but...
|
 |
|
 |

03-25-2008, 12:45 AM
|
Discordant
|
|
Join Date: May 2004
Posts: 290
|
|
You do have to set a mob's qglobals flag in the DB.
Getting the values from the hash is the more recent method, but both still work AFAIK.
There are a couple different methods in the $entity_list class you can use to look for other NPCs. $entity_list->GetMob("Mob_Name") comes to mind.
|
 |
|
 |

03-25-2008, 07:28 AM
|
Sarnak
|
|
Join Date: Feb 2008
Location: Arizona, USA
Posts: 33
|
|
Ok. Wasn't sure about that. The documentation is mildly confusing about it, as is most docs that are thrown together on a "as needed" basis.
Oh, as for looking for other NPCs. That isn't exactly the problem. What I was asking is if there was any way *currently* to take the location of an NPC and hand it off to the find/track function, so that guards can point the player to where the NPC is. This is quite common in EQ2 obviously, where imho, the pathing system for the tracker is way less sane (how the frell do you follow it through the floor, or through walls, or... well, EQ1 didn't have that problem. lol) However, the first place that **ever** had that feature where those introduced with Luclin. As near as I can tell, there is no command, at least listed on the site, for doing something like:
$trackme = $entity_list->GetMob("Mob_Name")
quest::find($location($trackme))
If there is, the only place it likely exists is in the code for scouts, for the spell to track stuff, presuming they even "get" that ability in EQ1. And, obviously, while you could use code to cast that spell, the result would be temporary, like the spell. What is needed is a way to call on the normal "/find" command, but with a location that is not in the list that the command gives.
For example. Mignah Cahru, who you go to in order to get an acrylia slate is **not** listed in the npcs for "find", nor are many others. However, if you asked the guards closest to the part of the city she was in, they wouldn't tell you, "she is in the bar at...", they would create one of the wispy wiggly phantom lines you follow to those npcs that "are" in the list, as though they where actually "on" it.
Mind you, it was a bit annoying to ask a guard in one part of the city and get, "I have no idea.", then walk across the plaza and get, "follow the wisp."... What? The guards "never" visit any other part of the city??? lol
|
 |
|
 |

03-25-2008, 10:33 AM
|
Sarnak
|
|
Join Date: Feb 2008
Location: Arizona, USA
Posts: 33
|
|
OK. The info I was given here a bit vague. Now I know who is writing the docs on the site.  jk Theeper.
For anyone running a search, since you know, its *helpful* of people can search the forum and get threads that contain clear answers (got to love one case where a quest thread for EQ2 ended with the comment, "Ok, never mind, I figured it out.", and no explanation for what they came up with.) lol
Here is the method to fix the qglobals:
select id from npc_types where name = "Npc_Name";
then
update npc_types set qglobal = 1 where id = <id>;
There, was that so hard to actually say? 
|

03-26-2008, 12:43 AM
|
Discordant
|
|
Join Date: May 2004
Posts: 290
|
|
You didn't ask for the SQL to update the questglobal flag. Considering you thought it might have to be set, I assumed you knew how to do it.
As far as handing locations off to find ... it can't be done, why not just make the NPC findable in the first place ?
Again, I am assuming you know how to do that.
I have no idea what you're talking about with scouts and EQ2 though ..
You don't need to criticize me for not providing you with the exact answer. You need to take some time to understand the way the emu works before you post about certain things it not working properly.
I go by the "teach a man to fish" principle.
|
 |
|
 |

03-26-2008, 06:32 AM
|
Sarnak
|
|
Join Date: Feb 2008
Location: Arizona, USA
Posts: 33
|
|
Quote:
As far as handing locations off to find ... it can't be done, why not just make the NPC findable in the first place ?
|
Because, some people are trying to reproduce the original game, and the original game a) didn't have those NPCs in the find list, and b) did provide, within Luclin, the ability to ask the guards how to find them.
I am not interested in how to cheat it. All I wanted to know is if the feature was *in* the server yet, since its one of the things that needs to be there to make an accurate reproduction of the game (not to mention being a nice thing to have if you planned to design your own stuff).
As for the rest of your comment, OK, sure, I didn't ask for exact information, but the point I was trying to make is that this is a forum other people with questions are going to do a search on to find things. If every answer that gets posted is just, "well you have to set blah...", but with no examples of how to do that, then its not really all that useful to bother searching. And, more to the point, you end up with no posts that clearly explain it, which people can be referred to, and 20 threads, all asking the same questions, because no one bothered to properly explain the other 19 times.
Its nice that you assume I could figure it out. I probably could have, if I wanted to spend that much time looking for an answer. There are any number of other people out there like me though, some of whom know even less, who couldn't, and vague answers don't do anything but overload the forum with messages that don't provide any sort of clear answer. That was the point of my posting the actual SQL. So that the next guy that wants to know can run a search, and find an *actual* example of how to do it, not an explanation that assumes they can or want to figure it out themselves. See what I am saying?
|
 |
|
 |

03-27-2008, 09:43 AM
|
AX Classic Developer
|
|
Join Date: May 2006
Location: filler
Posts: 2,049
|
|
Just a reminder; If you have a problem with somebody here, I'd rather you PM'd me or Matt or a Mod than start with the insults.
Theeper is not only a "taker" but he is a "giver" too, that's why he has ranks. He's already greatly helping you and I out, just by the fixes and help he's given to the project. If Theeper or anyone else that does active work to this project told me anything I didn't like, I would think about what I was going to say, eventually cool down and probably say nothing. I guarantee you I have their backs covered and will not let anyone insult them.
Theeper is trying to send you a message in a nice way: you need to be patient an learn more about what you are doing (like we all did).
End of discussion - this thread is closed.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 02:35 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |