Howto: Perl Quests
Wasn't sure if this was the best forum to put this in or not, but...
Thanks to Rogean graciously allowing me to fiddle with his server this morning, I was able to get the Perl quest stuff working under Linux. The Linux version doesn |
Eglin > All. Works Great! =)
|
Ah, so that was why i was getting the panic !
Good show! Going to sticky this post. Could you go into a little more detail in this thread regarding subdirectories, extensions, etc.. |
Quote:
Perl quests work almost exactly like native quests. I modeled them after the description here, and made changes where I happened to notice that Wes did (ala $itemcount or timer). At any rate, the same directory structure is used, but filenames should end in ".pl". So, if you download the quests linked above, then you should unzip them such that your dir structure looks like ($eqemu_base)/quests/($zonename)/[npcid].qst (all lowercase!!!), then paste the convert script above into ($eqemu_base)/quests/convert.pl, then run ./convert.pl. You should then have a .pl file for each .qst file. I don't think the quest converter works perfectly yet, but I don't think it should be hard to fix it (works for me, but I had differently formatted input quests & I don't remember where I downloaded them). Offering a quest package already in pl format would be cool, espescially since installing perl quests requires a level of trust in the author (security reasons), but I didn't feel comfortable doing so since I do not know who to credit for the original package (which all modern quest distributions obviously derive from). Nonetheless, I am considering making/maintaining a quest/plugin package/repository at some point. Plugins may either be stuffed into ($eqemu_base)/plugin.pl or placed in any file with a .pl extention in ($eqemu_base)/plugins/ When zone starts up, it will compile all the code in plugin.pl and each file in the plugins dir whose filename ends in .pl (IIRC). Any code outside of a subroutine will be discarded (IIRC). All code is compiled into package plugin by default. For some plugin examples, see this thread. Plugins and the #peval command are really really really cool and useful. If you use perl, you should learn them. The key to using them effectively is to learn how embperl stuffs things into packages (plugins are in package plugin, quests are in qst[qst id] (ie qst1234) or qstdefault). Don't worry if you don't understand that last bit - you can still benefit from using perl. hrm... what else should I share? Oh... the vars $1, $1-, etc aren't be used in Perl quests. Instead, look for $text to hold the entire string. So, if ($1- =~= "Hail") becomes if($text=~/Hail/). I _think_ that the convert script will handle this for you, but you should still probably know what's up. Since I can't think of anything else to share without trying to teach Perl, I'll stop. Feel free to ask specific questions, though (in this thread or others). I want to see some cool quests/features, so if you do something neat, need help doing something neat, or just have a tight setup, please post somewhere and tell us about it! |
Oh, yeah.... $(eqemu_basedir)/quests/default.pl gets compiled and applied to any npc who does not have a .pl file of their own.
I used something like the following when I was testing implementing the Perl stuff. Code:
sub EVENT_SAY() { |
Works great so far, I see ALOT of these scrolling though..
[Status] Error exporting var: Perl runtime error: Can't modify concatenation (.) or string in scalar assignment at (eval 8728) line 1, at EOF Looks like it's just catching and throwing... Maybe ought to wrap that one a little better so we can identify the root of the problem, at least identify the source file (no idea how tough that will be since im guessing its just wrapping up the err text from perl.... |
Quote:
Code:
perl->eval(std::string("$").append(pkgprefix).append("::").append(varname).append("=qq(").append(value).append(");").c_str()); Code:
perl->eval(std::string("$").append(pkgprefix).append("::").append(varname).append("=q(").append(value).append(");").c_str()); lol... looking at that and wondering why the hell I didn't just use strstream... that's fugly! cheers |
Running WinXP here, made the change recommended and still getting the message....
|
I've found that once you identify the script with the problem (parse error message on zone bootup usually will tell you which .pl file), and move it out of the way, this spam will stop..
|
Thanks, it was getting on my last nerve and I was close to finding a newbie and pulling a mattmeck on him....
|
ROFL
|
!!! :shock: HEY!!!
See even when i am not around at all for over a week people still take my name in vain :twisted: :twisted: |
Any chance your scripts use waypointing stuff?
std::string temp = "wp."; -> std::string temp = "wp"; oops :) |
Re: Howto: Perl Quests
[quote=Eglin]2) If you can compile but get a panic: top_env error upon execution, then check to make sure you have IO::Scalar installed. This is the confusing bit. For some reason (and I
|
Re: Howto: Perl Quests
Quote:
Since I don't really understand why it is dying in this fashion (and there is scarce documentation avaliable on top_env: panic), I can't say for certain that the error is in the constructor. Nor can I say that it is related to IO::Scalar or any other module. Still, it seems like the best place to start. If you have trouble debugging, you might note that embperl is not dependent upon eqemu - you can write a simple standalone app to test it by including embperl.h and linking against embperl.o and perl58.lib Thank you for posting your perl version. That tells me a lot about your situation right off the bat. If you post another response, though, please be much more specific about your error.... Was it a panic: top_env like the others? At what point did the error occur? What do you get when you type: Code:
perl -MIO::Scalar -e "print 'AOK'" |
All times are GMT -4. The time now is 11:58 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.