coming soon
Scorpious2k and I worked this out. It's a brand new extension to the quest system that is going to expand the what can be done in quests and in interracting with mobs. It works in both perl and old quest format. It is in use now on the Scorpious2k server and will be in CVS soon, if it isn't already.
I am going to break this into several parts to try to explain global variables. What this does is give mobs the ability to "remember" events. Sort of like making a sticky note for future events or sending instant messages to other mobs. It allows the quest writer to save variables for use in future quests. It gives a lot of flexibility. You will also have to make some changes to the database with the quest_globals.sql. Here is how to use it.. It uses 3 commands: setglogal, targlobal and delglobal. ========== Setglobal: ========== [old quest format] setglobal([varname],[value],[options],[duration]); [perl format] 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. ========== targlobal: ========== [old quest format] targlobal([varname],[value],[duration],[npcid],[charid],[zoneid]); [perl format] quest::targlobal([varname],[value],[duration],[npcid],[charid],[zoneid]); This is a way to "stick" a global variable to a mob. A quick and easy way to give information to a mob or communicate. ========== delglobal: ========== [old quest format] delglobal([varname]); [perl format] quest::delglobal([varname]); This command is used to delete global variables when they are no longer needed. You can only delete global variables that belong to the mob the variable is for. =================== Command Parameters: =================== [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. [value] this is what the variable will contain when the quest script begins. [options] value determines the availability of global variables to NPCs when a quest begins Code:
+--------+---------+---------+----------+ [duration] the amount of time this variable will be available. After this time, the variable goes away! It is a number preceeded by a letter, where the letter can be: Code:
+--------+----------+------------------------------------------------+ [charid] the character id from the character_ table for the targetted player [zoneid] the NUMBER of the zone where the targetted npc is located In my next message I will give an example. |
sounds very interesting can't wait until you realease more...
|
if i get it well, to have a npc remember the last time a char was met, forgetting after 7 days :
quest::targlobal("last_met",getDate(),"D7",$mobid, $user,$zoneln); then maybee (this is just an idea, not tested): Code:
sub EVENT_SAY{ Well, asking for an addition on a not yet released new feature ... Please forgive me in advance, it would be SOOOO nice. Anyway, what you are bringin' in is great ! |
This is a 2 part quest. It really is more of a fun thing, but you'll see. It's in perl, because that is what we use on the Scorpious2k server.
It involves two begger type NPCs. One in oasis and one in qeynos2. We call it the "begger-prince quest". Here is the quest file for the one in oasis: Code:
sub EVENT_SAY The targlobal function is used to stick the $beggerprince variable with a value of "2" onto the npc in qeynos2. In a way, this npc has sent an instant message to the one in qeynos2, letting him know this player has killed him! There is a new variable called $charid. This is the id number of this character in the database. You have to use this and not $userid in the targlobal command. They are not the same thing. Here is the quest file for the NPC in qeynos2... Code:
sub EVENT_SAY IF you killed the NPC in oasis, $beggerprince=="2" and he will attack you if you speak to him or try to give him an item. If you kill him in that battle he will shout "My brother! I have failed you!!!!!!". IF you didn't kill the npc in oasis yet, he will beg. Its a good idea to be generous. As you can see, he will explain he is in fact a prince and not a begger. He returns 100X the money you gave him. He returns the items you gave him and gives you 1000 X the number of items worth of expirience. $beggerprince is set to "1". This is some of the fun. So, thinks the newbie, I get 100X my money back... I'm going to cash in on this! Bzzzzzzz! Wrong Mr Newbie. He remembers you. Next time you give him something, he thanks you and KEEPS IT. :-) There are some other little things that I am sure you can see here. But that pretty much shows an idea of what you can do. |
Quote:
|
Very cool! Keep up the good work you guys.
|
Winners are grinners 8]
|
I hope I don't seem like the ulitmate noob by asking this, but this update avail. in CVS - this only applies if you're using the dev version and can compile it if you have VS 6, correct? I'm only using the precompiled binary version of 5.3DR2 since I'm not one with the VS force...
|
Its in CVS - see Tertiary's post about compiling with Dev-C++
|
There is a misfit around the delglobal and time out global deletion (0.5.3dr+). I would be too affirmative but at first glance :
The database can be updated, but, well, the variable remains set in the package (read : npc quest variable scope) unless it is reset by a new value. You can change target, zone out and back, ... does not matter. The only way to get it removed is to have it set to another value. Otherwise, once it's set, it's set until zone reboots. Maybe forcing mob despawn/respawn would work, not sure so far. I though of a few things to get rid of this, but there are issues : - in delglobal, you know that you want to delete a value, so you can set it (or rather unset it) in all packages (read : npcs) where it might have been set. The 'might have been' part is not easy, so better unset it everywhere. - in timeout, we must use 2 queries, one for fetching what is obsolete, the other to delete it (with a few additioanal requirements i won't discuss yet). Then clean up packages as previously detailled for delglobal. I'm not too much at ease with embperl's code to suggest a software fix, so when using a global so far, don't rely on default value. - a global must be set to "<none>", "__absent__" or whatever you want set it rather than delete the record. - you can't count on timeout to unset a variable. Explicitly unset it to a new value after triggering a timer. - alternativly, you can explicitly unset it at the end of your event handler. But there might be issues on this too. It'd be nice if someone can post an opinion or a fix :wink: . P.S. the overall targlobal / setglobal behavior is fully satisfacting imho atm, so hope we wont have to alter it. |
Quote:
Let's say I have added a quest that has the character find a simple flower (that is harder to find that one might think). The reward is faction, and a very nice exp hit... Well, one would think that this quest is NOT reusable because it would be too easy to get major exp from this quest.. BUT, if there were a forget_timer for this npc then you could do this quest again in say 5 or 6 days... Or maybe even use a different quest for the same npc, but only be able to do SO many quests of this NPC per so often... Sorry I'm not too clear about my thoughts, but it is 5:30 am here and have NOT been to bed yet haha... But, I think you get the picture... This whole Idea of an AI-ish nature ipens up a whole new realm of possiblilites for questing... Take AC2 for instance. I recently joined the free 10 day trial thing, and got to lvl 23 with my char (out of 45) doing mainly quests, and solo to boot.. First, let me say that the quests that I encountered up to my current level are OUTSTANDINGLY fun whether you are with a group or not. Secondly, This KIND of questing (that would be possible, or at least similar with this new system in place) would allow more solo-ability on a legit server (which is a very good thing since server capacity is at a premium on most servers). I may have grouped once in the entire trek to lvl 23 (which is NOT to say I am antisocial, but just felt like trying to play solo since people claimed that you CAN play solo). It takes some of the "Nothing but hack-n-slash" part out of EQ (which, sad to say is the major part of EQ these days, besides item hoarding).... And puts the word adventuring back into EQ, where it once was.... It would also allow for more diverse types of classes to reimerge, such as the wizard, and mage, who have a very hard time surviving in this day and age, where everything is based on how hard your sword hits and so on.. You get the idea... I dont know, let me submit this post, and get some rest.. I will come back tomorrow and see if I myself agree or can understand what I have written here, as I am too damn tired to even proof-read this post (heaven forbit haha)... |
Quote:
Quote:
Quote:
I'm afraid the mistfit i mentionned in the previous post puts them back for a while. /cry |
Yeah, but I am excited about the outcome when the great minds come up with a solution...:)
|
Quote:
Code:
sub EVENT_SAY { Code:
if($text=~/i am new to the hall/i) { Code:
if($text=~/yes/i) { Mayhap I am concentrating on the wrong thing here, but I would think that with that particular instance, you would not want anything other than what you have... If you made it a boolean, where false = 0, and true is anything else, then you could type ANYTHING in there to activate the next part of the quest. Therefore it would HAVE to be a static string... Of course you could always add $text strings so that the user can type it a few different ways (read have a few different responses the NPC would accept). Obviously we know that the =~ tells us that we can type "yes", or "Yes", or any variation thereof, as long as the 3 letters "y", "e", and "s" are represented. Your thoughts? Opinions? Likes? dislikes? Favorite color? P.S. Just threw in that last one to see if you were ACTUALLY paying attention what with that long winded book of mine.. :) [edit] Quote:
Quote:
|
Quote:
To put it in other ways : you never get any answer in a quest to something like 'Yes.'. It wouldn't make sense. The NPC just could not find out what you say yes to. The best answer you could get is '`Yes` what ?'. Thus, in every quest, you have to re-type more or less what the NPC said. What i was thinking of is keeping track of the context (i.e. the current subject being discussed) so that : 'yes' means 'I am a young paladin of Brell' in that context, but 'yes' would mean 'I'm thirsty' after the NPC had said 'Are you thirsty ?', and have the NPC answer '`Yes` what ?' when you answer 'yes' after 'where do you come from ?' 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 would'nt start a long discussion in this thread, but i'm planning to post on this subject whenever i'm done with the plugins stuff. |
All times are GMT -4. The time now is 08:36 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.