|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days. |

03-31-2004, 07:21 PM
|
Sarnak
|
|
Join Date: Mar 2004
Posts: 65
|
|
Problem removing pvp flags!
Code:
if($1-=~"interested"){say("First i'll add you to the Pvp guild. Then
i'll turn on your pvp flag. If at any point, you wish to return to
non-pvp, you come back here and tell me that you [wish to return]. Now,
lets get started... Do you [want to become pvp]?"); }
if($1-=~"want to become pvp") {say("I'll set your guild");
setguild(3,0);
}{say ("Now i'll set your pvp flag"); pvp(on);
}
{say ("there you go, have fun!"); }
if($1-=~"want to return") {say("so be it, first i'll remove you from
the guild"); setguild(0,0); }
{say ("then i'll remove your precious pvp flag, you may need to zone
once I do, it may say you follow the ways of discord, but just zone and
you'll be fine"); pvp(off); }
}
everything works, but after he says "but just zone and you'll be fine" it does not show nothing about not becomming non pvp. Even when I zone, i'm still pvp. Please help  .
|

04-01-2004, 09:57 AM
|
 |
Dragon
|
|
Join Date: Mar 2003
Location: #loc
Posts: 745
|
|
pvp(off) is broken I think, at least it was a while ago and by the looks of this it still is :P
Ask a Dev.
|
 |
|
 |

04-01-2004, 10:41 AM
|
Demi-God
|
|
Join Date: Mar 2004
Posts: 1,066
|
|
You're closing and reopening braces in what should be the middle of what it executes, and this might be causing it to evaluate the if() part wrong. Below is your code with my comments to show how I predict the system is gonna execute the code (I've broken up the lines differently than what you submitted so you can see my comments more easily):
Quote:
if($1-=~"want to become pvp")
{ say("I'll set your guild");
setguild(3,0);
} # This closing bracket ends what it will execute for the player saying "want to become pvp". Why did you end it here? Shouldn't the other 3 statements below also be a part of this condition?
{ say ("Now i'll set your pvp flag");
pvp(on);
} # Again, why end it here? Shouldn't the next statement below also be a part of this condition?
{say ("there you go, have fun!");
}
elsif($1-=~"want to return")
# Since you ended the if() statement way back up there, and executed more statements
# after the if(){} block, Perl's probly wondering what this elsif goes to.
# THIS is probly the root of your problem.
{say("so be it, first i'll remove you from the guild");
setguild(0,0);
} # Shouldn't be closing the bracket here
{say ("then i'll remove your precious pvp flag, you may need to zone once I do, it may say you follow the ways of discord, but just zone and you'll be fine");
pvp(off);
} # This is the right spot to close the bracket
|
So here's what I propose your code look like:
Quote:
if($1-=~"want to become pvp")
{ say("I'll set your guild");
setguild(3,0); # Notice there's no closing brace here
say ("Now i'll set your pvp flag");
pvp(on);
say ("there you go, have fun!");
} # <--- The if() condition doesn't end till here.
elsif($1-=~"want to return") # NOW Perl should properly evaulate this elsif()
{say("so be it, first i'll remove you from the guild");
setguild(0,0); # No closing brace here.
say ("then i'll remove your precious pvp flag, you may need to zone once I do, it may say you follow the ways of discord, but just zone and you'll be fine");
pvp(off);
} # End the elsif() part
|
|
 |
|
 |

04-01-2004, 11:13 AM
|
Dragon
|
|
Join Date: Jun 2002
Posts: 776
|
|
elseif works for sure? haven't played around with pearl questing much but I don't remember it working in the old system.
|

04-01-2004, 03:16 PM
|
Hill Giant
|
|
Join Date: Dec 2003
Posts: 166
|
|
Fer sure.  As long as the perl interpreter is running with no errors, it should work fine.
|

04-01-2004, 07:28 PM
|
Sarnak
|
|
Join Date: Mar 2004
Posts: 65
|
|
im not running the pearl quest.......I'm running a regular quest. the .qst extention..
Thank you for your input though, i'll mess with this in the morning, I'll apply your feedback and see the results I get and post them here in the morning!
Thank you also for running down a example, This will help me learn the quest system better. I am visual learner so over time i'll be good............hopefully hah.
|

04-02-2004, 03:51 AM
|
Demi-God
|
|
Join Date: Mar 2004
Posts: 1,066
|
|
Ah, I assumed you were using Perl. Not sure if that works with the .qst system but let me know how it goes.
|

04-02-2004, 06:54 AM
|
Sarnak
|
|
Join Date: Mar 2004
Posts: 65
|
|
only thing that does not work is pvp(off), i confirmed that sadly,
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 05:58 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |