Log in

View Full Version : New NPC and *.pl file


chrismed0
02-04-2011, 01:01 PM
Been doing good learning how to create NPC and setting up perl script for them. Started with Translocators first after messing with the boats and finding out they are really hard to get working correctly .. so instead of messing with it I decided to make sure there were NPCs that would take care of the problem.

Was running through the Planes (looking for problems) and ran into one in PoV.
Seems after talking to Paralin Notion your suppose to go to immediately to Master Sergeant Aaramis Daryln and tell him you will aid his cause and ask about
Aerin'Dar. Prob was I got to the point you ask about Aerin'Dar but when I asked what (or who) was Aerin'Dar he wouldn't respond. I even looked at the script to see what the proper response would be. Bug? anyway .. after messing with his for a bit it locked up on me.. now the only thing I can get any of them to say is "not right now soldier!" I even went to ZAM and read through the quest with no real answers to these puzzling problems. anyone have an answer for this?

Well after messing with that and combing the forums I found someone had come up with a solution. Make a clicky thing outside to teleport in (which haven't figured out how to do that) or an NPC when you speak to them teleports you in. Since I have successfuly made several NPCs to translocate people to different places I opted for the NPC. BUT after doing basically the same thing I did to make the Translocators ... the NPC won't speak when hailed.. I'll list my steps and see if anyone can find out maybe what I have done wrong (and as a guide for others) UNLESS someone can tell me if there is a prob/bug/fix for PoV.

To Create the NPC I used:
#spawn [name] [race] [material] [hp] [gender] [class] (etc...)

Then:
#npcspawn create .... to add NPC to database

Then:
#repop... to refresh the zone (#spawnfix won't work until I did this step)

Then:
stood were I wanted my NPC and the direction I wanted the NPC to face and used the ......#spawnfix command... NPC despawned and said it had been updated.

Then:
#repop ... to refresh were the NPC's location

I wrote the *.pl file with the exact name of the NPC (Guardian_Kendricks.pl) and placed it in the povalor folder under the quest directory (like your suppose to.. make npc file .. put in directory under quest for zone your NPC is in)..

Then:
#reloadedpl

Then:
#repop .. to refresh everything

and nothing happened :x (these steps worked with my other NPCs with no probs)

Played with this part for a while and STILL nothing.. tried even using the NPCs ID # which your suppose to be able to do.. tried a few other directories as well that I thought might work under Quests including the root for quests.. still nothing :x

Checked the script for mistakes/played with it as well and did alot of reading and compared it to a lot of other scripts including the translocators I made and can't see any problems with it:



sub EVENT_SAY {
if ($text=~/Hail/i){
quest::say("Hello young heroes. I have waited a long time for adventures such as yourselves to come to this place.I was put here just to monitor the crystal dragon and to try to keep it at bay in this fortress we have built around it. Aerin'Dar MUST be stopped. The magic that gave me the strength to to uphold my duties is slowly fading. If you are powerfull enough... enter and stop her! You need but to tell me when your [ready] me to be transported in.");
}
if($text=~/ready/i){
quest::movepc(208, 362,2044,162);
}



I was going to use the:
quest::movegrp

But I can't get the script to even work. Don't know why either.. until now, all my others have worked.

I even played with things like the NPC config in the database.. changed race, size, gender (lol) nothing seems to help.

Yes even restarted my server.. still no responces.. even went as far as start from scratch a few times.. still nothing.. PoV is starting to annoy me some hehe

nilbog
02-04-2011, 01:24 PM
You didn't close your brackets. The one in red is missing.

sub EVENT_SAY {
if ($text=~/Hail/i){
quest::say("Hello young heroes. I have waited a long time for adventures such as yourselves to come to this place.I was put here just to monitor the crystal dragon and to try to keep it at bay in this fortress we have built around it. Aerin'Dar MUST be stopped. The magic that gave me the strength to to uphold my duties is slowly fading. If you are powerfull enough... enter and stop her! You need but to tell me when your [ready] me to be transported in.");
}
if($text=~/ready/i){
quest::movepc(208, 362,2044,162);
}
}

It closes the bracket you opened in sub EVENT_SAY {

chrismed0
02-04-2011, 02:25 PM
Wow.. talk about a DOH moment!

With all the HOURS of looking, coping pasting from other scripts and just not noticing it.....

I finaly got tired and gave up .. couldn't see strait ROFL!

I looked at my other scripts.. and sure enough.. I see how I was missing it though..

I did my other scripts like this:


sub EVENT_SAY {
if ($text=~/Hail/i){quest::say("Ug... Hello ittle on. I here to help. I know little magic. I send you to [ButcherBlock], [Oasis], [Overthere] ort [Firiona Vie] if need. I be careful over Firiona tho. They ont like some us");
}
if($text=~/Oasis/i){quest::movepc(37, -839,884,0); }
if($text=~/ButcherBlock/i){quest::movepc(68, 2889,646,10);}
if($text=~/Overthere/i){quest::movepc(93, 2733,3425,-158); }
if($text=~/Firiona Vie/i){quest::movepc(84, 1402,-4275,-103); }
}


I was putting the bracket after each statement so not to miss it....
on the new script.. I didn't do it though so I ...*cough* missed it.

Still... not bad for a beginner that has never written scripts .. ever..

It is all pritty simple.. but realy easy to miss the small things.

THANKS ALOT!... nilbog =)