PDA

View Full Version : My first .pl


solid11
02-22-2005, 08:10 AM
Starting my questing tradeskill out on something easy, I thought, on a soulbinder in gfay. I used Soulbinder Oakstout. Here is two texts I used off the boards and both brought on a reply to "Hail", but when I said bind my soul, nothing happens on either of the two pl's I tried.

sub EVENT_SAY {
if ($text=~/Hail/i){quest::say("Greetings $name . When a hero of our world is slain. their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity. it is my duty to [bind your soul] to this location if that is your wish."); }
if ($text=~/bind my soul/i)
{
quest::say("Very well. You will return to this spot when you die.");
quest::selfcast(2049); }
}
#END OF FILE ZONE:GFAYDARK NPCID:54179 SOULBINDER_OAKSTOUT

"and the other one"


sub EVENT_SAY
{
if($text=~/Hail/i){quest::say("Greetings $name. When a hero of our world is slain their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity it is my duty to [bind your soul] to this location if that is your wish.");}
if($text=~/bind my soul/i)
{
quest::say("Binding your soul. You will return here when you die.");
quest::castspell($userid,2049);
}
}

Notice I tried both ways to cast and it didnt work.
Thanks.

RangerDown
02-22-2005, 08:46 AM
Does he say anything in response to [bind my soul]?

Cisyouc
02-22-2005, 09:01 AM
Try if($text=~/bind/i) for the second if in the EVENT_SAY.

solid11
02-22-2005, 09:14 AM
doesn't say anything to bind my soul, just looks at me.

Cisyouc
02-22-2005, 09:46 AM
doesn't say anything to bind my soul, just looks at me.Even after doing my suggestion?

RangerDown
02-22-2005, 09:48 AM
When you change the text to read as Cisyouc says, don't forget to reboot your server entirely to make sure your change takes. The server tends to cache perl files it's already ran once.

solid11
02-22-2005, 02:39 PM
Well the fix Cisyouc suggested worked, but I don't even have to say anything to get bound. When I hail him he just jumps to next line of text and auto binds me. Guess that would be ok, but wonder why he binds automatically?

Also, if I have a default.pl in the /quests folder he soulbinder won't respond to hails. I have to remove default.pl before the soulbinder will work. I have file labeled as Soulbinder_Oakstout.pl, which is what it was named as when I downloaded the quest pack. Just wish the default.pl could stay in the quest folder for all the other npcs.

BTW here is default.pl.......

sub EVENT_SAY
{
if($text=~/Hail/i)
{quest::say("Hello $name");}
}

sub EVENT_DEATH{
quest::me("falls to the ground.");
}

sub EVENT_ATTACK{
quest::me("charges at $name ready to attack.");
}

----------------------------------------------
and here is the soulbinder pl after cisyouc's suggested fix.....

sub EVENT_SAY {
if ($text=~/Hail/i){quest::say("Greetings $name . When a hero of our world is slain. their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity. it is my duty to [bind your soul] to this location if that is your wish."); }
if($text=~/bind/i)
{
quest::say("Very well. You will return to this spot when you die.");
quest::selfcast(2049); }
}
#END OF FILE ZONE:GFAYDARK NPCID:54179 SOULBINDER_OAKSTOUT

mattmeck
02-22-2005, 02:45 PM
the NPC says "bind" and you have that for the second trigger so the NPC triggers it and the second line happens,

Yeasy fix have the NPC ask if they want there soul bound, then have that trigger as Yes, that way the yes isnt part of the text and he wont trigger it.

Cisyouc
02-22-2005, 04:51 PM
the NPC says "bind" and you have that for the second trigger so the NPC triggers it and the second line happens,

Yeasy fix have the NPC ask if they want there soul bound, then have that trigger as Yes, that way the yes isnt part of the text and he wont trigger it.Nice catch, Mattmeck. It wouldve taken me a while to realize that. Yes that is the problem. Make it so on hail the NPC doesnt say the word 'bind' or make the response to get bound something else, like 'yes'.

RangerDown
02-22-2005, 05:34 PM
That or use elsif to process the Bind line.

Cisyouc
02-22-2005, 05:43 PM
I dont think elsif would help here....

solid11
02-23-2005, 02:32 AM
So just change-

if($text=~/bind/i)

TO
if($text=~/yes/i)

?

Cisyouc
02-23-2005, 03:18 AM
yes. And people will have to reply 'yes' to get bound.

knightz
02-24-2005, 12:23 PM
Actually the reason hes doing both is because HAIL, SoulBINDer blah...

both hail and bind are in the test the players send the NPC.

So, elsif would fix it.

RangerDown
02-24-2005, 03:43 PM
That's the reason on eqlive you have to say the phrase "bind my soul". But Perl will misinterpret it if you just try to put the phrase in there with spaces.

Try to put backslashes in front of the spaces in the regex.

if($text=~/bind\ my\ soul/i)

Richardo
02-25-2005, 12:21 PM
This should work for you... It works for me perfectly...

