server first announcements thru quest system
i'm trying to set up so that when a player hits max level on your server, and they are the first to do so, it does a server wide announcement of it.
heres what i've got so far. i have it placed in quests/templates/player.pl, but I can't get it to work for some reason. can some one take a look at it, and tell me whats wrong pls? Code:
sub EVENT_LEVEL_UP { |
for starters, you need one more } at the very end
|
just curious, sorry if this seems ignorant, but why do I need one more }? accordin to notepad++ the sub is closed, and every if statement is closed as well.
|
Instead of copy pasting the code 15 times, you could do something like this:
Code:
sub EVENT_LEVEL_UP { If that ever occurs, I wrote a reporter NPC too, $qglobals are a little weird scope wise, NPC's don't load no NPC ID vars (aka Player vars). I may ask the coders to add a $pglobal that when you talk to a NPC, it loads non-NPC ID globals for the zone are loaded into $pglobal{}. Would be handy for this situation, and I can think of a few others. This code doesn't work, but I wrote it anyways if the theory of player global vars non-NPC specific ever get written in. Code:
sub EVENT_SAY |
Quote:
|
It should. There may be an issue with scripts in the zone folder conflicting with the templates folder, just for testing try to put the player.pl inside the zone you're inside, and #reloadpl
|
Some quest coder should help me out here.. I'm not very familiar with it. :/ but!
LoadPlayerScript() function in embparser.cpp it does this whole.. Code:
string filename= "quests/"; Code:
try { Code:
if(!isloaded(packagename.c_str())) |
did as suggested, tried it with the guild lobby, cut/paste the player.pl and #reloadpl, and worked. cut/paste back into templates folder, #reloadpl, doesn't work. now what I don't understand is there isn't anything in the guild lobby folder, cept the guildhall instance creation script, so i'm not seeing what would be conflicting with the EVENT_LEVEL_UP. btw is there a way to broadcast, instead of having "$name shouts, blah blah blah". was looking more for a system msg world wide, then having the player shout it world wide.
|
Try $client->Message(13, "Message here");
|
I really hate that 5 minute edit limit. So new post!
I'm working on a quest cheat sheet wiki. Not newb friendly, but a good quick reference is my objective. This link should go to the $client->function() section, the message one and show the different color types noted in source. |
does $client->Message() broadcast worldwide, or just to the client that triggered the event?
|
Yes, it will try to load the player.pl from the zone folder and if not there, it will load it from templates if one exists there. It would be nice if both could load and run simultaneously so you could have global stuff for player.pl as well as zone specific stuff.
I believe that for any scripts located in the templates folder, the server has to be restarted for them to take effect. Not 100% sure on that, but I think that was the conclusion I came to last time I tried playing around with it. Also, some notes on your compilation of quest wiki pages: EVENT_ENTER and EVENT_EXIT are both related to proximities, so they don't work from the player.pl. They are triggered when the client enters or exists a proximity around an NPC. EVENT_SCALE_CALC is for item quest files, specifically for items with something set in the charmfile field. This event is for setting how much you want an item's stats to scale based on a percentage. Here is an example of a custom quest I made for a custom charm I have on my server: /quests/items/CHRMTitanium.pl Code:
sub EVENT_SCALE_CALC |
Thanks trevius. and @ nightsta, hmm, that's a good question. Pretty sure it's possible, but can't think of a script I can pull up to find the function.
|
Quote:
|
To use the scale event you utilize "quests/items/" folder? Interesting. Wonder how I'll categorize that.
Sorry for derailing topic nightsta. I'm unsure at your answer, we'll see! |
Quote:
|
Couldn't you also take the templates/player.pl file and add conditions in each event on the player's location, and if their location match up paste in the /zone/player.pl code?
:D |
Quote:
|
anyone have a solution for this that doesn't involve copying and pasting into the 20 somethin odd player.pl's in the quest folder? and i'm still wondering what would happen if the source was changed to allow to load both, the player.pl's that are in the zone folders, as well as the templates one.
|
I would think modifying the source to incorporate this is going to be more involved than it'd take for ya to just go into..
acrylia airplane akanon bothunder cabeast cabwest charasis dreadlands erudnext erudnint felwithea felwitheb freporte freportn gfaydark greatdivide grobb halas hatesfury kaladima kaladimb neriakb neriakc nexus northkarana oggok paineel poair poinnovation pojustice potimea potimeb powater qcat qey2hh1 qeynos qeynos2 qrg rathemtn rivervale sharvahl skyfire solrotower templates thurgadinb tox tutorialb unrest veeshan and write conditions checking if the player is in the zone for each event, though it's going to take a while.. I dunno. That is a lot of files, heh. Technically could edit your source to do this non-quest style, but, that's kind of complicated too. As is you're hitting a block with that limitation of player.pl not being ran on templates\ and each zone.. Don't really have an easy solution. It's going to probably be work no matter what. |
ok I know that this might seem kinda stupid. but I took this code
Code:
if(!isloaded(packagename.c_str())) Code:
if(!isloaded(packagename.c_str()) || isloaded(packagename.c_str())) |
To test, have both player.pl files have an enter zone event. Have the templates file do some emote "A" and the zone file do some emote "B" and see if both run. That's the only conflict I could think of.. both files having the same event.
|
k tried using both sub EVENT_LEVEL_UP and it does the level up from the templates, but NOT from the zone file. so i'm assuming you can't have 2 of the same events, or the one from templates will override the other from the zone. but other then that, I didn't find any other issues.
|
Also your code above will always return true.
if(!isloaded(packagename.c_str()) || isloaded(packagename.c_str())) It's like putting if(1), since you're covering the two possible returns of isloaded(), it can either return 1 (which is on the second half) or 0 (which is on the left half). But yeah. If you do what you just did, you essentially screw all zone-based player.pl files if it's only working off templates. I may have to peek and see if I can solve the event handling to execute the two different player files. *shrugs*.. |
Quote:
|
Quote:
quest::we(type, "message"); should work. This is world emote. |
ah there we go, thats what i've been lookin for, thanx alot.
|
Code:
sub EVENT_LEVEL_UP { |
All times are GMT -4. The time now is 01:32 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.