Quest flags for 5.2
If you cannot compile code and cant get quest flags working, you can use this plugin to allow for zone wide flags (the flags should be restored if the client re-enters the zone)
Pugin.pl Code:
sub get_flag { return $flags{$_[0]}; } This will work with any version of EQEmu that has Perl plugins enabled. |
No offense, but this is pointless. The only need for a more formal flag system would be in cases where information needs to be passed back into the underlying game engine (I don't know how planar access works, but I have been working under the understanding that this is exactly what the flags were for). Perl alone is incapable of doing this. You either have to write some code to talk to the db or write some xs.
|
The code already exists and will be out soon in cvs.
http://www.eqemulator.net/forums/viewtopic.php?t=12773 Not only does it replace flags, but it allows for actual values to be passed and not just a true/false boolean values. It also has the advantage of setting the scope of availability to determine which NPCs get it, what zone and what players. Finally, it lets you set the amount of time the variable is available, after which it goes POOF. I am surprised that this hasn't generated more excitement. The possibilities it opens up are incredible. You can now make sure all 4 warders are dead in sleeper before spawning the sleeper. Want to know by whom and when sleeper was killed? Write a global variable. Wandering mobs? This makes it possible for them to know where each other are (variable written at event waypoint). Want a mob to behave a certain way, even in another zone, based on what was done with another npc? Then there are the adventures... you have 30 minutes to start. Guess what? Set the variable to a 30 min duration and if it isn't there they missed the window of opportunity.... And I am working on a little addition which will make it possible, among many other things, for mobs to have a conversation among themselves. |
That sounds cool. While the sleeper thing, the waypoint thing, the conversation thing, et. al. could already be easily done w/ the existing perl quest routines, the ability to transparently store values into the db is very nice.
|
Quote:
This has produced the classic and tiresome quests of taking something to someone, who gives you something else to take to someone else who then gives you something else... and on and on. Why? Because giving the item to the npc causes an event item. The event item can then check the item he has been given and react accordingly. Now its possible to remember what came before. Instead of checking the item given, check the variable saved or sent by another npc. Now, an npc can tell a player to "go talk to Dogmouth", targlobal a value to Dogmouth and when the player gets there, Dogmouth looks at the variable and says "I've been expecting you, Eglin, take these perls [pun intended] to MollyMillions". If the variable isn't there, the player isn't on the quest and Dogmouth can say "Buzz off" As far as the sleeper thing.. the closest I've seen possible is to spawn one at a time. Kill 1, spawn 2, kill 2 spawn 3, kill 3 spawn 4, kill 4 spawn sleeper... Now all four can be spawned in the zone, each checks and updates the global variables they share. The last one to die spawns sleeper. The waypoint and conversation things... I have no clue how you would be able to do. Maybe you could post some examples. Quote:
|
Quote:
-This- is the only exception i make. :D |
Quote:
Now we can do something about it. It's the quest writers and serverops that should be excited. |
i got the latest cvs, the source reflects changes, and should now allow targlobal, ...
i found no sql update in the repository. Should we excpect one, or did i miss something in the posts ? Tark says about quest_globals.sql. |
Should have been included. I'll talk to Shawn.
Here is what it says: Code:
DROP TABLE IF EXISTS quest_globals; |
thx
|
Quote:
Quote:
Quote:
Quote:
|
alright... nobody asked my opinion on the matter, but I just looked at the code for the first time and I have to say that I think it has some issues. The most important is that you're making two database queries EVERY time the event loop runs. This is insanity, man. Think of how often the event loop runs: every time any mob hits a waypoint, every time any mob spawns, every time any mob dies, every time any mob gets hailed, etc etc... This bad boy is getting called _constantly_. Also, consider the size of the table you're creating... it is going to grow _very_ fast. You do _not_ want to search through a table of _every_ variable stored for _every_ character ever created _every_ time the event loop runs. The DB call is going to block the entire thread. You just can't do it willy-nilly. It doesn't make sense.
Choosing to key your data around values that you have to query seperately doesn't make any sense, either. Why would you query for a charid? You have enough data avaliable to generate a unique key, so why tolerate the expense of the charid queries? OK. Sorry for ranting about your work. You actually wrote some code, and I'm pragmatic enough to know that 1 diff is worth 1000 forum posts. OTOH, it is 100% clear to me that caching a global DBI connection for variable storage and only using it when variables actually need to be queried/written is going to be _WAY_ more efficient than making a minimum of 2 queries _EVERY_ single time the event loop runs. |
Quote:
This time pay attention to the fact it will ONLY do it if the NPC has been specifically flagged in the npc_types to use this feature. |
Quote:
|
Quote:
Quote:
Quote:
Quote:
|
Quote:
Quote:
Quote:
Quote:
Quote:
|
Quote:
|
Quote:
I think you are taking this discussion personally. So I will move on to other things. The feature is there to be used. People are free to use it or not. They have the right to make something better to replace it. They even have the right to stand by and do nothing but criticize. |
Quote:
|
Thanks for doing the hard yards Scorp. Its good to see the carrot of server wide smarts, dangled by embedded Perl, being realised.
|
Quote:
|
You guys talkin' a lot ; whatever the issues, hoppefully they will be addressed (is 1 or 2 d's and s's ?)
i've been trying to get this run, and : there might be a thing in the setglobal code, where duration is arglist[3], and referd to as arglist[2]. This causes wrong expiry result Quote:
Code:
if (!database.RunQuery(query, MakeAnyLenString(&query, there might be a thing with the insert, where i get Quote:
third, but not least : next time the event is triggered, the variable is not defined (test with 'if defined $varname' returns false) and quest::say("value of varname is " . $varname); prints "value of varname is :". I'm in the tracing of this at the moment. Could it be $quest::varname, or $questNNNN::varname or even $main::varname or ... ? BTW, when setting a variable, it is not yet available (requires to re-enter the event). Is it possible to modify the setglobal : ** edited ** Code:
"sub setglobal{push(@cmd_queue,{func=>'setglobal',args=>join(',',@_)}); eval "\$".$_[0]."= qw($_[1])";}" |
Quote:
Quote:
Quote:
Code:
quest::setglobal("varname",... Quote:
Code:
quest::setglobal("varname",$varname,... |
at the moment, declaring variables seems to work. But i dont get them in the context when the event is triggered. here is the status of the DB before bootup :
Quote:
There might be an issue with the qglobal member of the Mob class, as the code in parser.cpp / Parser::Event around line 313 is not entered. This member is set asynchrounsly ? Could you tell me what to check ? At the moment, i never get a variable set, nor charid. =( |
Quote:
Quote:
Tark posted the list of options and what they mean in his message "coming soon" where he announced it. Quote:
Quote:
|
you where right about the qglobal flag in the DB, it was clear.
i set it, restarted, but sill it goes wrong. I trace it, and when entering Event() with : Code:
if(npcid==61){ Quote:
Quote:
|
You shut down both te world server and all zone servers before restarting?
*looking at the code now* |
yes, i've been shutting down everything serverside, then start and login again. Takes a while :evil:
|
Quote:
|
thanks for your time, anyway. i hope we can get a solution.
|
You wouldn't happen to be getting this message on world or zone are you?
Quote:
|
i do have this message.
|
Quote:
Some new things were added to the npc_types. The nice devs were good enough to take that into account and have 2 different ways to load the npcs. One of these ways, the old one, doesn't load any of the new things from the DB including qglobals. It seems you may be missing something that was added, Here is what a describe of npc_types should look like: Code:
mysql> describe npc_types; |
yes, i was just checking that. then i sourced invis_update.sql, and well, the Mob::qglobal flag is set.
Yet i get a sig segv fault, but, as i twinked some things in the code, it's not too surprising... reverting to std code, and then 'let you know. |
You might want to get rid of the qglobal column and re-add it. It needs to be the last, just to be safe. Then set the ones you want again.
|
YES ! It works. Changing col order ddin't matter, but i've done it anyway ;).
Thanks for your time :D Now, Let It All Begin ... Tadam !!! |
Quote:
Quote:
Quote:
|
All times are GMT -4. The time now is 06:02 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.