Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 05-28-2019, 09:03 AM
Melandril
Sarnak
 
Join Date: Jun 2003
Posts: 75
Default Adding PL scripts to NPCs

TL;DR;
I read http://www.eqemulator.org/forums/sho...t=pearl+script and 1) #reloadpl was not recognized and 2) no matter if I used an existing NPC (eg #arias in tutorialb) or spawned and created a new npc, the script did not load

longer version
before starting, #arias did not respond to me....which I assumed was quest related...so, I ignored this. Then I thought perhaps #arias was different from "arias", checked the DB on that assumption, and there is only #arias.

either way, I wanted to play with the two most basic scripts I could find: a read-response script and a teleport script (pasted below). I know the coordinates are wrong, but I could not get even the "hail" portion to work, not with a #reloadqst (which did appear to work?) or with a full shutdown and restart of the emu server.

sub EVENT_SAY {
if($text=~/hail/i) {
quest::say("$name, where do you want to go today? I can send you to the [". quest::saylink("temple") . "] ?");
}
else if($text=~/temple/i) {
quest::say("Let me know if this spell works....I just wrote it!");
quest::movepc(729,-55,44,-158.81); # TODO: fix coordinates later
}
}

The script is located in the "\eqemu_server\quests\tutorialb" once each for #arias.pl and the teleporter.pl I added. As for why I thought this should work....it's basically the same functions that came with #arias on a fresh download....which I am sure are working for other people and assumed would work for me.

With all that said, I guess, what I'm trying to ask is, how do I get this script to trigger for either the existing #arias or the new spawn teleporter npcs, given that I think I've placed the script in the right folder? Is there an extra step to attach script to npc spawn or object?

Thank you
Reply With Quote
  #2  
Old 05-28-2019, 09:52 AM
Sturm
Hill Giant
 
Join Date: Dec 2015
Posts: 116
Default

You have a syntax error else if should be elsif in Perl.

Code:
sub EVENT_SAY {
	if($text=~/hail/i) {
		quest::say("$name, where do you want to go today? I can send you to the [". quest::saylink("temple") . "] ?");
	}
	elsif($text=~/temple/i) {
		quest::say("Let me know if this spell works....I just wrote it!");
		quest::movepc(729,-55,44,-158.81); # TODO: fix coordinates later
	}
}
Also ensure the file is named #Arias.pl not #arias.pl - pretty sure their case sensitive.

An easy way to check your syntax is to open a command window then change directory to where your quests are located:

cd C:/EQ_Emu/quests (or whatever your path is to that folder)

then:

perl -c #Arias.pl

That should spit out any error's and tell you what line it's on or near, then you just gotta figure out what's wrong there.

Oh! Right nearly forgot the in-game command is: #reloadquests

Happy Scripting!
__________________
Developer of the Imperium Server.
https://imperium-eq.com/
Reply With Quote
  #3  
Old 05-28-2019, 02:50 PM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,106
Default

Quote:
Originally Posted by Sturm View Post
You have a syntax error else if should be elsif in Perl.

Code:
sub EVENT_SAY {
	if($text=~/hail/i) {
		quest::say("$name, where do you want to go today? I can send you to the [". quest::saylink("temple") . "] ?");
	}
	elsif($text=~/temple/i) {
		quest::say("Let me know if this spell works....I just wrote it!");
		quest::movepc(729,-55,44,-158.81); # TODO: fix coordinates later
	}
}
Also ensure the file is named #Arias.pl not #arias.pl - pretty sure their case sensitive.

An easy way to check your syntax is to open a command window then change directory to where your quests are located:

cd C:/EQ_Emu/quests (or whatever your path is to that folder)

then:

perl -c #Arias.pl

That should spit out any error's and tell you what line it's on or near, then you just gotta figure out what's wrong there.

Oh! Right nearly forgot the in-game command is: #reloadquests

Happy Scripting!
To avoid dealing with the names of NPCs you can alternatively use the NPCID.

Create a text file in each folder where you make scripts to identify 295001.pl = #Arias

As Sturm said, use perl -c 295001.pl to verify syntax is correct.

I prefer the NPCID method because it's common to have multiple npcs with the same name to perform different functions.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #4  
Old 05-28-2019, 05:19 PM
Melandril
Sarnak
 
Join Date: Jun 2003
Posts: 75
Default

you both have my thanks

Now that I have the NPCs responding (and have learned how to check scripts and have learned my JavaScript syntax isn't going to cut with elsif's), I can start the amazing adventure of stealing and tweaking the scripts in the quests forums =)
Reply With Quote
Reply

Tags
dialog, pearl, quest, script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:23 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3