sub EVENT_SAY {
if ($text=~/Hail/i)
{
quest::say("Greetings $name. When a hero of our world is
slain, their soul returns to the place it was last bound and the body is
reincarnated. As a member of the Order of Eternity, it is my duty to
to this location if that is your wish.");
}
if ($text=~/bind my soul/i)
{
quest::say("Very well, you will return to this spot when you die.");
quest::selfcast(2049);
}
}


[b]Ok now lets look over your quests...

sub EVENT_SAY {
if ($text=~/Hail/i){quest::say("Greetings $name . When a hero of our world is slain. their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity. it is my duty to to this location if that is your wish."); }
if ($text=~/bind my soul/i)
{
quest::say("Very well. You will return to this spot when you die.");
quest::selfcast(2049);}
}

[b]Its always best to clean up your quests and make sure all of the brackets ect are not so bunched up, like I marked in red, above... Although I am not sure why yours does not work, all I did was clean up how close everything was and it fixed...

"and the other one"


sub EVENT_SAY
{
if($text=~/Hail/i){quest::say("Greetings $name. When a hero of our world is slain their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity it is my duty to [bind your soul] to this location if that is your wish.");}
if($text=~/bind my soul/i)
{
quest::say("Binding your soul. You will return here when you die.");
quest::castspell($userid,2049);##quest::selfcast(i d); is all you need...
}
}

solid11
02-25-2005, 02:50 PM
Lexen, I copied your to the "T", making sure space were and were not where they were suppose to be. It doesn't work. Also, when I log in hail him he won't say anything until I #reloadpl on him. Then he just says the first line of text, but won't do anything when I say bind my soul. Only fix that REMOTELY works so far is Cisyouc's version and that one automatically binds me as soon as I first hail him, but I still have to #reloadpl first for him to say anything at all. This is Cisyouc's version again, maybe you all know why his works, somewhat, and the others don't, and why I have to do the #reloadpl command each time I log in. Is it because the server is technically down and your booting up the quests on the server when you bring it up? thats the only thing I can think of since Sony's servers are up all the time and they probably boot up all the quests when they bring it up from a patch. Grabbin at straws here, hehe.

sub EVENT_SAY {
if ($text=~/Hail/i){quest::say("Greetings $name . When a hero of our world is slain. their soul returns to the place it was last bound and the body is reincarnated. As a member of the Order of Eternity. it is my duty to [bind your soul] to this location if that is your wish."); }
if($text=~/bind/i)
{
quest::say("Very well. You will return to this spot when you die.");
quest::selfcast(2049); }
}

BTW, you asked why it seems they are bunched up and that's the way they came when I downloaded the PEQ quest pack. But the one above is exactly how I have it in the file and it will bind me, but without a request too. thanks.

farce
02-26-2005, 03:02 PM
*if* npc text is triggering EVENT_SAYs, that sounds like a bug.

however, I dont remember that happening back when I was quest writing... so it's prolly just a fubar script.

Also, I notice that you have periods for commas in your script solid11... I found the fix for that bug a long time ago in case you didn't know =)

RangerDown
02-26-2005, 08:45 PM
NPC's do trigger other NPC's say events on EQLive. Usually scripted to make the NPC's appear to be arguing with each other.

That said, I don't think the say events in the EQEmu quest system are intended to respond to NPC says, at least not at this time. It's worth asking at this point, did you get your copy of perl recently? And from an official download source?

solid11
02-27-2005, 03:35 AM
I got perl 5.8.2 MSWIN 32 from the link in Malignus' tutorial. Also using the PEQ quest pack, but don't think that matters. I read you need to label pl files with ID of npc. All the pl's in quest pack are labeled with npc's names, and broke down by zone like quests\gfaydark\soulbinder_oakstout.pl
Does that matter? I only checked a couple of quests and they seem to work this way. Just thought you had to have IDs, or is that the old perl system?

RangerDown
02-27-2005, 04:29 AM
As of a recent change the files can be named either by NPC ID or name. Be aware that unless there's been a very recent change to fix this, a quest file by name won't work for an npc that begins with #, and Verant had a thing for putting important quest/encounter mobs as #theirname.

You may have either a corrupt or old Perl installation, or using old server code, as that really is the only explanation for the same quest working on other servers but not you.

solid11
02-27-2005, 09:20 AM
So what is a current perl program? Is Malignus' tutorial link out of date? It was a pain to get it installed just for the fact of the IO scalar issue, but I did get rid of the errors. If everything works besides soulbinder, I'll just stick with the auto bind quest that does work for now I guess, but I would like to know about current perl.

RangerDown
02-27-2005, 10:13 AM
Since perl can be a pain installing sometimes, the soulbinder quest alone isn't worth upgrading over. I haven't seen Malignus's tutorial, but if it is linking to a specific perl version instead of just pointing you to the perl site and letting you get whatever's latest, then you run the risk of perl being out of date.

solid11
02-27-2005, 11:18 AM
There is a newer version on the activestate website which I just DL'd but will the PEQ quests work if i upgrade?

Richardo
03-01-2005, 03:18 PM
Hey man, I know for a fact this quest works. Get newest source of 6.0 if your quests arn't working. Works perfect for me....

solid11
03-01-2005, 05:46 PM
I DL'd the 6.0 from the link in malignus' setup tutorial for perl. Is there a site for a more up to date 6.0? His is a auto DL so I don't know what site it's from. Not sure how old it is.